# OP Inference - **Get started** - [Overview](/docs): One OpenAI-compatible API for text, image, video, speech, transcription and music. - [Quickstart](/docs/quickstart): Make your first request in under a minute. - [Authentication and API keys](/docs/authentication): How requests are authenticated and how to manage keys. - [Models and pricing](/docs/models-and-pricing): Where to find every model, its inputs and its price. - **Text** - [Chat completions](/docs/text/chat-completions): Send messages to a text model and get a reply. - [Streaming](/docs/text/streaming): Receive a reply as it is generated, and what happens when a stream fails. - [Tool calling](/docs/text/tool-calling): Let a model call functions you define. - [Structured output](/docs/text/structured-output): Make a model reply with JSON that matches a schema. - [Tasks](/docs/text/tasks): Call a ready-made task, such as sentiment or receipt extraction, and get JSON that matches its schema. - [MCP](/docs/text/mcp): Give an MCP client your tasks, your presets and the workflow gallery as tools, billed exactly as a direct call. - [Fallbacks](/docs/text/fallbacks): Let other models answer when your first choice cannot. - **Media** - [How media jobs work](/docs/media/how-jobs-work): Submit a job, poll it, fetch the output. - [Images](/docs/media/images): Generate and edit images. - [Background removal](/docs/media/background-removal): Cut the subject out of an image and get back a PNG with a transparent background. - [Video](/docs/media/video): Generate video from text or from images. - [Speech](/docs/media/speech): Turn text into spoken audio. - [Transcription](/docs/media/transcription): Turn spoken audio into text. - [Music](/docs/media/music): Generate music from a description, with or without lyrics. - [Webhooks](/docs/media/webhooks): Get told when a media job finishes, instead of polling. - [Inputs](/docs/media/inputs): How to pass images, audio and video to a media job, and what each input name means. - **Agents** - [Agent tools](/docs/tools): Web search, page fetch and enrichment calls, run as jobs. - **Routing and data** - [Provider preferences](/docs/routing/provider-preferences): Constrain where a request may run and how the gateway ranks the candidates. - [Data retention](/docs/routing/data-retention): How long we keep what you send and what we generate, and how to keep nothing. - [Idempotency](/docs/routing/idempotency): Retry safely without paying twice. - [Request ids and metadata](/docs/routing/request-ids-and-metadata): Correlate a request with your own logs, and see how it was served. - **Account** - [Credits and billing](/docs/account/credits-and-billing): How prepaid credit works and what is billed. - [Rate limits](/docs/account/rate-limits): What happens when a request is rate limited, and how to back off. - [Key restrictions and spend caps](/docs/account/key-restrictions): Limit what a key can do and spend. - [Playground](/docs/account/playground): Try any model from the dashboard, and what the Playground key is. - **Reference** - [Errors](/docs/reference/errors): The error envelope and every error code. - [Changelog](/docs/reference/changelog): What changed and when. - API reference - [Overview](/docs/api-reference): Every endpoint, its request, its response and code samples. - [Cancel a job](/docs/api-reference/cancelJob): Ask for a queued or processing job to stop. A job that has already finished answers `409`. - [Cancel a tool run](/docs/api-reference/cancelToolRun): Ask for a queued or processing run to stop. A run that has already finished answers `409`. - [Create a chat completion](/docs/api-reference/createChatCompletion): Send a conversation and get a reply. Set `stream` to true for server-sent events. A request can fail over to another endpoint only before the first content token; after that the stream ends with a terminal frame instead. - [Generate an image](/docs/api-reference/createImage): Submit an image job. The answer is always a job resource, even when the image is ready at once. - [Generate music](/docs/api-reference/createMusic): Submit a music job. - [Generate speech](/docs/api-reference/createSpeech): Submit a text to speech job. - [Transcribe audio](/docs/api-reference/createTranscription): Submit a transcription job. The audio is an `https` URL in the JSON body, not a file upload. - [Generate a video](/docs/api-reference/createVideo): Submit a video job. - [Get a job](/docs/api-reference/getJob): Read a media job's state, progress and output. - [Get a model](/docs/api-reference/getModel): One model, including the inputs a media model accepts. Model ids contain a slash, which is part of the path. - [Get a tool](/docs/api-reference/getTool): One tool, including the input it accepts. A tool your key may not use answers `404 tool_not_found`, the same as one that does not exist. - [Get a tool run](/docs/api-reference/getToolRun): Read a tool run's status and output. - [List a model's providers](/docs/api-reference/listModelEndpoints): Every provider that serves the model for your key, with what you pay through it and its own rate, sorted by provider. A tool answers 404. - [List models](/docs/api-reference/listModels): Every model your key can use, with its modality and published price. - [List tasks](/docs/api-reference/listTasks): The latest version of every task your key may call: a key may call a task only if it may use every model the task lists. Each entry carries its input and output schema and an estimated price. Accuracy targets, each a target and not a measurement: field F1 of at least 0.90 for `receipt-extract` and `entities`, and at least 0.80 for `keywords`, scored against a committed corpus of at least 50 cases per task. - [List tools](/docs/api-reference/listTools): Every agent tool your key can use (web search, scrape and fetch, enrichment, SEO data), with its input and published price. - [MCP endpoint](/docs/api-reference/mcp): A Model Context Protocol server that offers your key's tasks and your tenant's presets as tools. Stateless: one JSON-RPC 2.0 request or notification per POST, answered as `application/json`, with no session. Supports protocol versions 2026-07-28, 2025-11-25 and 2025-06-18. A request that carries an `Origin` header is refused with 403. A tool call is served by the task or chat route and billed as that route is. Only served where the MCP flag is on. - [Run a task](/docs/api-reference/runTask): Run a task on an input and get JSON checked against its output schema. `{name}` is the task's name for its latest version, or `name@n` for version `n`. An answer that fails the schema is repaired once, as a second billed generation; a refusal or a cut-off answer is not. - [Run a tool](/docs/api-reference/runTool): Start a tool run. It answers `202` with the run, which you poll at `/v1/tools/runs/{id}`. The input is checked against the tool before anything is reserved. - **Integrations** - [OpenAI SDK](/docs/integrations/openai-sdk): Use the official OpenAI SDK for Python or TypeScript. - [LangChain](/docs/integrations/langchain): Use OP Inference from LangChain. - [Vercel AI SDK](/docs/integrations/vercel-ai-sdk): Use OP Inference from the Vercel AI SDK. - [Any OpenAI-compatible client](/docs/integrations/openai-compatible): Point any OpenAI-compatible client at OP Inference. - [Not supported](/docs/integrations/not-supported): What the API does not offer today.