Skip to main content
POST
/
sessions
Create a new session
curl --request POST \
  --url https://api.example.com/sessions/ \
  --header 'Content-Type: application/json' \
  --header 'x-user-id: <x-user-id>' \
  --data '
{
  "agent_id": "<string>",
  "workspace_id": "<string>",
  "name": "<string>",
  "chat_model_config": {
    "type": "<string>",
    "credential_id": "<string>",
    "model": "<string>",
    "parameters": {}
  }
}
'
{
  "session_id": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.agentscope.io/llms.txt

Use this file to discover all available pages before exploring further.

Headers

x-user-id
string
required

Caller's user ID. Temporary header-based identity; will be replaced by JWT auth.

Body

application/json

Request body for creating a new session.

agent_id
string
required

Agent this session belongs to.

workspace_id
string | null

Workspace this session belongs to.

name
string | null

Display name. Defaults to current datetime if omitted.

chat_model_config
ChatModelConfig · object

Model provider and parameters. Can be set later via PATCH.

Response

Successful Response

Response body after creating a session.

session_id
string
required

Server-assigned session identifier.