{"openapi":"3.1.0","info":{"title":"Infero gateway","version":"1","summary":"OpenAI- and Anthropic-compatible inference gateway for open models","description":"Every open model behind one OpenAI- and Anthropic-compatible API key. The best price, tracked from the cheapest provider and only ever cut, with public price history and verified serving.\n\nPublic read endpoints need no key. Inference endpoints take `Authorization: Bearer sk-infero-...`. The `x-infero-provider` response header names the upstream that served each request; an `Idempotency-Key` request header makes retries billing-safe.","contact":{"name":"Infero","url":"https://www.infero.xyz"},"termsOfService":"https://www.infero.xyz/terms"},"externalDocs":{"description":"Quickstart","url":"https://www.infero.xyz/docs"},"servers":[{"url":"https://api.infero.xyz"}],"tags":[{"name":"public","description":"Readable without a key"},{"name":"inference","description":"Chat completions in the OpenAI and Anthropic dialects"}],"paths":{"/v1/models":{"get":{"tags":["public"],"operationId":"listModels","summary":"Models on the lineup, OpenAI list format","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Public model name to send as `model`"},"object":{"const":"model"},"owned_by":{"type":"string"},"new":{"type":"boolean","description":"Added to the lineup in the last 30 days"}}}}}}}}}}}},"/v1/pricing":{"get":{"tags":["public"],"operationId":"pricingBoard","summary":"The price per model","description":"The price per model, tracking the cheapest provider. Every route's provider is disclosed. Prices only move down automatically.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"pricing_model":{"type":"string"},"batch_discount":{"type":"string"},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"price_in":{"type":"number","description":"US dollars per one million tokens"},"price_out":{"type":"number","description":"US dollars per one million tokens"},"floor_in":{"type":["number","null"],"description":"US dollars per one million tokens"},"floor_out":{"type":["number","null"],"description":"US dollars per one million tokens"},"vision":{"type":"boolean"},"routes":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"cost_in":{"type":"number","description":"US dollars per one million tokens"},"cost_out":{"type":"number","description":"US dollars per one million tokens"}}}}}}}}}}}}}}},"/v1/pricing/history":{"get":{"tags":["public"],"operationId":"pricingHistory","summary":"Every price observation, oldest first","parameters":[{"name":"model","in":"query","schema":{"type":"string"},"description":"Limit to one public model name"},{"name":"days","in":"query","schema":{"type":"integer","default":365}},{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"formula":{"type":"string"},"history":{"type":"array","items":{"type":"object","properties":{"ts":{"type":"integer","description":"Unix seconds"},"model":{"type":"string"},"sticker_in":{"type":"number","description":"US dollars per one million tokens"},"sticker_out":{"type":"number","description":"US dollars per one million tokens"},"floor_in":{"type":"number","description":"US dollars per one million tokens"},"floor_out":{"type":"number","description":"US dollars per one million tokens"},"source":{"type":"string","description":"boot, admin, or auto_cut"}}}}}}},"text/csv":{"schema":{"type":"string"}}}}}}},"/v1/quality":{"get":{"tags":["public"],"operationId":"qualityScorecard","summary":"Verified-serving scorecard: canary pass rates per model, provider and check","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"window_days":{"type":"integer"},"verified_models":{"type":"array","items":{"type":"string"}},"tool_gated_routes":{"type":"array","items":{"type":"object","properties":{"model":{"type":"string"},"provider":{"type":"string"}}}},"results":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"check":{"type":"string","enum":["tool_call","code_gen","unicode"]},"passed":{"type":"integer"},"total":{"type":"integer"},"unavailable":{"type":"integer"},"pass_rate":{"type":"number"},"last_ts":{"type":"integer"}}}}}}}}}}}}},"/status":{"get":{"tags":["public"],"operationId":"status","summary":"Measured request outcomes and latency per provider and route","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"generated_at":{"type":"integer"},"last_24h":{"$ref":"#/components/schemas/StatusWindow"},"last_7d":{"$ref":"#/components/schemas/StatusWindow"}}}}}}}}},"/v1/images/generations":{"post":{"tags":["inference"],"operationId":"imageGenerations","summary":"OpenAI image generation, billed per image","description":"Use a model with kind `image` from /v1/models. Images are returned as `b64_json`, or as `data:` URLs when `response_format` is `url`. Only model, prompt, n, size and response_format are forwarded.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string"},"prompt":{"type":"string"},"n":{"type":"integer","minimum":1,"maximum":4},"size":{"type":"string","example":"1024x1024"},"response_format":{"type":"string","enum":["b64_json","url"]}}}}}},"responses":{"200":{"description":"`{created, data: [{b64_json} | {url}]}`"}}}},"/v1/audio/transcriptions":{"post":{"tags":["inference"],"operationId":"audioTranscriptions","summary":"OpenAI transcription, billed per second of audio","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["model","file"],"properties":{"model":{"type":"string"},"file":{"type":"string","format":"binary","description":"Audio, up to 25 MB"},"response_format":{"type":"string","enum":["json","text","verbose_json"]},"language":{"type":"string"},"prompt":{"type":"string"},"temperature":{"type":"number"}}}}}},"responses":{"200":{"description":"`{text}`, plain text, or verbose_json with `duration`"}}}},"/v1/audio/speech":{"post":{"tags":["inference"],"operationId":"audioSpeech","summary":"OpenAI text to speech, billed per character","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string"},"input":{"type":"string"},"voice":{"type":"string"},"speed":{"type":"number"},"response_format":{"type":"string","enum":["mp3","opus","aac","flac","wav","pcm"]}}}}}},"responses":{"200":{"description":"Audio bytes in the requested format (mp3 by default)"}}}},"/v1/chat/completions":{"post":{"tags":["inference"],"operationId":"chatCompletions","summary":"OpenAI Chat Completions dialect","description":"Request and response bodies follow the OpenAI Chat Completions API (messages, tools, stream, temperature, max_tokens). Extra: `provider: {only: [..], allow_fallbacks: bool}` pins a provider or disables failover.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","description":"A public model name from /v1/models"},"messages":{"type":"array","items":{"type":"object"}},"stream":{"type":"boolean"},"tools":{"type":"array","items":{"type":"object"}},"provider":{"type":"object","properties":{"only":{"type":"array","items":{"type":"string"}},"allow_fallbacks":{"type":"boolean"}}}},"additionalProperties":true}}}},"responses":{"200":{"description":"OpenAI chat.completion object, or SSE chunks when `stream` is true","headers":{"x-infero-provider":{"schema":{"type":"string"},"description":"Upstream that served the request"},"x-infero-balance-usd":{"schema":{"type":"string"},"description":"Remaining prepaid balance"}}},"401":{"description":"Missing or invalid key"},"402":{"description":"Balance exhausted"},"404":{"description":"Unknown model"},"429":{"description":"Rate limit"}}}},"/v1/messages":{"post":{"tags":["inference"],"operationId":"messages","summary":"Anthropic Messages dialect","description":"Request and response bodies follow the Anthropic Messages API (system, messages, tools, stream, max_tokens). Works with the Anthropic SDKs and Claude Code by setting the base URL.","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages","max_tokens"],"properties":{"model":{"type":"string"},"messages":{"type":"array","items":{"type":"object"}},"max_tokens":{"type":"integer"},"stream":{"type":"boolean"},"tools":{"type":"array","items":{"type":"object"}}},"additionalProperties":true}}}},"responses":{"200":{"description":"Anthropic message object, or SSE events when `stream` is true"},"401":{"description":"Missing or invalid key"},"402":{"description":"Balance exhausted"},"404":{"description":"Unknown model"}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"An API key, sk-infero-..."}},"schemas":{"StatusWindow":{"type":"object","properties":{"providers":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string"},"ok":{"type":"integer"},"fail":{"type":"integer"},"success_rate":{"type":"number"},"avg_latency_ms":{"type":["number","null"]}}}},"routes":{"type":"array","items":{"type":"object","properties":{"model":{"type":"string"},"provider":{"type":"string"},"ok":{"type":"integer"},"fail":{"type":"integer"},"success_rate":{"type":"number"},"avg_latency_ms":{"type":["number","null"]}}}}}}}}}