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://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.

Other OpenAI-compatible endpoints

The same auth header also covers the endpoints below; request and response shapes match the OpenAI originals:

EndpointPurposeBilling
POST /v1/embeddingsText embeddings (text-embedding-3-small / -large)Per input token
POST /v1/images/generations · /v1/images/editsImage generation and editing, see Images & videoPer image
POST /v1/videos/generations · /v1/videos/edits · GET /v1/videos/{request_id}Asynchronous video generation (Grok Imagine), see Images & videoPer second, settled once the video is ready
POST /v1/responses/compact · /v1/responses/input_tokens · /v1/alpha/searchContext compaction, input-token estimation and web search used by the Codex clientCompaction per token; estimation free; search per call
GET /v1/usageAccount balance and total spend, see Billing & balanceFree, counts toward RPM
embeddings.sh
curl https://soleapi.com/v1/embeddings \
  -H "Authorization: Bearer $SOLEAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-embedding-3-small",
    "input": "The quick brown fox"
  }'

POST /v1/chat/completions is kept for legacy compatibility only. All new integrations should use the Responses API.