页面简介
Access 400+ AI models across providers through one endpoint with Vercel AI Gateway. Zero token markup, automatic fallbacks, BYOK, budgets, and observability.
正文摘录
Get API keyGet API keyRead the docsThe AI Gateway for developers400+ models at provider speed with near-zero overhead. One endpoint, no markup. Text, image, video, audio, realtime, retrieval, decisions, and tools.APIClaude CodeCodexHermesCommand CodeOpenClawfxAI SDKChat CompletionsMessagesResponsesAI SDKChat CompletionsMessagesResponsesTypeScriptPythonimport { streamText } from 'ai' const result = streamText({ model: 'spacexai/grok-4.7', prompt: 'Why is the sky blue?'})Copy for agentRead docsSpaceXAIOpenAIAnthropicGeminiOSSAnd More0%0%No markup on tokensPay provider prices,never a cent more.Invoicing is available with no payment processing fees. See the AI Gateway pricing docs.Optimize routing for availability, cost, or latencyIf a provider degrades, the Gateway fails over to the same model on another provider. Identical output, no downtime.Everyday requests route to a cost-efficient open model. Complex jobs escalate to a frontier model only when needed.Latency-sensitive requests route to the fastest-responding model for the lowest time to first token. Heavier requests fall through to a larger model.AvailabilityCostsLatencyAppProvider degraded?Claude Fable 5.2AnthropicDegradedClaude Fable 5.2Amazon BedrockLatency figures are illustrative and vary by region, traffic, and prompt length.Routing, billing, and observability in one placeCall every model through one endpoint, pay provider prices on one bill, and see every request in one dashboard.One endpoint, 400+ models. Unified billing and observability across your entire AI stack, with text, image, video, audio, realtime, retrieval, decision, and tool models.Route on behavior, fallback anytime. Automatic fallbacks keep your app up during provider outages, and virtual models let you change routing without a redeploy.OpenAI$12.47Anthropic$8.22SpaceXAI$4.31Platform fee$0.00Total$25.00No markup, just fair prices. Pay exactly what providers charge with no platform fees.Works with your existing AI stack- X_AI_API_KEY- ANTHROPIC_API_KEY- OPEN_AI_API_KEY+ AI_GATEWAY_API_KEYMove existing OpenAI, Anthropic, and AI SDK integrations to AI Gateway with a base URL swap.AISDKThe AI SDK is the open-source toolkit designed to help developers build AI-powered applications and agents with React, Next.js, Vue, Svelte, Node.js, and more.OpenAI Chat CompletionsOpenAI ResponsesAnthropic MessagesOpen ResponsesSeamless migrationPoint your existing OpenAI or Anthropic SDK at AI Gateway. Same calls, no rewrites.Bring your own keysBring your own provider keys with no platform fee. Existing commitments flow through.Models on day zeroImmediate launch partner with major labs. New models work the minute they ship.Recent shipsView the changelog3 DecemberChangelogQwen4-35B-A3B now available on AI GatewayJerilyn Zheng, Zachary Chen3 DecemberChangelogMAI-Transcribe-2.5 now available on AI GatewayKevin Dawkins, Zachary Chen, and 1 other3 DecemberChangelogMiniMax M4 now available on AI GatewayJerilyn Zheng, Zachary Chen“Moving to the gateway is just so ergonomic. We get references to model names, and rely on Vercel to do the correct implementations and handle the edge cases.”Rob CheungCo-founderHow Zo Computer improved AI reliability 20×20xImprovement in AIreliability after switching30sTo adopt a new model,down from an hour of code25%Improvement in averagelatency on model callsSecurity and complianceRoute only to ZDR providers, no training or prompt logging, configurable per request or team-wide.Zero Data RetentionEnforced on every request across your team. Routes only to providers under a ZDR agreement.No training on your dataRoute only to providers that will not train on customer data, configurable per request.Provider allowlistRestrict your team to approved providers. Enforced on every request, no code changes.Model allowlistRestrict your team to approved models. Enforced on every request, no code changes.Regional inferencePin inference to the United States, the European Union, Australia, or Japan, where the provider supports it.Private InferenceConnect your own model endpoints and call them with the same SDKs, authentication, and observability.Take controlManage usage across teams with budgets, quotas, and full request visibility.Set controlsBudgets. Cap spend with budgets at the team, project, API key, and user level.Virtual models. Save a model with its routing, fallbacks, and compliance settings under one ID, and change it without a redeploy.Routing rules. Rewrite one model to another or block a model for your whole team, with no code changes.API key management. Create, view, and delete keys from the dashboard, CLI, or API.Short-lived OIDC tokens. Authenticate with expiring credentials. No static credentials to manage.See everythingCustom Reporting API. Tag requests by user, customer, feature, or environment. Analyze spend in the dashboard or your own systems.Dashboard observability. Usage, spend, requests, TTFT, and token counts at team, API key, and project scope.Request logs. Search and filter every request, follow traffic live, and open one to see how it routed and what it cost.Trace drains. Send an OpenTelemetry trace of every request to the observability tool you already use.Live on AWS MarketplaceBuy with private offers, using your existing cloud commits.View the listingEvery modality you needText, image, video, realtime, speech, transcription, embeddings, reranking, decisions, and web search tools through one endpoint.TextAccess the latest from every major model lab and provider. Power your AI features all through a single endpoint.ImageGenerate and edit with the latest image models, no extra setup.VideoShip production-ready video across a wide range of models from a single prompt.RealtimeBuild voice and live multimodal experiences with realtime models through a single endpoint.SpeechTurn text into natural, expressive speech with the latest text-to-speech models, all through one endpoint.TranscriptionTranscribe audio to text with leading speech-to-text models, no extra setup.EmbeddingsVector embeddings for search, retrieval, and RAG pipelines, with every major provider available through one endpoint.RerankingImprove retrieval relevance by reordering results before they hit your model.OpenAIVercel provides a workflow to develop, deploy, and host websites, apps, and serverless functions. Teams can manage code from preview through production, while Vercel’s edge network and automatic scaling support delivery to users worldwide.[0.234, -0.198, 0.567, 0.012, -0.823, 0.445, -0.671, 0.298, 0.789, -0.234, 0.617, 0.082, -0.301, 0.519, -0.448, 0.176, 0.902, -0.057, 0.388, -0.741, 0.263, 0.014, -0.598, 0.831, -0.122, 0.476, 0.249, -0.687, 0.354, 0.911, -0.205, 0.066, 0.498, -0.379, 0.732, -0.461, 0.187, 0.853, -0.092, 0.541, 0.318, -0.226, 0.679, -0.518, 0.034, 0.793, -0.347, 0.612, 0.158, -0.806, 0.273, 0.469, -0.135, 0.587, 0.821, -0.044, 0.396, -0.752, 0.218, 0.503, -0.661, 0.129, 0.874, -0.317, 0.452, 0.085, -0.539, 0.706, -0.198, 0.361, 0.927, -0.475, 0.244, -0.683, 0.518, 0.039, -0.792, 0.155, 0.642, -0.288, 0.471, 0.836, -0.107, 0.523, -0.366, 0.018, 0.748, -0.491, 0.265, 0.882, -0.146, 0.397, 0.609, -0.728, 0.184, 0.456, -0.029, 0.713, -0.554, 0.298, 0.067, -0.421, 0.836, -0.193, 0.512, 0.347, -0.768, 0.124, 0.658, -0.385, 0.901, 0.071, -0.469, 0.234, 0.587, -0.812, 0.156, 0.473, -0.628, 0.319, 0.052, -0.741, 0.486, 0.207, -0.563, 0.894, -0.135, 0.428, 0.671, -0.298, 0.519, 0.084, -0.756, 0.347, 0.918, -0.412, 0.176, -0.689, 0.245, 0.561, -0.328, 0.073, 0.842, -0.197, 0.453, -0.726, 0.288, 0.617, 0.039, -0.504, 0.871, -0.265, 0.392, 0.158, -0.673, 0.527, 0.084, -0.439, 0.916, -0.221, 0.358, 0.495, -0.782, 0.146, 0.629, -0.317, 0.058, 0.847, -0.473, 0.196, 0.534, -0.628, 0.279, 0.913, -0.045, 0.461, 0.184, -0.752, 0.398, 0.625, -0.171, 0.043, 0.789, -0.526, 0.314, 0.867, -0.082, 0.471, -0.638, 0.219, 0.582, -0.395, 0.146, 0.704, -0.273, 0.519, 0.038, -0.846, 0.187, 0.493, -0.561, 0.328, 0.075, -0.412, 0.901, -0.246]1Cache invalidation guide2How streaming works3Routing edge cases4Provider failover patternsTextAccess the latest from every major model lab and provider. Power your AI features all through a single endpoint.OpenAIVercel provides a workflow to develop, deploy, and host websites, apps, and serverless functions. Teams can manage code from preview through production, while Vercel’s edge network and automatic scaling support delivery to users worldwide.[0.234, -0.198, 0.567, 0.012, -0.823, 0.445, -0.671, 0.298, 0.789, -0.234, 0.617, 0.082, -0.301, 0.519, -0.448, 0.176, 0.902, -0.057, 0.388, -0.741, 0.263, 0.014, -0.598, 0.831, -0.122, 0.476, 0.249, -0.687, 0.354, 0.911, -0.205, 0.066, 0.498, -0.379, 0.732, -0.461, 0.187, 0.853, -0.092, 0.541, 0.318, -0.226, 0.679, -0.518, 0.034, 0.793, -0.347, 0.612, 0.158, -0.806, 0.273, 0.469, -0.135, 0.587, 0.821, -0.044, 0.396, -0.752, 0.218, 0.503, -0.661, 0.129, 0.874, -0.317, 0.452, 0.085, -0.539, 0.706, -0.198, 0.361, 0.927, -0.475, 0.244, -0.683, 0.518, 0.039, -0.792, 0.155, 0.642, -0.288, 0.471, 0.836, -0.107, 0.523, -0.366, 0.018, 0.748, -0.491, 0.265, 0.882, -0.146, 0.397, 0.609, -0.728, 0.184, 0.456, -0.029, 0.713, -0.554, 0.298, 0.067, -0.421, 0.836, -0.193, 0.512, 0.347, -0.768, 0.124, 0.658, -0.385, 0.901, 0.071, -0.469, 0.234, 0.587, -0.812, 0.156, 0.473, -0.628, 0.319, 0.052, -0.741, 0.486, 0.207, -0.563, 0.894, -0.135, 0.428, 0.671, -0.298, 0.519, 0.084, -0.756, 0.347, 0.918, -0.412, 0.176, -0.689, 0.245, 0.561, -0.328, 0.073, 0.842, -0.197, 0.453, -0.726, 0.288, 0.617, 0.039, -0.504, 0.871, -0.265, 0.392, 0.158, -0.673, 0.527, 0.084, -0.439, 0.916, -0.221, 0.358, 0.495, -0.782, 0.146, 0.629, -0.317, 0.058, 0.847, -0.473, 0.196, 0.534, -0.628, 0.279, 0.913, -0.045, 0.461, 0.184, -0.752, 0.398, 0.625, -0.171, 0.043, 0.789, -0.526, 0.314, 0.867, -0.082, 0.471, -0.638, 0.219, 0.582, -0.395, 0.146, 0.704, -0.273, 0.519, 0.038, -0.846, 0.187, 0.493, -0.561, 0.328, 0.075, -0.412, 0.901, -0.246]1Cache invalidation guide2How streaming wor