Vercel AI Gateway
AIReach hundreds of models across OpenAI, Anthropic, Google, Meta, and more through the Vercel AI Gateway's single OpenAI-compatible endpoint. Agents run chat completions with automatic provider failover, route by cost or latency, generate embeddings, and track exact per-request spend.
What This Integration Enables
Model choice stopped being an architecture decision and became an operations decision: the right model for a task changes monthly, and the teams that win are the ones that can switch without a rewrite. The Vercel AI Gateway makes that switch a string edit, one OpenAI-compatible endpoint and one key reaching hundreds of models across OpenAI, Anthropic, Google, Meta, and more. What the connector adds is the operational discipline around it: FlowRunner agents run completions with declared failover, compare providers on live uptime and latency data before pinning routes, and account for every request in dollars, not vibes. Spend is real money leaving a real balance, so the decisions that change it stay [human-in-the-loop](/concepts/human-in-the-loop). - Run chat completions and one-shot prompts against any cataloged model with automatic failover - Route by cost, latency, or throughput, or pin an explicit provider order per request - Generate embeddings for search and RAG from the same key used for chat - Track exact per-request cost and team-wide spend for dashboards, chargeback, and alerts
Without FlowRunner
With FlowRunner
Use Case Scenarios
A RAG pipeline on one key
Incoming documents flow through Create Embeddings and land in [Pinecone](/integrations/pinecone) as vectors. When a question arrives, the agent queries Pinecone for context and answers with Chat Completion, using structured outputs so the response parses reliably downstream. The whole pipeline runs on a single gateway key, and when a better embedding model ships, the swap is the model slug and a re-index, not a new integration.
A cost ledger that names the spender
Every Chat Completion returns a generation id. The agent feeds each one to Get Generation and appends the exact USD cost, serving provider, and token counts to a ledger in [Google Sheets](/integrations/google-sheets). Weekly, Get Spend Report aggregates by model, user, and tag, and the breakdown posts to [Slack](/integrations/slack) so each team sees what its flows actually spent. When finance asks which workflow drove last month's AI bill, the answer is a filter, not an investigation.
Repinning a production model with evidence
A cheaper model looks tempting. The agent pulls candidates with List Models filtered by capability tags, then calls Get Model Endpoints for each to compare per-endpoint pricing, uptime over the last day, and p95 time-to-first-token across providers. It runs the team's evaluation prompts through Ask Model on the candidate, attaches the pilot's Get Generation costs, and presents the comparison. A person approves the repin, and because models are slugs, the rollout is one field in one flow, with the old slug sitting first in the fallback list until confidence is earned.
Human-in-Loop Highlight
Chat Completion is a spending operation against a finite prepaid balance, and Get Credits exists because that balance can hit zero mid-batch. The sharper risk is how cheap the mistake looks: models are addressed by slug, so pointing a high-volume flow at a frontier model instead of its mini sibling is a one-field edit that multiplies unit cost silently, and Get Generation will dutifully report the damage after the money is gone. So model changes on production flows never self-approve. The agent presents the endpoint comparison, the pilot cost per request, and the projected monthly delta at current volume, and a person signs off before the slug changes. The same gate holds when Get Credits crosses the low-balance threshold: topping up the team's balance is a purchasing decision, not a retry policy.
Agent Capabilities
8 actionsChat
2- Chat Completion Full-control chat against any cataloged model through one OpenAI-compatible endpoint: multi-turn and multimodal messages, tool definitions, structured outputs, and all sampling parameters. Gateway extensions add ordered fallback models, provider ordering and allow-listing, sorting by cost, latency, or throughput, automatic prompt caching, and a raw provider options object for BYOK credentials and per-provider timeouts. Returns the OpenAI-shaped response with the model that actually served the request, token usage, and the generation id.
- Ask Model One-shot convenience wrapper: a prompt in, the assistant's plain-text answer out, with optional system prompt, fallback models, and JSON mode. The right call for classification and extraction steps that do not need the full request surface.
Embeddings
1- Create Embeddings Generates vectors for one or more texts using any embedding model in the catalog, addressed by slug. One vector per input plus token usage, ready for semantic search, clustering, dedup, and RAG.
Models
2- List Models Lists the full gateway catalog with each model's slug, provider, context window, output limits, type, capability tags, and per-token pricing. The discovery step before pinning anything.
- Get Model Endpoints Retrieves every provider endpoint serving a model with per-endpoint pricing, context length, uptime over the last 15 minutes, hour, and day, and median and p95 throughput and time-to-first-token. The evidence behind routing decisions.
Insights
1- Get Generation Retrieves a past generation's exact total cost in USD, serving provider, BYOK flag, finish reason, timing, and full token breakdown by its id. The primitive that turns AI spend into an auditable ledger.
Account
2- Get Credits Returns the team's remaining credit balance and lifetime spend in USD. Scheduled checks here are what keep flows from failing on an exhausted balance.
- Get Spend Report Aggregates spend and usage over a UTC date range, grouped by day, hour, user, model, tag, provider, credential type, or API key, with filters to narrow scope. Built for cost dashboards and chargeback. Requires a paid Vercel plan.
Frequently Asked Questions
What can FlowRunner do with Vercel AI Gateway?
FlowRunner agents can run Chat Completion, Ask Model, and Create Embeddings in Vercel AI Gateway, plus 5 more actions.
Does connecting Vercel AI Gateway to FlowRunner require OAuth?
No. Vercel AI Gateway connects to FlowRunner with an API key, no OAuth flow required.
Can Vercel AI Gateway trigger a FlowRunner workflow automatically?
Vercel AI Gateway doesn't currently expose triggers in FlowRunner. It connects as an action step inside workflows started by another trigger.
Start building with Vercel AI Gateway
$100 in credits. No card required. Connect in minutes.