# Mesh API > One key, all AI models. The unified gateway for your AI infrastructure. ## Docs - [Welcome to Mesh API](https://developers.meshapi.ai/index.md): One key, all AI models. The unified gateway for your AI infrastructure. - [Quickstart](https://developers.meshapi.ai/docs/getting-started/quickstart.md): Get up and running with Mesh API in under 5 minutes. - [Account Configuration Checklist](https://developers.meshapi.ai/docs/getting-started/account-checklist.md): Configure funding, spend caps, keys, rate limits, fallbacks, caching, memory, templates, usage visibility, orgs, and BYOK — with the default for every setting. - [Pricing](https://developers.meshapi.ai/docs/getting-started/pricing.md): Understand how usage is measured and charged. - [Authentication](https://developers.meshapi.ai/docs/getting-started/authentication.md): Securely authenticate your requests to the Mesh API. - [API Keys](https://developers.meshapi.ai/docs/getting-started/api-keys.md): Create and manage inference keys programmatically — labels, limits, spend caps, model allow-lists, and org/team assignment. - [Rate Limits & Spend Caps](https://developers.meshapi.ai/docs/getting-started/rate-limits.md): How request, token, and spend limits are set across keys, teams, and orgs — and how MeshAPI resolves them when several apply at once. - [Organizations & Access Control](https://developers.meshapi.ai/docs/getting-started/organizations.md): Manage teams, roles, and usage limits across your organization. - [Dashboard](https://developers.meshapi.ai/docs/getting-started/dashboard.md): A guided tour of the Mesh API control panel. - [Auto Routing](https://developers.meshapi.ai/docs/capabilities/auto-routing.md): Dynamically route requests to the best model. - [Prompt Templates](https://developers.meshapi.ai/docs/capabilities/prompt-templates.md): Store, version, and reuse prompt configurations — with variable substitution — across your team and apps. - [Tool Calling](https://developers.meshapi.ai/docs/capabilities/tool-calling.md): Let models call your functions — the request/response cycle, multi-turn flow, and the provider-specific details MeshAPI handles for you. - [Structured Output](https://developers.meshapi.ai/docs/capabilities/structured-output.md): Constrain chat completion output to valid JSON or a strict JSON schema with response_format. - [Responses API](https://developers.meshapi.ai/docs/capabilities/responses-api.md): Reasoning effort, hosted server-side tools, and background jobs — the /v1/responses endpoint and how it differs from chat completions. - [Messages API (Anthropic-compatible)](https://developers.meshapi.ai/docs/capabilities/messages-api.md): Point an Anthropic SDK at Mesh and reach every model in the catalog through /v1/messages. - [Claude Code](https://developers.meshapi.ai/docs/capabilities/claude-code.md): Route Claude Code through Mesh to reach every model in the catalog, with your spend caps, rate limits and usage logging applied. - [Caching](https://developers.meshapi.ai/docs/capabilities/caching.md): Cut cost and latency with the gateway response cache and provider-side prompt caching — how each one works, when it applies, and how to opt out. - [Memory](https://developers.meshapi.ai/docs/capabilities/memory.md): Store per-user guardrails, preferences, and facts once, then attach them to any request with a single header. - [Batch API](https://developers.meshapi.ai/docs/capabilities/batch-api.md): Submit requests inline, create a batch, poll for completion, and read results inline. - [Model Compare](https://developers.meshapi.ai/docs/capabilities/model-compare.md): Compare multiple models with a single prompt. - [Embeddings](https://developers.meshapi.ai/docs/capabilities/embeddings.md): Create dense vector embeddings with the Mesh API and the official SDKs. - [Files & RAG](https://developers.meshapi.ai/docs/capabilities/rag.md): Upload your documents, search them semantically, and ground AI answers in your own content — all through the Mesh API. - [Web Search](https://developers.meshapi.ai/docs/capabilities/web-search.md): Search the live web through a single endpoint — engines, failover, filtering, and the flat per-search fee. - [Images & Vision](https://developers.meshapi.ai/docs/capabilities/images-vision.md): Send images to multimodal models and generate images through chat completions. - [Image Generation](https://developers.meshapi.ai/docs/capabilities/image-generation.md): Generate and edit images using frontier vision models via a single API. - [Video Generation](https://developers.meshapi.ai/docs/capabilities/video-generation.md): Generate videos from text, images, video clips, and audio using async video generation models. - [Audio](https://developers.meshapi.ai/docs/capabilities/audio.md): Send audio into chat completions and request audio output from supported models. - [Text to Speech](https://developers.meshapi.ai/docs/capabilities/text-to-speech.md): Text-to-speech, speech-to-text, voice management, and real-time streaming audio APIs. - [Speech to Text](https://developers.meshapi.ai/docs/capabilities/speech-to-text.md): Text-to-speech, speech-to-text, voice management, and real-time streaming audio APIs. - [Realtime Audio](https://developers.meshapi.ai/docs/capabilities/realtime-audio.md): Bi-directional speech-to-speech and realtime speech-to-text over WebSocket. - [Bring Your Own Keys (BYOK)](https://developers.meshapi.ai/docs/capabilities/byok.md): Use your own upstream provider credentials instead of the shared system keys. - [Notifications](https://developers.meshapi.ai/docs/capabilities/notifications.md): Subscribe to account events and receive them as signed HTTP callbacks or as email, in real time. - [Usage & Monitoring API](https://developers.meshapi.ai/docs/reference/usage-api.md): Pull your usage, spend, rate-limit, and balance data programmatically — the same numbers the dashboard shows. - [Install the Mesh CLI](https://developers.meshapi.ai/docs/cli/install.md): Install the Mesh CLI on macOS, Linux, or Windows and sign in with your API key. - [Using the Mesh CLI](https://developers.meshapi.ai/docs/cli/usage.md): Chat, switch models, and run code from your terminal with the Mesh CLI. - [Commands & permission modes](https://developers.meshapi.ai/docs/cli/commands.md): Every Mesh CLI slash command, plus the permission modes that govern what it may run. - [Architecture](https://developers.meshapi.ai/docs/platform/architecture.md): Behind the scenes of the Mesh AI Router. - [Retry & Fallback](https://developers.meshapi.ai/docs/platform/retry-and-fallback.md): How Mesh API automatically retries and reroutes requests when an upstream provider returns a transient error — which status codes trigger it, and how same-provider retries, cross-provider fallback, and model fallback fit together. - [Apigee](https://developers.meshapi.ai/docs/platform/apigee.md): Route Mesh API traffic through your own Apigee proxy — the target settings you must change, what Apigee cannot carry, and how to verify the path end to end. - [API versioning](https://developers.meshapi.ai/docs/reference/api-versioning.md): Mesh versions its contract by date. Pin a version with X-Mesh-Version so a future change to a response shape cannot change it underneath your code. - [Models](https://developers.meshapi.ai/docs/reference/models.md): Understanding model IDs, providers, capabilities, and how to choose the right model. - [Every model, one transparent price list.](https://developers.meshapi.ai/docs/reference/models-list.md): Real context windows and pay-as-you-go pricing per 1M tokens across text, image, audio, embedding and video models. One API key, one bill. - [Support](https://developers.meshapi.ai/docs/reference/support.md): Get help with Mesh API — debugging tips, contact options, and useful resources. - [Changelog](https://developers.meshapi.ai/changelog.md): New endpoints, breaking changes, deprecations, and SDK releases. - [API reference](https://developers.meshapi.ai/docs/reference/api-overview.md): What the Mesh API covers, its base URL, authentication, and how to use the interactive explorer. - [Chat Completions](https://developers.meshapi.ai/api/chat/chat-completions.md): OpenAI-compatible chat completions endpoint. - [Chat Compare](https://developers.meshapi.ai/api/chat/chat-compare.md): Send one conversation to several models at once and get their answers together. - [Generate Image](https://developers.meshapi.ai/api/images/generate-image.md): OpenAI-compatible image generation endpoint. - [Edit an image](https://developers.meshapi.ai/api/images/edit-an-image.md): OpenAI-compatible image editing endpoint. - [List Video Generations](https://developers.meshapi.ai/api/video/list-video-generations.md): List BytePlus video generation tasks persisted in MeshAPI's DB. - [Create Video Generation](https://developers.meshapi.ai/api/video/create-video-generation.md): Create a BytePlus Seedance video generation task. - [Get Video Generation](https://developers.meshapi.ai/api/video/get-video-generation.md): Retrieve the status and result of a BytePlus video generation task. - [List Batches](https://developers.meshapi.ai/api/batch/list-batches.md): List batch jobs for the authenticated key's owner. - [Create Batch](https://developers.meshapi.ai/api/batch/create-batch.md): Create a batch job. - [Get Batch](https://developers.meshapi.ai/api/batch/get-batch.md): Get batch status from the upstream provider. Usage logging and billing fire automatically on the first terminal observation. When the batch is completed and has an output file, the response includes a `results` key with the parsed output (list of per-request response objects). - [Cancel Batch](https://developers.meshapi.ai/api/batch/cancel-batch.md): Cancel an in-progress batch. Partial results may still be available. - [Create Response](https://developers.meshapi.ai/api/responses/create-response.md): Responses API endpoint — provider resolved dynamically from DB. - [Create Message](https://developers.meshapi.ai/api/messages/create-message.md): Anthropic-compatible Messages endpoint. - [Create Embeddings](https://developers.meshapi.ai/api/embeddings/create-embeddings.md): Turn text into embedding vectors. - [Classify content against the content policy](https://developers.meshapi.ai/api/moderations/classify-content-against-the-content-policy.md): Check text or images against the content policy before you act on them. - [Create Speech](https://developers.meshapi.ai/api/audio/create-speech.md): Convert text to speech. - [Create Transcription](https://developers.meshapi.ai/api/audio/create-transcription.md): Transcribe an audio file to text. - [Create Translation](https://developers.meshapi.ai/api/audio/create-translation.md): Translate speech in any language to English text. - [Create Transcription Translate](https://developers.meshapi.ai/api/audio/create-transcription-translate.md): Transcribe audio and translate it to English. - [List Voices](https://developers.meshapi.ai/api/audio/list-voices.md): List available TTS voices across every model brand, filterable by `brand`. - [Get Voice](https://developers.meshapi.ai/api/audio/get-voice.md): Return metadata for a single ElevenLabs voice by ID. - [Router Select](https://developers.meshapi.ai/api/router/router-select.md): Resolve the Auto Router's model choice for a prompt without running inference. - [Get Balance](https://developers.meshapi.ai/api/balance/get-balance.md): Return the credit balance for the authenticated caller. - [Get Error Catalog](https://developers.meshapi.ai/api/errors/get-error-catalog.md): Return the full error action-item catalog for client-side error surfacing. - [Query Usage Summary](https://developers.meshapi.ai/api/usage/query-usage-summary.md): Aggregate usage stats for the authenticated caller. - [Query Usage Events](https://developers.meshapi.ai/api/usage/query-usage-events.md): Paginated per-request event history for the authenticated caller. - [Get Usage Event Attempts](https://developers.meshapi.ai/api/usage/get-usage-event-attempts.md): Per-attempt timeline for one request (the served row + any retried rows sharing its request_id), oldest first — powers the logs drawer's "Attempts" history so a caller can see every model that was tried. Same customer-facing scrubbing as the events list (no provider names / admin fields). - [Get Rate Limits](https://developers.meshapi.ai/api/usage/get-rate-limits.md): Return live rate-limit usage (RPM / RPD / TPM) vs limits. Always reads fresh Redis counters — no caching. - [Get Spend Trend](https://developers.meshapi.ai/api/usage/get-spend-trend.md): Return historical spend bucketed by the chosen granularity, plus a trailing 3-bucket moving average and the window's total spend. - [List Audit Logs](https://developers.meshapi.ai/api/audit-logs/list-audit-logs.md): The caller's org trail. - [Export Audit Logs Csv](https://developers.meshapi.ai/api/audit-logs/export-audit-logs-csv.md): Same dependency as the JSON route, so the role gate cannot drift: a member who cannot list entries cannot download them either. - [List Catalog](https://developers.meshapi.ai/api/templates/list-catalog.md): Browse global templates, with this org's enable state on each row. - [List Categories](https://developers.meshapi.ai/api/templates/list-categories.md): Category counts for the filter chips, plus the total behind the "All" chip. - [Enable Template](https://developers.meshapi.ai/api/templates/enable-template.md): Add a global template to the org's library. Idempotent. - [Disable Template](https://developers.meshapi.ai/api/templates/disable-template.md): Remove a global template from the org's library. Idempotent. - [List Templates](https://developers.meshapi.ai/api/templates/list-templates.md): List templates for the caller's org. Admin/owner can filter by member_owner. - [Create Template](https://developers.meshapi.ai/api/templates/create-template.md): Create a template scoped to the authenticated user's owner. - [Get Template](https://developers.meshapi.ai/api/templates/get-template.md): Get a single template by UUID. Must belong to the caller's owner or their org. - [Delete Template](https://developers.meshapi.ai/api/templates/delete-template.md): Hard delete. Owner can delete own; org admin/owner can delete any org template. - [Update Template](https://developers.meshapi.ai/api/templates/update-template.md): Update a template. Owner can edit own; org admin/owner can edit any org template. - [List Threads](https://developers.meshapi.ai/api/playground/list-threads.md): The caller's threads, most recently updated first. - [Create Thread](https://developers.meshapi.ai/api/playground/create-thread.md): Create a playground thread owned by the authenticated caller. - [Get Thread](https://developers.meshapi.ai/api/playground/get-thread.md): Fetch one thread with its full message list. - [Delete Thread](https://developers.meshapi.ai/api/playground/delete-thread.md): Hard delete. A thread is scratch content — there is nothing to restore it for. - [Update Thread](https://developers.meshapi.ai/api/playground/update-thread.md): Update a thread. This is the autosave path — called once per turn. - [List Memories](https://developers.meshapi.ai/api/memory/list-memories.md): List memories in the caller's org (MESH-467). - [Create Memory](https://developers.meshapi.ai/api/memory/create-memory.md): Create a memory scoped to the authenticated caller's owner. - [Memory Usage](https://developers.meshapi.ai/api/memory/memory-usage.md): Per-memID request counts, injected tokens, and last-used, plus embed cost. - [Memory Counts](https://developers.meshapi.ai/api/memory/memory-counts.md): Totals for the dashboard's type rail (MESH-467). - [Get Memory](https://developers.meshapi.ai/api/memory/get-memory.md): Get a single memory and its items. Must belong to the caller's owner. - [Delete Memory](https://developers.meshapi.ai/api/memory/delete-memory.md): Hard delete a memory (cascades to its items). Owner-scoped. - [Update Memory](https://developers.meshapi.ai/api/memory/update-memory.md): Update a memory's name, description, is_active, or retention. Owner-only. - [List Memory Items](https://developers.meshapi.ai/api/memory/list-memory-items.md): List items for one of the caller's memories, ordered by position. - [Add Memory Item](https://developers.meshapi.ai/api/memory/add-memory-item.md): Add an item (preference/guardrail/fact) to one of the caller's memories. - [Revive Expired Items](https://developers.meshapi.ai/api/memory/revive-expired-items.md): Give every lapsed preference and fact in this memory a fresh deadline. - [Delete Memory Item](https://developers.meshapi.ai/api/memory/delete-memory-item.md): Delete a single item from one of the caller's memories. Owner-scoped. - [Update Memory Item](https://developers.meshapi.ai/api/memory/update-memory-item.md): Edit one item's content, key, or position. Owner-only. - [List dated API versions](https://developers.meshapi.ai/api/api-versions/list-dated-api-versions.md): Every dated version this deployment serves, oldest first. - [List Models](https://developers.meshapi.ai/api/models/list-models.md): List available models with per-user discounted pricing when applicable. - [Search Models](https://developers.meshapi.ai/api/models/search-models.md): Paginated, filterable, fuzzy-searchable model listing — server-side equivalent of the dashboard's former client-side table handling. - [List a model's providers and their prices](https://developers.meshapi.ai/api/models/list-a-models-providers-and-their-prices.md): Every upstream provider that can serve this model, with that provider's own price and capabilities. - [Get Model](https://developers.meshapi.ai/api/models/get-model.md): Return a single enabled model by its model ID with per-user discounted pricing. - [List Files](https://developers.meshapi.ai/api/rag/list-files.md): List the files you have uploaded, newest first. - [Init Upload](https://developers.meshapi.ai/api/rag/init-upload.md): Start a file upload and get a signed URL to PUT the bytes to. - [Get File Status](https://developers.meshapi.ai/api/rag/get-file-status.md): Get one file's processing status, and a short-lived download URL for it. - [Delete File](https://developers.meshapi.ai/api/rag/delete-file.md): Delete a file: purge its vectors, delete the object, soft-delete the row. - [Trigger Embedding Bulk](https://developers.meshapi.ai/api/rag/trigger-embedding-bulk.md): Manually enqueue embedding jobs for one or more files. - [Vector Search](https://developers.meshapi.ai/api/rag/vector-search.md): Search your uploaded files and get back the matching passages. - [Web Search](https://developers.meshapi.ai/api/web-search/web-search.md): Search the live web and get back ranked results with snippets. - [SDK Reference](https://developers.meshapi.ai/sdk/overview.md): Install the MeshAPI SDK for your language and make your first API call. - [Chat Completions](https://developers.meshapi.ai/sdk/chat.md): Send chat completion requests, build multi-turn conversations, and use prompt templates. - [Streaming](https://developers.meshapi.ai/sdk/streaming.md): Stream chat completions token by token, cancel mid-stream, and handle stream errors. - [Structured Output](https://developers.meshapi.ai/sdk/structured-output.md): Constrain model output to a JSON schema for reliable structured data extraction. - [Embeddings](https://developers.meshapi.ai/sdk/embeddings.md): Generate vector embeddings for text using the embeddings endpoint. - [Image Generation](https://developers.meshapi.ai/sdk/images.md): Generate images from text prompts. - [Audio](https://developers.meshapi.ai/sdk/audio.md): Text-to-speech synthesis, speech-to-text transcription, and listing available voices. - [Video Generation](https://developers.meshapi.ai/sdk/video.md): Submit video generation tasks, poll for completion, and list past generations. - [Batches](https://developers.meshapi.ai/sdk/batches.md): Submit async batch jobs, check status, and cancel pending batches. - [Model Compare](https://developers.meshapi.ai/sdk/compare.md): Send the same prompt to multiple models in parallel and compare their responses. - [Responses API](https://developers.meshapi.ai/sdk/responses.md): Use the Responses API to create and stream model responses. - [Prompt Templates](https://developers.meshapi.ai/sdk/templates.md): Create, update, delete, and use prompt templates with variable substitution. - [RAG (Files & Search)](https://developers.meshapi.ai/sdk/rag.md): Upload documents, generate embeddings, and search with vector similarity. - [Realtime Audio](https://developers.meshapi.ai/sdk/realtime.md): Connect to a bidirectional WebSocket session for real-time audio and text. - [Models](https://developers.meshapi.ai/sdk/models.md): List available models and filter by free or paid tier. - [Resilience](https://developers.meshapi.ai/sdk/resilience.md): Configurable retries, a client-side model fallback chain, and observability for retries and fallbacks. - [Error Handling](https://developers.meshapi.ai/sdk/error-handling.md): Catch typed API errors, read error codes, and configure automatic retries. - [MCP Server](https://developers.meshapi.ai/agent/mcp.md): Connect any MCP-compatible agent or client to Mesh and call models, tools, RAG, and more — authenticated with your Mesh API key. - [Mesh API](https://developers.meshapi.ai/debug/mesh-api.md): Map a Mesh API symptom to its cause and fix — auth, limits, bad requests, and upstream errors. - [BYOK](https://developers.meshapi.ai/debug/byok.md): Diagnose bring-your-own-key failures: credential shape, provider permissions, and silent fallback. - [Auto Routing](https://developers.meshapi.ai/debug/auto-routing.md): Why the auto router picked the model it did, and what to do when routing fails. - [Prompt Templates](https://developers.meshapi.ai/debug/prompt-templates.md): Fix templates that don't render, don't resolve, or don't apply the model you expected. - [Structured Output](https://developers.meshapi.ai/debug/structured-output.md): Fix schema rejections, malformed JSON, and models that ignore response_format. - [Images & Vision](https://developers.meshapi.ai/debug/images-vision.md): Fix image input failures — URL fetches, base64 payloads, and unsupported models. - [Image Generation](https://developers.meshapi.ai/debug/image-generation.md): Fix image generation errors, missing output, and unexpected response shapes. - [Video Generation](https://developers.meshapi.ai/debug/video-generation.md): Fix video generation task failures, stalled polling, and expired result URLs. - [Speech-to-Text](https://developers.meshapi.ai/debug/speech-to-text.md): Fix transcription failures — file formats, size limits, and model support. - [Text-to-Speech](https://developers.meshapi.ai/debug/text-to-speech.md): Fix speech synthesis errors, voice lookup failures, and audio format problems. - [Realtime Audio](https://developers.meshapi.ai/debug/realtime-audio.md): Fix realtime WebSocket sessions — handshake, auth, audio framing, and disconnects. - [RAG (Files & Search)](https://developers.meshapi.ai/debug/rag.md): Fix file uploads, stuck embeddings, and searches that return nothing. - [Embeddings](https://developers.meshapi.ai/debug/embeddings.md): Fix embedding request errors, dimension mismatches, and unsupported models. - [Compare](https://developers.meshapi.ai/debug/compare.md): Fix multi-model compare requests that partially fail or time out. - [Batch API](https://developers.meshapi.ai/debug/batch.md): Fix batch job submission errors, stuck jobs, and result download problems. - [Mesh CLI](https://developers.meshapi.ai/debug/mesh-cli.md): Fix Mesh CLI install, sign-in, and runtime problems. ## OpenAPI Specs - [openapi](https://developers.meshapi.ai/api/openapi.json)