{"openapi":"3.1.0","info":{"title":"cheapinference.dev API","version":"1.1.0","description":"An OpenAI-only, stateless inference API. Use the official OpenAI SDK with this base URL and an organization key. OpenRouter provider routing/plugins, persisted provider resources, hosted tools, and media generation are outside this release's metered scope. Bodies are limited to 4 MB on the public domain."},"servers":[{"url":"https://www.cheapinference.dev/v1"}],"security":[{"apiKey":[]}],"paths":{"/responses":{"post":{"operationId":"createResponse","summary":"Create a Responses API response","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesRequest"}}}},"responses":{"200":{"description":"Provider response, or SSE when stream=true. Stream errors may arrive after HTTP 200.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Gateway request identifier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid or unsupported request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credit or spend limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Organization on hold","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 4 MB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Expected application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/chat/completions":{"post":{"operationId":"createChatCompletion","summary":"Create a Chat Completion","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}},"responses":{"200":{"description":"Provider response, or SSE when stream=true. Stream errors may arrive after HTTP 200.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Gateway request identifier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid or unsupported request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credit or spend limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Organization on hold","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 4 MB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Expected application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/embeddings":{"post":{"operationId":"createEmbedding","summary":"Create text embeddings","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingRequest"}}}},"responses":{"200":{"description":"Provider response, or SSE when stream=true. Stream errors may arrive after HTTP 200.","headers":{"x-request-id":{"schema":{"type":"string"},"description":"Gateway request identifier"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingResponse"}}}},"400":{"description":"Invalid or unsupported request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credit or spend limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Organization on hold","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 4 MB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Expected application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/models":{"get":{"operationId":"listModels","summary":"List supported OpenAI model identifiers","responses":{"200":{"description":"OpenAI-compatible model list","content":{"application/json":{"schema":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"type":"object","required":["id","object","created","owned_by"],"properties":{"id":{"type":"string"},"object":{"const":"model"},"created":{"type":"integer"},"owned_by":{"const":"openai"}}}}}}}}},"400":{"description":"Invalid or unsupported request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credit or spend limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Organization on hold","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 4 MB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Expected application/json","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"organization API key"}},"schemas":{"ResponsesRequest":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string","enum":["chat-latest","openai/chat-latest","gpt-3.5-turbo","openai/gpt-3.5-turbo","gpt-3.5-turbo-0125","openai/gpt-3.5-turbo-0125","gpt-3.5-turbo-1106","openai/gpt-3.5-turbo-1106","gpt-4-0613","openai/gpt-4-0613","gpt-4-turbo-2024-04-09","openai/gpt-4-turbo-2024-04-09","gpt-4.1","openai/gpt-4.1","gpt-4.1-mini","openai/gpt-4.1-mini","gpt-4.1-nano","openai/gpt-4.1-nano","gpt-4o","openai/gpt-4o","gpt-4o-2024-05-13","openai/gpt-4o-2024-05-13","gpt-4o-mini","openai/gpt-4o-mini","gpt-5","openai/gpt-5","gpt-5-mini","openai/gpt-5-mini","gpt-5-nano","openai/gpt-5-nano","gpt-5-pro","openai/gpt-5-pro","gpt-5-search-api","openai/gpt-5-search-api","gpt-5.1","openai/gpt-5.1","gpt-5.2","openai/gpt-5.2","gpt-5.2-pro","openai/gpt-5.2-pro","gpt-5.3-codex","openai/gpt-5.3-codex","gpt-5.4","openai/gpt-5.4","gpt-5.4-mini","openai/gpt-5.4-mini","gpt-5.4-nano","openai/gpt-5.4-nano","gpt-5.4-pro","openai/gpt-5.4-pro","gpt-5.5","openai/gpt-5.5","gpt-5.5-pro","openai/gpt-5.5-pro","gpt-5.6-luna","openai/gpt-5.6-luna","gpt-5.6-sol","openai/gpt-5.6-sol","gpt-5.6-terra","openai/gpt-5.6-terra","gpt-6-astra","openai/gpt-6-astra","gpt-rosalind-research","openai/gpt-rosalind-research","o1","openai/o1","o1-pro","openai/o1-pro","o3","openai/o3","o3-mini","openai/o3-mini","o3-pro","openai/o3-pro","o4-mini","openai/o4-mini"],"description":"OpenAI model ID. An optional openai/ prefix is accepted."},"stream":{"anyOf":[{"type":"boolean","default":false},{"type":"null"}]},"store":{"anyOf":[{"type":"boolean","const":false,"default":false,"description":"Stateless only. true is rejected."},{"type":"null"}]},"temperature":{"anyOf":[{"type":"number","minimum":0,"maximum":2},{"type":"null"}]},"top_p":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"service_tier":{"anyOf":[{"type":"string","enum":["default","auto"]},{"type":"null"}]},"parallel_tool_calls":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"user":{"type":"string","description":"Optional application end-user identifier. Never put secrets here."},"input":{"anyOf":[{"type":"string"},{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":true}}]},"instructions":{"type":"string"},"max_output_tokens":{"anyOf":[{"type":"integer","minimum":1,"maximum":200000,"description":"Must also fit the selected model's output limit. Includes reasoning tokens."},{"type":"null"}]},"reasoning":{"type":"object","properties":{"effort":{"type":"string"},"summary":{"type":"string"}},"additionalProperties":true},"text":{"type":"object","properties":{"format":{"type":"object","properties":{"type":{"enum":["text","json_object","json_schema"]}},"additionalProperties":true},"verbosity":{"enum":["low","medium","high"]}},"additionalProperties":true},"tools":{"type":"array","items":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["function","custom","namespace","local_shell","shell","apply_patch"]}},"additionalProperties":true,"description":"Client-executed tools. shell requires environment.type=local; namespace contents are checked recursively. Hosted tools are rejected."}},"tool_choice":{"anyOf":[{"type":"string","enum":["none","auto","required"]},{"type":"object"}]},"include":{"type":"array","items":{"enum":["reasoning.encrypted_content","message.output_text.logprobs"]}},"truncation":{"enum":["disabled","auto"]},"background":{"const":false},"previous_response_id":{"type":"null"}},"additionalProperties":true},"ChatRequest":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","enum":["chat-latest","openai/chat-latest","gpt-3.5-turbo","openai/gpt-3.5-turbo","gpt-3.5-turbo-0125","openai/gpt-3.5-turbo-0125","gpt-3.5-turbo-1106","openai/gpt-3.5-turbo-1106","gpt-4-0613","openai/gpt-4-0613","gpt-4-turbo-2024-04-09","openai/gpt-4-turbo-2024-04-09","gpt-4.1","openai/gpt-4.1","gpt-4.1-mini","openai/gpt-4.1-mini","gpt-4.1-nano","openai/gpt-4.1-nano","gpt-4o","openai/gpt-4o","gpt-4o-2024-05-13","openai/gpt-4o-2024-05-13","gpt-4o-mini","openai/gpt-4o-mini","gpt-5","openai/gpt-5","gpt-5-mini","openai/gpt-5-mini","gpt-5-nano","openai/gpt-5-nano","gpt-5-pro","openai/gpt-5-pro","gpt-5-search-api","openai/gpt-5-search-api","gpt-5.1","openai/gpt-5.1","gpt-5.2","openai/gpt-5.2","gpt-5.2-pro","openai/gpt-5.2-pro","gpt-5.3-codex","openai/gpt-5.3-codex","gpt-5.4","openai/gpt-5.4","gpt-5.4-mini","openai/gpt-5.4-mini","gpt-5.4-nano","openai/gpt-5.4-nano","gpt-5.4-pro","openai/gpt-5.4-pro","gpt-5.5","openai/gpt-5.5","gpt-5.5-pro","openai/gpt-5.5-pro","gpt-5.6-luna","openai/gpt-5.6-luna","gpt-5.6-sol","openai/gpt-5.6-sol","gpt-5.6-terra","openai/gpt-5.6-terra","gpt-6-astra","openai/gpt-6-astra","gpt-rosalind-research","openai/gpt-rosalind-research","o1","openai/o1","o1-pro","openai/o1-pro","o3","openai/o3","o3-mini","openai/o3-mini","o3-pro","openai/o3-pro","o4-mini","openai/o4-mini"],"description":"OpenAI model ID. An optional openai/ prefix is accepted."},"stream":{"anyOf":[{"type":"boolean","default":false},{"type":"null"}]},"store":{"anyOf":[{"type":"boolean","const":false,"default":false,"description":"Stateless only. true is rejected."},{"type":"null"}]},"temperature":{"anyOf":[{"type":"number","minimum":0,"maximum":2},{"type":"null"}]},"top_p":{"anyOf":[{"type":"number","minimum":0,"maximum":1},{"type":"null"}]},"service_tier":{"anyOf":[{"type":"string","enum":["default","auto"]},{"type":"null"}]},"parallel_tool_calls":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"user":{"type":"string","description":"Optional application end-user identifier. Never put secrets here."},"messages":{"type":"array","minItems":1,"items":{"type":"object","properties":{"role":{"enum":["system","developer","user","assistant","tool"]},"content":{"anyOf":[{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","additionalProperties":true}}]},{"type":"null"}]},"tool_calls":{"type":"array","items":{"type":"object"}},"tool_call_id":{"type":"string"}},"required":["role"],"additionalProperties":true}},"max_completion_tokens":{"anyOf":[{"type":"integer","minimum":1,"maximum":200000,"description":"Must also fit the selected model's output limit. Includes reasoning tokens."},{"type":"null"}]},"max_tokens":{"anyOf":[{"type":"integer","minimum":1,"maximum":200000,"description":"Must also fit the selected model's output limit. Includes reasoning tokens."},{"type":"null"}]},"n":{"const":1},"response_format":{"type":"object","properties":{"type":{"enum":["text","json_object","json_schema"]}},"additionalProperties":true},"reasoning_effort":{"type":"string"},"tools":{"type":"array","items":{"type":"object","required":["type","function"],"properties":{"type":{"const":"function"},"function":{"type":"object"}}}},"tool_choice":{"anyOf":[{"enum":["none","auto","required"]},{"type":"object"}]},"prediction":{"type":"object","required":["type","content"],"properties":{"type":{"const":"content"},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","additionalProperties":true}}]}}},"seed":{"type":"integer"},"frequency_penalty":{"type":"number","minimum":-2,"maximum":2},"presence_penalty":{"type":"number","minimum":-2,"maximum":2},"logprobs":{"type":"boolean"},"top_logprobs":{"type":"integer","minimum":0,"maximum":20},"logit_bias":{"type":"object","additionalProperties":{"type":"number","minimum":-100,"maximum":100}}},"additionalProperties":true},"EmbeddingRequest":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string","enum":["text-embedding-3-large","openai/text-embedding-3-large","text-embedding-3-small","openai/text-embedding-3-small","text-embedding-ada-002","openai/text-embedding-ada-002"],"description":"OpenAI model ID. An optional openai/ prefix is accepted."},"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"array","items":{"type":"integer"}},{"type":"array","items":{"type":"array","items":{"type":"integer"}}}]},"dimensions":{"type":"integer","minimum":1},"encoding_format":{"enum":["float","base64"]},"user":{"type":"string"}},"additionalProperties":true},"Response":{"type":"object","required":["id","object","status","output"],"properties":{"id":{"type":"string"},"object":{"const":"response"},"status":{"type":"string"},"output":{"type":"array","items":{"type":"object","additionalProperties":true}},"usage":{"type":["object","null"],"properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}},"additionalProperties":true},"error":{"type":["object","null"]},"incomplete_details":{"type":["object","null"]}},"additionalProperties":true},"ChatCompletion":{"type":"object","required":["id","choices"],"properties":{"id":{"type":"string"},"object":{"type":"string"},"choices":{"type":"array","items":{"type":"object","additionalProperties":true}},"usage":{"type":"object","additionalProperties":true}},"additionalProperties":true},"EmbeddingResponse":{"type":"object","required":["object","data","usage"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"embedding":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"number"}}]}}}},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}}}},"additionalProperties":true},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["message"],"properties":{"message":{"type":"string"},"type":{"type":"string"},"code":{"type":["string","null"]},"param":{"type":["string","null"]}},"additionalProperties":true}}}}}}