Create a bounded thread stream session
POST /v1/threads/{threadId}/stream-sessions · SDK createThreadStreamSession · CLI deployments thread session
Requires runs:read. A suspended organization can still call it.
AuthorizationBearer <token>Opaque bearer credential scoped to one service account and tenant.
threadId*string^[0-7][0-9A-HJKMNP-TV-Z]{25}$x-deployments-environment?stringRequired with a platform bearer JWT, where the three tenant headers select an environment the caller can access through active organization membership. Optional with an API key; when supplied, it must match the key's tenant.
^[0-7][0-9A-HJKMNP-TV-Z]{25}$x-deployments-organization?stringRequired with a platform bearer JWT, where the three tenant headers select an environment the caller can access through active organization membership. Optional with an API key; when supplied, it must match the key's tenant.
^[0-7][0-9A-HJKMNP-TV-Z]{25}$x-deployments-project?stringRequired with a platform bearer JWT, where the three tenant headers select an environment the caller can access through active organization membership. Optional with an API key; when supplied, it must match the key's tenant.
^[0-7][0-9A-HJKMNP-TV-Z]{25}$CreateThreadStreamSessionResponse
application/json- response
accessToken*stringhistory*array<>historyNextCursor?string1 <= length <= 4096session*streamUrl*stringcurl -X POST "https://example.com/v1/threads/string/stream-sessions"{ "accessToken": "string", "history": [ { "environmentId": "string", "organizationId": "string", "projectId": "string", "agentDeploymentId": "string", "body": "string", "bodyAccess": { "byteSize": 0, "contentType": "string", "expiresAt": "2019-08-24T14:15:22Z", "sha256": "string", "url": "string" }, "contentHash": "string", "createdAt": "2019-08-24T14:15:22Z", "id": "string", "inputArtifacts": [ "string" ], "inputOmissions": [ { "name": "string", "reason": "too_large" } ], "metadata": { "property1": null, "property2": null }, "object": "message", "role": "assistant", "runId": "string", "sequence": 0, "streamEventId": "string", "threadId": "string", "unlistedInputOmissions": 1 } ], "historyNextCursor": "string", "session": { "environmentId": "string", "expiresAt": "2019-08-24T14:15:22Z", "offset": "string", "organizationId": "string", "permissions": [ "append" ], "projectId": "string", "readUrl": "string", "replayState": { "canonicalMessageIds": [ "string" ], "eventIds": [ "string" ], "finalizedMessageIds": [ "string" ], "historyThroughSequence": 0 }, "sessionId": "string", "threadId": "string" }, "streamUrl": "string"}