Responses API
The OpenAI Responses API (/v1/responses) is supported natively — the agent-oriented successor to Chat Completions. Some newer models (such as GPT-5.1) expose capabilities only through Responses. Use the OpenAI SDK's responses.create() or any Responses-compatible client; the request body is forwarded upstream unchanged.
Endpoint
POST https://api.eclogue.ai/v1/responses The model goes in the body; stream with "stream": true.
Example request
{
"model": "gpt-5.1",
"input": [
{"role": "user", "content": "What is the capital of France?"}
],
"max_output_tokens": 200
} Required headers
| Header | Value | Description |
|---|---|---|
Authorization | Bearer gw-your-key | Your gateway API key |
Content-Type | application/json | Request body format |
Request body fields
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Platform model name, e.g. gpt-5.1 |
input | string or array | Yes | The input (replaces Chat's messages): either a plain string or an array of structured items |
instructions | string | No | System instruction (a separate field, not part of input) |
max_output_tokens | int | No | Maximum output tokens (Chat's max_tokens) |
reasoning | object | No | Reasoning control, e.g. {"effort":"medium"} |
tools | array | No | Tool definitions — function calling and built-in tools (see below) |
stream | bool | No | Whether to stream |
previous_response_id | string | No | Continue a multi-turn conversation held upstream |
Example response
{
"id": "resp_abc123",
"object": "response",
"status": "completed",
"model": "gpt-5.1",
"output": [
{
"type": "message",
"role": "assistant",
"content": [{"type": "output_text", "text": "The capital of France is Paris."}]
}
],
"usage": {
"input_tokens": 8,
"output_tokens": 7,
"total_tokens": 15,
"input_tokens_details": {"cached_tokens": 0},
"output_tokens_details": {"reasoning_tokens": 0}
}
} Output lives in output[], an array of typed items that replaces Chat's choices; the text is in content[].output_text of the type=="message" item. Usage is in usage: input_tokens / output_tokens (which includes reasoning) / input_tokens_details.cached_tokens / output_tokens_details.reasoning_tokens.
With curl
curl -X POST "https://api.eclogue.ai/v1/responses" \
-H "Authorization: Bearer gw-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.1",
"input": "Hello!",
"max_output_tokens": 100
}' Streaming
Set "stream": true and the response becomes a stream of typed semantic events (response.output_text.delta, response.completed, …). There is no [DONE] sentinel; the stream ends with response.completed, which carries the full usage:
curl -N -X POST "https://api.eclogue.ai/v1/responses" \
-H "Authorization: Bearer gw-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.1",
"input": "Tell me a story",
"stream": true
}' With the OpenAI SDK
from openai import OpenAI
# point at the gateway, use your gateway key
client = OpenAI(
api_key="gw-your-key-here",
base_url="https://api.eclogue.ai/v1",
)
resp = client.responses.create(
model="gpt-5.1",
input="Hello!",
)
print(resp.output_text) Built-in tools
Responses supports built-in tools executed on the model side (such as web_search). Declare them in tools; the upstream runs them and merges the results into output[]:
{
"model": "gpt-5.1",
"input": "What are today's top AI headlines?",
"tools": [{"type": "web_search"}]
} Built-in tools are charged per invocation, on top of tokens; see each model's pricing for rates. Ordinary function calls (type: "function") carry no extra charge and are billed on tokens alone.
Supported models
Models currently available over the Responses protocol:
gpt-5.1
See the models page for the full list and pricing.
Differences from Chat Completions
| Aspect | Chat Completions | Responses |
|---|---|---|
| Endpoint | /v1/chat/completions | /v1/responses |
| Input | messages[] | input + instructions |
| Output | choices[].message | output[] (typed items) |
| Output limit field | max_tokens | max_output_tokens |
| Streaming | delta chunks + [DONE] | Semantic events, no [DONE] |
| Token fields | prompt_tokens/completion_tokens | input_tokens/output_tokens |
| Built-in tools | None | web_search and others |
Chat Completions is not going away, but new model capabilities land in Responses first. All three protocols share the same API key, balance and billing.
Notes
- The request body is passed through unchanged. The gateway only reads
usagefrom the response to extract token counts and built-in tool invocations for billing. - In streaming responses only the
response.completedevent carries a completeusage— this is standard Responses behaviour.