Create a none or hosted session
POST/api/agents/v1/{instanceId}/sessions
Create a none or hosted session Set stream=true for SSE, otherwise receive the native session JSON. Keep the same Idempotency-Key for recovery; a changed request with the same key conflicts.
Organization API key authentication
Authorization: Bearer $SINECLOUD_API_KEYRequired scopes: agentRun
Parameters
instanceId· path · Required- An accessible Agents instance from the Console.
OpenAI-Beta· header · RequiredIdempotency-Key· header · Optional- Reuse with the original session creation body when recovering an uncertain response.
Request body
Required
application/json
Responses
200- Success
400- Invalid or unsupported request
401- Missing, invalid or revoked organization API key.
402- Insufficient funds or execution budget.
403- Product scope, instance, project, workspace or current entitlement denied.
404- Resource not found in this scope
409- State or idempotency conflict
413- Request body exceeds the route limit.
429- Rate or quota limit reached. Respect Retry-After when supplied.
501- Capability not implemented
502- Runtime response unavailable; read durable session state before attempting more execution.
503- Runtime, deployment, model or billing admission unavailable.
504- Gateway deadline exceeded; execution may have started. Inspect durable state before another submission.