1. Docs
  2. API reference
  3. Responses

Responses

POSThttps://api.airoutly.com/v1/responses

OpenAI's newer response API, used by Codex CLI and recent GPT models. Requests and responses follow the OpenAI format exactly.

Authentication

Send your key as Authorization: Bearer $AIROUTLY_API_KEY, or pass api_key to an OpenAI SDK.

Request body

ParameterDescription
modelstringrequiredA model that lists Resp in the Endpoints column of the models page, such as gpt-5.
inputstring | arrayrequiredA prompt string, or an array of input items (messages, images, tool results).
instructionsstringSystem-level instructions for this response.
streambooleanStream events as they are generated.
max_output_tokensintegerUpper limit on generated tokens, including reasoning tokens.
reasoningobjectFor example {"effort": "low"} on reasoning models.
toolsarrayFunctions the model may call.

Other OpenAI parameters are passed through to the model.

Example request

curl https://api.airoutly.com/v1/responses \
  -H "Authorization: Bearer $AIROUTLY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-5", "input": "Write a haiku about latency."}'

Response

200 OK
{
  "id": "resp_123",
  "object": "response",
  "model": "gpt-5",
  "status": "completed",
  "output": [{
    "type": "message",
    "role": "assistant",
    "content": [{ "type": "output_text", "text": "Packets in the dark…" }]
  }],
  "usage": { "input_tokens": 14, "output_tokens": 19, "total_tokens": 33 }
}

You are billed for usage at the model’s price on the models page. Reasoning tokens count as output.

Streaming

With "stream": true the reply arrives as server-sent events (response.output_text.delta, …) ending with response.completed, which carries the final usage.

Stateless usePass the full conversation in input each time rather than relying on stored responses.