Docs

Model APIs

Responses and conversation state

Use the Responses API and understand input, stream, store, previous_response_id, retrieval and deletion.

Updated

POST/v1/responses
GET/v1/responses/{response_id}
DELETE/v1/responses/{response_id}

Create a response

POST /v1/responses uses input rather than the Chat Completions messages field. input can be text or an array of input items. This endpoint is intended for Responses clients and requires a compatible model and serving route.

ParameterMeaning
modelRequired: model id visible to the key
inputText or input items; supply a task for a new conversation
streamtrue requests an event stream
storeRequests response storage, subject to deployment policy
previous_response_idContinues an accessible, unexpired stored response
cURL
curl --fail-with-body https://api.token4ai.cloud/v1/responses \
  -H "Authorization: Bearer $TOKEN4AI_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "model": "YOUR_MODEL_ID",
  "input": "Explain why streaming improves perceived latency.",
  "store": false
}'

Output items and events

The REST output field is an array of output items; message content may include output_text parts. SDKs may expose an output_text convenience property, which should not be assumed to exist as a top-level REST field. Streaming clients must handle Responses event types and terminal status rather than reuse a Chat Completions delta parser unchanged.

Retrieve, continue and delete

GET /v1/responses/{response_id} retrieves an accessible stored response; DELETE on the same path removes it. Use previous_response_id only when the response was stored. Storage depends on deployment policy, tenant authorization and retention, so it is not a permanent chat database.

If state is unavailable or expired, resubmit the necessary context from your application. Set store:false for requests that should not create conversation state and define your own retention policy. This does not imply zero retention across all operational logs or providers.

Related guides