Fency.ai
Sessions

Create streaming chat completion session

POST
/v1/sessions

Create a session for a STREAMING_CHAT_COMPLETION agent task. Use the returned clientToken via fetchCreateAgentTaskClientToken.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/v1/sessions" \  -H "Content-Type: application/json" \  -d '{    "createAgentTask": {      "taskType": "STREAMING_CHAT_COMPLETION"    }  }'
{  "id": "example-session-id",  "createdAt": "2024-04-08T17:02:27.887295Z",  "type": "CREATE_AGENT_TASK",  "clientToken": "client token"}