DocsAPI referenceResponses API

Responses API

The OpenAI-compatible Responses endpoint — request fields, response shape, streaming.

POST/v1/responses

A chat endpoint compatible with the OpenAI Responses API request body — the same interface coding tools like Codex use. Authenticate with Authorization: Bearer.

Request body

FieldTypeRequiredDescription
modelstringYesModel id — see Models.
inputstring | arrayYesUser input: plain text, or an array of messages for multi-turn / multimodal input.
instructionsstringNoSystem prompt.
max_output_tokensintegerNoOutput token cap (minimum 16).
streambooleanNoWhen true, the response streams over SSE — see Streaming.
temperature / tools / …NoOther official fields are forwarded as-is; support depends on the target model.
request.sh
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

response.json
{
  "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.

  • POST /v1/responses/compact and POST /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.