DocsAPI referenceResponses API
Responses API
The OpenAI-compatible Responses endpoint — request fields, response shape, streaming.
POST
/v1/responsesA chat endpoint compatible with the OpenAI Responses API request body — the same interface coding tools like Codex use. Authenticate with Authorization: Bearer.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model id — see Models. |
input | string | array | Yes | User input: plain text, or an array of messages for multi-turn / multimodal input. |
instructions | string | No | System prompt. |
max_output_tokens | integer | No | Output token cap (minimum 16). |
stream | boolean | No | When true, the response streams over SSE — see Streaming. |
temperature / tools / … | — | No | Other official fields are forwarded as-is; support depends on the target model. |
curl https://api.soleapi.com/v1/responses \
-H "Authorization: Bearer $SOLEAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-fable-5",
"input": "Write a haiku about the sea",
"max_output_tokens": 200
}'Response
{
"id": "resp_abc123",
"object": "response",
"model": "claude-fable-5",
"status": "completed",
"output": [
{
"type": "message",
"role": "assistant",
"content": [
{ "type": "output_text", "text": "Waves fold into foam..." }
]
}
],
"usage": {
"input_tokens": 14,
"output_tokens": 23,
"total_tokens": 37
}
}The token counts in usage are what billing is based on; official SDKs expose the plain text via resp.output_text.
Related endpoints
POST /v1/responses/compactandPOST /v1/responses/input_tokens: helper endpoints used by the Codex client for context compaction and input-token estimation.
POST /v1/chat/completions is kept for legacy compatibility only. All new integrations should use the Responses API.