Create or refresh a session
Creates or refreshes a session.
Description
This operation creates or refreshes a session.
Prerequisites
You have integrated the AI Creation Workshop software development kit (SDK). For more information, see Legacy SDK Reference.
Authorization
AK/SK. For more information about how to obtain an AK/SK, see API authorization.
Endpoint
https://openai.edu-aliyun.comRequest path
/scc/spRefreshOrCreateSessionRequest parameters
Name | Type | Required | Description | Example |
apiToken | string | Yes | The token. | 01j1w6cxqz**** |
roleId | string | No | The ID of the role attached to the session. | 01j2bapbjd**** |
sessionMode | integer | No | The session pattern. Valid values: 10 (session pattern) and 20 (inference pattern). The default value is 10. | 10 |
subProduct | string | No | The sub-product. Valid values: sd_webui and comfyui_api. | Default: sd_webui. This value creates or refreshes a WebUI session. |
gadgetId | string | No | The gadget ID. | 01jddpbjd**** |
expiredInSeconds | long | No | The time-to-live (TTL) of the session in seconds. The default TTL is 1 hour for session pattern and 24 hours for inference pattern. | 3600 |
customResourceConfigId | string | No | The ID of the resource configuration. You can specify multiple IDs separated by commas. For more information, see Resource pool configuration parameter format. |
Response parameters
Name | Type | Description |
data | object | The returned data. |
Data parameters
Name | Type | Description |
expiredAt | long | The expiration time of the session. This is a 13-digit UNIX timestamp. |
apiToken | string | The token. |
sessionUrl | string | The accessible URL. |
expiredInSeconds | long | The remaining TTL of the session in seconds. |