- Docs
- API reference
- Responses
Responses
POST
https://api.airoutly.com/v1/responsesOpenAI'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
| Parameter | Description |
|---|---|
modelstringrequired | A model that lists Resp in the Endpoints column of the models page, such as gpt-5. |
inputstring | arrayrequired | A prompt string, or an array of input items (messages, images, tool results). |
instructionsstring | System-level instructions for this response. |
streamboolean | Stream events as they are generated. |
max_output_tokensinteger | Upper limit on generated tokens, including reasoning tokens. |
reasoningobject | For example {"effort": "low"} on reasoning models. |
toolsarray | Functions 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."}'import os
from openai import OpenAI
client = OpenAI(base_url="https://api.airoutly.com/v1", api_key=os.environ["AIROUTLY_API_KEY"])
resp = client.responses.create(model="gpt-5", input="Write a haiku about latency.")
print(resp.output_text)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://api.airoutly.com/v1", apiKey: process.env.AIROUTLY_API_KEY });
const resp = await client.responses.create({ model: "gpt-5", input: "Write a haiku about latency." });
console.log(resp.output_text);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.