cheapinference.dev
API REFERENCE

API reference

Chat Completions, Responses, Embeddings, and Models.

Four endpoints. One familiar client.

Use Responses for new text-generation integrations. Existing Chat Completions integrations can keep their message format. Both use the same organization key and prepaid balance.

https://www.cheapinference.dev/v1
MethodPathReference
POST/responsesText, reasoning, structured output, and client tools
POST/chat/completionsExisting message-based integrations
POST/embeddingsText vectors for search and retrieval
GET/modelsSupported OpenAI model IDs

Responses · Chat Completions · Embeddings · Download OpenAPI 3.1

Request contract

Send Authorization: Bearer YOUR_KEY on every inference request, including model listing. POST bodies must be JSON and no larger than 4 MB on the public domain. Console cookies and Google sign-in tokens are not inference API keys.

Use an ID from GET /models. Both gpt-5.4-mini and openai/gpt-5.4-mini are accepted; the prefix is removed before forwarding. Other providers are not supported. Sampling options are omitted upstream when you omit them; the model applies its own defaults.

Model-specific restrictions still apply. A model may reject temperature, a tool definition, output length, or a schema even when the endpoint supports that field generally.

The supported OpenAI subset

CapabilitySupport
Responses and Chat CompletionsStreaming and non-streaming
Text / image inputs / inline PDF inputsOn compatible OpenAI models
JSON mode and strict JSON Schemaresponse_format (Chat), text.format (Responses)
Reasoningreasoning_effort (Chat), reasoning (Responses); encrypted item replay
Client toolsFunction, custom, namespace, local shell, apply-patch; see tool guide
Predicted OutputsChat Completions; model-dependent
Text embeddingsBatch inputs, dimensions, float/base64 encoding
Stored conversations and provider filesUnsupported; send complete history and inline content
Hosted tools and media generationNot enabled in this metered release
OpenRouter routing, plugins, BYOK, other providersOutside this OpenAI-only API
This is a documented subset, not full OpenRouter parity. Hosted search, interpreter/container tools, image/audio/video generation, and persistent provider resources are rejected because their separate resource costs or shared-account state are not covered by this service’s current token-only contract.

Responses, usage, and errors

Successful responses preserve OpenAI’s native JSON or SSE shape. The service does not add OpenRouter’s provider, usage.cost, or normalized finish-reason fields. Actual provider token usage drives credit settlement; your console contains the billed usage value.

x-request-id and x-relay-request-id identify the gateway request. x-upstream-request-id, when present, identifies the provider request. The OpenAI SDK’s request-ID helpers work with the standard header.

Read errors and limits and streaming before adding retries. A 200 status alone does not mean a streamed generation completed successfully.