{
    "openapi": "3.1.0",
    "info": {
        "title": "Inference APIs",
        "version": "2026-09-18",
        "summary": "OpenAI-compatible inference for open-weight models, embeddings, rerank and speech.",
        "description": "Base URL https://api.inferenceapis.com/v1. Requests and responses follow the OpenAI wire format; the official OpenAI SDKs work with base_url changed. Prepaid, per-token billing, no rate limits on your requests. Plain-text overview for agents: https://inferenceapis.com/llms.txt. Errors: https://inferenceapis.com/docs/errors.",
        "contact": {
            "name": "Inference APIs",
            "url": "https://inferenceapis.com/contact",
            "email": "support@inferenceapis.com"
        },
        "termsOfService": "https://inferenceapis.com/terms"
    },
    "servers": [
        {
            "url": "https://api.inferenceapis.com/v1"
        }
    ],
    "security": [
        {
            "bearer": []
        }
    ],
    "tags": [
        {
            "name": "chat"
        },
        {
            "name": "embeddings"
        },
        {
            "name": "audio"
        },
        {
            "name": "account"
        }
    ],
    "paths": {
        "/signup": {
            "post": {
                "tags": [
                    "account"
                ],
                "security": [],
                "summary": "Create an account and an API key without a browser",
                "description": "Returns a working key with a zero balance. The $1 starter credit is added when the person opens the confirmation email. Funds are added by a person at https://inferenceapis.com/billing. One account per email, throwaway domains refused, 5 signups per IP per day.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "email"
                                ],
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "name": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "password": {
                                        "type": "string",
                                        "minLength": 8,
                                        "description": "Optional. Without one, the person signs in with an emailed link."
                                    },
                                    "key_name": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "object": {
                                            "type": "string",
                                            "const": "signup"
                                        },
                                        "email": {
                                            "type": "string"
                                        },
                                        "api_key": {
                                            "type": "string",
                                            "description": "Shown once"
                                        },
                                        "base_url": {
                                            "type": "string"
                                        },
                                        "balance": {
                                            "type": "number"
                                        },
                                        "starter_credit": {
                                            "type": "object"
                                        },
                                        "top_up_url": {
                                            "type": "string"
                                        },
                                        "dashboard": {
                                            "type": "object"
                                        },
                                        "next_steps": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "docs": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/models": {
            "get": {
                "tags": [
                    "account"
                ],
                "security": [],
                "summary": "List models with prices, context length and capabilities",
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "object": {
                                            "type": "string"
                                        },
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Model"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/chat/completions": {
            "post": {
                "tags": [
                    "chat"
                ],
                "summary": "Chat completion (OpenAI format), streaming, tools, JSON mode, vision",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "model",
                                    "messages"
                                ],
                                "properties": {
                                    "model": {
                                        "type": "string",
                                        "description": "Chat or vision model. Canonical ids listed; aliases from GET /v1/models are accepted too.",
                                        "enum": [
                                            "openai/gpt-oss-120b",
                                            "deepseek-ai/DeepSeek-V4-Flash",
                                            "deepseek-ai/DeepSeek-V4.1-Flash",
                                            "zai-org/GLM-5.3-Flash",
                                            "meta-llama/Llama-3.3-70B-Instruct-Turbo",
                                            "zai-org/GLM-5.3",
                                            "deepseek-ai/DeepSeek-V4-Pro",
                                            "MiniMaxAI/MiniMax-M3",
                                            "moonshotai/Kimi-K2.7-Code",
                                            "Qwen/Qwen3-VL-235B-A22B-Instruct"
                                        ]
                                    },
                                    "messages": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "required": [
                                                "role",
                                                "content"
                                            ],
                                            "properties": {
                                                "role": {
                                                    "type": "string",
                                                    "enum": [
                                                        "system",
                                                        "developer",
                                                        "user",
                                                        "assistant",
                                                        "tool"
                                                    ]
                                                },
                                                "content": {
                                                    "oneOf": [
                                                        {
                                                            "type": "string"
                                                        },
                                                        {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object"
                                                            }
                                                        }
                                                    ]
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "tool_calls": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                },
                                                "tool_call_id": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    },
                                    "stream": {
                                        "type": "boolean"
                                    },
                                    "stream_options": {
                                        "type": "object"
                                    },
                                    "max_tokens": {
                                        "type": "integer"
                                    },
                                    "temperature": {
                                        "type": "number"
                                    },
                                    "top_p": {
                                        "type": "number"
                                    },
                                    "stop": {
                                        "oneOf": [
                                            {
                                                "type": "string"
                                            },
                                            {
                                                "type": "array",
                                                "items": {
                                                    "type": "string"
                                                }
                                            }
                                        ]
                                    },
                                    "tools": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    },
                                    "tool_choice": {
                                        "oneOf": [
                                            {
                                                "type": "string"
                                            },
                                            {
                                                "type": "object"
                                            }
                                        ]
                                    },
                                    "parallel_tool_calls": {
                                        "type": "boolean"
                                    },
                                    "response_format": {
                                        "type": "object",
                                        "description": "{\"type\":\"json_object\"} or {\"type\":\"json_schema\",\"json_schema\":{...}}"
                                    },
                                    "reasoning_effort": {
                                        "type": "string",
                                        "enum": [
                                            "none",
                                            "minimal",
                                            "low",
                                            "medium",
                                            "high"
                                        ],
                                        "description": "\"none\" switches thinking off on every reasoning model; the gateway maps it to the parameter each model honours."
                                    },
                                    "seed": {
                                        "type": "integer"
                                    },
                                    "user": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK (JSON, or text/event-stream when stream is true)"
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "502": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "503": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/responses": {
            "post": {
                "tags": [
                    "chat"
                ],
                "summary": "OpenAI Responses API (stateless), used by Codex CLI",
                "description": "Send the whole conversation in input on every call; previous_response_id, store and background are not supported. Codex CLI extensions are translated: namespace-wrapped MCP and sub-agent tools are expanded and calls come back with namespace restored; agent_message hand-offs become user messages. Streaming emits the standard response.* events.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "model",
                                    "input"
                                ],
                                "properties": {
                                    "model": {
                                        "type": "string",
                                        "description": "Chat model. Canonical ids listed; aliases from GET /v1/models are accepted too.",
                                        "enum": [
                                            "openai/gpt-oss-120b",
                                            "deepseek-ai/DeepSeek-V4-Flash",
                                            "deepseek-ai/DeepSeek-V4.1-Flash",
                                            "zai-org/GLM-5.3-Flash",
                                            "meta-llama/Llama-3.3-70B-Instruct-Turbo",
                                            "zai-org/GLM-5.3",
                                            "deepseek-ai/DeepSeek-V4-Pro",
                                            "MiniMaxAI/MiniMax-M3",
                                            "moonshotai/Kimi-K2.7-Code",
                                            "Qwen/Qwen3-VL-235B-A22B-Instruct"
                                        ]
                                    },
                                    "input": {
                                        "oneOf": [
                                            {
                                                "type": "string"
                                            },
                                            {
                                                "type": "array",
                                                "items": {
                                                    "type": "object"
                                                }
                                            }
                                        ]
                                    },
                                    "instructions": {
                                        "type": "string"
                                    },
                                    "tools": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    },
                                    "tool_choice": [],
                                    "stream": {
                                        "type": "boolean"
                                    },
                                    "max_output_tokens": {
                                        "type": "integer"
                                    },
                                    "reasoning": {
                                        "type": "object",
                                        "properties": {
                                            "effort": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "text": {
                                        "type": "object"
                                    },
                                    "temperature": {
                                        "type": "number"
                                    },
                                    "top_p": {
                                        "type": "number"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Response object, or text/event-stream"
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "402": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/messages": {
            "post": {
                "tags": [
                    "chat"
                ],
                "summary": "Anthropic Messages API, translated to the same chat models",
                "description": "Accepts the Anthropic request shape (x-api-key or Bearer auth) and returns Anthropic-shaped responses and errors, so Anthropic SDKs and Claude Code can use these models.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "model",
                                    "messages",
                                    "max_tokens"
                                ],
                                "properties": {
                                    "model": {
                                        "type": "string",
                                        "description": "Chat model. Canonical ids listed; aliases from GET /v1/models are accepted too.",
                                        "enum": [
                                            "openai/gpt-oss-120b",
                                            "deepseek-ai/DeepSeek-V4-Flash",
                                            "deepseek-ai/DeepSeek-V4.1-Flash",
                                            "zai-org/GLM-5.3-Flash",
                                            "meta-llama/Llama-3.3-70B-Instruct-Turbo",
                                            "zai-org/GLM-5.3",
                                            "deepseek-ai/DeepSeek-V4-Pro",
                                            "MiniMaxAI/MiniMax-M3",
                                            "moonshotai/Kimi-K2.7-Code",
                                            "Qwen/Qwen3-VL-235B-A22B-Instruct"
                                        ]
                                    },
                                    "messages": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    },
                                    "system": [],
                                    "max_tokens": {
                                        "type": "integer"
                                    },
                                    "stream": {
                                        "type": "boolean"
                                    },
                                    "tools": {
                                        "type": "array",
                                        "items": {
                                            "type": "object"
                                        }
                                    },
                                    "temperature": {
                                        "type": "number"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Anthropic message object, or text/event-stream"
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/embeddings": {
            "post": {
                "tags": [
                    "embeddings"
                ],
                "summary": "Text embeddings (OpenAI format)",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "model",
                                    "input"
                                ],
                                "properties": {
                                    "model": {
                                        "type": "string",
                                        "description": "Embedding model. Canonical ids listed; aliases from GET /v1/models are accepted too.",
                                        "enum": [
                                            "BAAI/bge-m3",
                                            "Qwen/Qwen3-Embedding-8B"
                                        ]
                                    },
                                    "input": {
                                        "oneOf": [
                                            {
                                                "type": "string"
                                            },
                                            {
                                                "type": "array",
                                                "maxItems": 1024,
                                                "items": {
                                                    "type": "string"
                                                }
                                            }
                                        ]
                                    },
                                    "encoding_format": {
                                        "type": "string",
                                        "enum": [
                                            "float",
                                            "base64"
                                        ]
                                    },
                                    "dimensions": {
                                        "type": "integer"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/rerank": {
            "post": {
                "tags": [
                    "embeddings"
                ],
                "summary": "Rerank documents for a query (Cohere-style response)",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "model",
                                    "query",
                                    "documents"
                                ],
                                "properties": {
                                    "model": {
                                        "type": "string",
                                        "description": "Rerank model. Canonical ids listed; aliases from GET /v1/models are accepted too.",
                                        "enum": [
                                            "Qwen/Qwen3-Reranker-8B"
                                        ]
                                    },
                                    "query": {
                                        "type": "string"
                                    },
                                    "documents": {
                                        "type": "array",
                                        "maxItems": 1000,
                                        "items": {
                                            "oneOf": [
                                                {
                                                    "type": "string"
                                                },
                                                {
                                                    "type": "object"
                                                }
                                            ]
                                        }
                                    },
                                    "top_n": {
                                        "type": "integer"
                                    },
                                    "return_documents": {
                                        "type": "boolean"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "OK: {results: [{index, relevance_score, document?}]}"
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/audio/speech": {
            "post": {
                "tags": [
                    "audio"
                ],
                "summary": "Text to speech (OpenAI format); OpenAI voice names are mapped",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "model",
                                    "input",
                                    "voice"
                                ],
                                "properties": {
                                    "model": {
                                        "type": "string",
                                        "description": "Speech model. Canonical ids listed; aliases from GET /v1/models are accepted too.",
                                        "enum": [
                                            "hexgrad/Kokoro-82M",
                                            "canopylabs/orpheus-3b-0.1-ft"
                                        ]
                                    },
                                    "input": {
                                        "type": "string",
                                        "maxLength": 20000
                                    },
                                    "voice": {
                                        "type": "string"
                                    },
                                    "response_format": {
                                        "type": "string",
                                        "enum": [
                                            "mp3",
                                            "wav",
                                            "opus",
                                            "flac",
                                            "pcm"
                                        ]
                                    },
                                    "speed": {
                                        "type": "number"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Audio bytes"
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/audio/transcriptions": {
            "post": {
                "tags": [
                    "audio"
                ],
                "summary": "Speech to text (OpenAI multipart format), with srt/vtt/verbose_json",
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "model",
                                    "file"
                                ],
                                "properties": {
                                    "model": {
                                        "type": "string",
                                        "description": "Transcription model. Canonical ids listed; aliases from GET /v1/models are accepted too.",
                                        "enum": [
                                            "openai/whisper-large-v3",
                                            "nvidia/parakeet-tdt-0.6b-v3",
                                            "mistralai/Voxtral-Small-24B-2507",
                                            "mistralai/Voxtral-Mini-3B-2507"
                                        ]
                                    },
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Up to 100 MB"
                                    },
                                    "language": {
                                        "type": "string",
                                        "description": "ISO 639-1; omit for auto-detect"
                                    },
                                    "response_format": {
                                        "type": "string",
                                        "enum": [
                                            "json",
                                            "text",
                                            "srt",
                                            "vtt",
                                            "verbose_json"
                                        ]
                                    },
                                    "timestamp_granularities[]": {
                                        "type": "string",
                                        "enum": [
                                            "word",
                                            "segment"
                                        ]
                                    },
                                    "prompt": {
                                        "type": "string"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Transcript"
                    },
                    "400": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "413": {
                        "description": "Error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearer": {
                "type": "http",
                "scheme": "bearer",
                "description": "API key from https://inferenceapis.com/api-keys or POST /v1/signup"
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "properties": {
                    "error": {
                        "type": "object",
                        "properties": {
                            "message": {
                                "type": "string"
                            },
                            "type": {
                                "type": "string"
                            },
                            "param": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "code": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "description": "See https://inferenceapis.com/docs/errors"
                            },
                            "docs_url": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "Model": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "object": {
                        "type": "string"
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "chat",
                            "vision",
                            "embedding",
                            "rerank",
                            "tts",
                            "stt"
                        ]
                    },
                    "canonical": {
                        "type": "string"
                    },
                    "pricing": {
                        "type": "object",
                        "description": "On canonical rows: input/output(/cached_input) or price, plus unit"
                    },
                    "context_length": {
                        "type": "integer"
                    },
                    "dimensions": {
                        "type": "integer"
                    },
                    "capabilities": {
                        "type": "object"
                    },
                    "aliases": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "docs": {
                        "type": "string"
                    }
                }
            }
        }
    }
}
