Reference
API reference
Generated from the gateway's OpenAPI schema. These are the public /v1 paths that OpenAI- and Anthropic-compatible clients call.
Public (SDK)
| Path | Method | Name |
|---|---|---|
/v1/chat/completions | POST | Chat Completions |
/v1/messages | POST | Anthropic Messages |
/v1/models | GET | List Models |
/v1/responses | POST | Responses |
/v1/responses/{response_id} | GET · DELETE | Get Response |
/v1/chat/completions
OpenAI-compatible chat completions. Accepts model as a concrete provider id, a routing alias (auto, cheap, frontier, auto-coding, auto-research, default), or a cap:-prefixed capability handle. See Routing and Capability aliases.
curl https://gateway.fairmeter.in/v1/chat/completions \
-H "Authorization: Bearer gw_live_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"model":"auto","messages":[{"role":"user","content":"hi"}]}'Response carries the standard OpenAI shape plus routing headers:
200 OK X-Request-Id: 8f14e45f-ceea-467a-9c33-1a2b3c4d5e6f x-iq-routing: tier=simple;thinking=none x-iq-served-model: gpt-4o-mini
/v1/messages
Anthropic-compatible messages endpoint. Use the bare gateway origin (no /v1) as the SDK’s base_url; the Anthropic client appends /v1/messages itself.
curl https://gateway.fairmeter.in/v1/messages \
-H "Authorization: Bearer gw_live_xxxxxxxx" \
-H "Content-Type: application/json" \
-H "anthropic-version: 2023-06-01" \
-d '{"model":"claude-haiku-4-5","max_tokens":256,"messages":[{"role":"user","content":"Say hi."}]}'/v1/models
Lists every model id the gateway can route to across OpenAI, Anthropic, and Google, plus the routing aliases and any cap: capability handles resolvable for your org. No scope beyond a valid key is required.
curl https://gateway.fairmeter.in/v1/models \ -H "Authorization: Bearer gw_live_xxxxxxxx"
/v1/responses
Stateful responses surface. The gateway keeps the conversation server-side; pass previous_response_id on a follow-up call instead of resending the transcript.
POST /v1/responses
{
"model": "auto",
"input": "Summarise this contract."
}
→ { "id": "resp_01HZ...", "model": "gpt-4o-mini", "output": [...] }
POST /v1/responses
{
"model": "auto",
"input": "Now do the same for the addendum.",
"previous_response_id": "resp_01HZ..."
}/v1/responses/{response_id}
GET retrieves a previously created response by id. DELETE removes the stored conversation state for that response id ahead of its normal TTL. See Security for how conversation-state TTLs interact with Zero Data Retention.
curl https://gateway.fairmeter.in/v1/responses/resp_01HZ... \ -H "Authorization: Bearer gw_live_xxxxxxxx" curl -X DELETE https://gateway.fairmeter.in/v1/responses/resp_01HZ... \ -H "Authorization: Bearer gw_live_xxxxxxxx"