API overview
Base URL and formats
Section titled “Base URL and formats”All requests go to https://api.inferam.ai over HTTPS. The same model sits behind three wire formats, so official OpenAI and Anthropic SDKs work by changing only the base URL and key:
| Format | Endpoint | Used by |
|---|---|---|
| OpenAI Chat Completions | POST /v1/chat/completions |
opencode, pi, most OpenAI-compatible tools |
| OpenAI Responses | POST /v1/responses |
Codex |
| Anthropic Messages | POST /v1/messages, POST /v1/messages/count_tokens |
Claude Code, DeepSeek Harness |
SDK base URLs: OpenAI SDKs take https://api.inferam.ai/v1, and Anthropic SDKs take https://api.inferam.ai.
Authentication
Section titled “Authentication”Send an Inferam key either way:
Authorization: Bearer ifr_...x-api-key: ifr_...Create and revoke keys on inferam.ai/keys. A key’s full value is shown once, when it’s created; Inferam stores only a hash. A revoked key stops working on its next request. Keys created by inferam auth login expire after 30 days without use; keys you create on the dashboard don’t expire.
A missing, invalid or revoked key gets a 401 in the format’s own error shape (see Errors).
The API allows cross-origin requests (CORS) from any origin, so browser-based clients can call it directly. Requests still need a key, and anyone who can see the page can see the key it uses, so don’t put a key in a public web page.
Models
Section titled “Models”GET /v1/models lists the models Inferam is serving. The response parses with both the OpenAI and the Anthropic SDKs:
{ "object": "list", "data": [{ "id": "DeepSeek-V4.1-Flash-1017", "object": "model", "type": "model", "display_name": "DeepSeek-V4.1-Flash-1017", "owned_by": "inferam", "created_at": "2026-01-01T00:00:00Z" }], "has_more": false, "first_id": "DeepSeek-V4.1-Flash-1017", "last_id": "DeepSeek-V4.1-Flash-1017"}Use the ID from this list as model. When the served model changes, the list changes with it. A request naming any other model gets a 404 that lists the available ones.
Limits
Section titled “Limits”| Limit | Value |
|---|---|
| Context window | 262,144 tokens |
| Default output limit | 32,768 tokens, when a request sets none |
| Maximum output limit | 65,536 tokens. Larger values are lowered to this |
| Request body | 32 MB |
| Wait for capacity | up to 30 seconds, then a capacity error |
The output limit is max_tokens or max_completion_tokens in Chat Completions, max_output_tokens in Responses, and max_tokens in Messages. It must be a positive integer. Reasoning tokens count toward it.
Capacity and fair queueing
Section titled “Capacity and fair queueing”Inferam runs a fixed number of generations at once. When all are busy, your request waits in a queue for up to 30 seconds. Nothing is streamed before it’s admitted. While requests are waiting, the next free slot goes to the waiting account with the fewest generations running, so one busy account can’t starve the others. An account alone on the service can use every slot.
If no slot frees up within 30 seconds, you get a capacity error with Retry-After: 5: 503 in the OpenAI formats, or 529 overloaded_error in Anthropic Messages. Coding agents and the official SDKs retry these automatically.
Very long prompts, over about 128,000 tokens, are admitted one at a time. Reading one from scratch takes the model server a minute or more, and nothing else can start meanwhile. Shorter requests go ahead of a long one that’s waiting. A long request that times out gets Retry-After: 30.
If the client disconnects, its generation is stopped and the slot freed.
Usage reporting
Section titled “Usage reporting”Every response reports input, output and cached input tokens. These are the same numbers shown on inferam.ai/usage.
| Format | Input | Output | Cached input |
|---|---|---|---|
| Chat Completions | usage.prompt_tokens |
usage.completion_tokens |
usage.prompt_tokens_details.cached_tokens |
| Responses | usage.input_tokens |
usage.output_tokens |
usage.input_tokens_details.cached_tokens |
| Messages | usage.input_tokens + usage.cache_read_input_tokens |
usage.output_tokens |
usage.cache_read_input_tokens |
In Anthropic Messages, input_tokens excludes cached tokens, as in Anthropic’s own API. Prompt caching is automatic: repeated prefixes, such as an agent’s system prompt and earlier turns, are served from cache. You don’t need cache-control markers, and cache_creation_input_tokens is always 0.
Conversation state
Section titled “Conversation state”Inferam keeps no conversation state between requests. Every request carries the full conversation, as Chat Completions and Messages always do. In Responses, store is always false and previous_response_id is rejected.
Public stats
Section titled “Public stats”GET https://api.inferam.ai/public/stats needs no key. It returns Inferam’s lifetime totals across all accounts, the numbers shown at the bottom of inferam.ai:
{ "object": "stats", "updated_at": "2026-10-29T07:10:00.000Z", "input_tokens": 182400000, "output_tokens": 9310000, "cached_tokens": 151200000, "tokens_per_second": 87.4, "notice": null}tokens_per_second is output tokens divided by generation time (excluding time to first token), or null before any generation. notice is the headline shown across inferam.ai during planned maintenance or an incident, otherwise null. The response is cached for 10 seconds and allows any origin (Access-Control-Allow-Origin: *). It never breaks totals down by account, key or time, and Inferam’s own status probes aren’t counted. inferam.ai/usage-dashboard shows these totals live.
Status
Section titled “Status”Live availability and response times are on status.inferam.ai. It’s checked every 5 minutes from two regions, including a real one-token generation.