Ship AI features, not model integrations
Call any major model and answers stream to your users live. No wrapper to build. No token markup. No API key to manage.
Code example
// convex/ai.ts
import { action } from "./_generated/server";
import { convexGateway } from "@convex-dev/ai-sdk-provider";
import { generateText } from "ai";
export const ask = action(async (ctx) => {
const { text } = await generateText({
model: convexGateway("anthropic/claude-sonnet-5"),
prompt: "Why is the sky blue?",
});
return text;
});// convex/ai.ts
import { action } from "./_generated/server";
import { convexGateway } from "@convex-dev/ai-sdk-provider";
import { generateText } from "ai";
export const ask = action(async (ctx) => {
const { text } = await generateText({
model: convexGateway("anthropic/claude-sonnet-5"),
prompt: "Why is the sky blue?",
});
return text;
});Same call, any provider. Switch the model string, nothing else.
One key? Try no keys.
Convex holds provider credentials, so you don’t need to obtain, store, or rotate a key. Your action authenticates with a short-lived token scoped to your deployment.
- Convex just handles it
- Safe by default
- Ergonomics that keep you focused
Easy access to the endpoints is the point.
Text, image, audio, and embeddings. Do it all with the AI Gateway.


Let your users watch the agent work.
Point the Agent component at the AI Gateway and you’ve got memory, search, long-running workflows, and any model you want to call. Same functions, same data, same backend your app already runs on. Reactive by default. No glue.
Quote
“Convex AI Gateway lets me run Public Parish’s document extraction, independent review, and source-grounded Q&A from the backend I’m already using. That means more time spent helping Louisiana residents understand local decisions and less time managing a separate AI integration.”
Put more gas in the tank
Zero data retention:Enforced on every request across your team. Routes only to providers under a ZDR agreement.
Automatic fallback at the ready:When providers have outages, your app stays up. No paging, no code path to maintain.
Dead simple migration:Point your existing OpenAI or Anthropic SDK at the AI Gateway with a base-URL swap. Same requests, same responses, no rewrites.
No token markup
Pay provider prices, with simplified billing and no processing fees. Set spending limits by day, project, and model.
Your big idea, built faster
Convex Components are sandboxed, open-source building blocks for your app. Paired with AI Gateway, you and your agents can build even more complex functionality, even faster. All TypeScript, zero glue.

iMessage (Photon) A Convex component that integrates Photon’s iMessage/RCS/SMS platform into a Convex backend without requiring a long-lived process.

Firecrawl Search, scrape, map, and run durable crawls as Convex-native functions, backed by the Firecrawl v2 REST API.

Exa Bring live web intelligence to Convex for AI agents, RAG, and research features.

AgentMail A stateful email inbox for AI agents, with threads, messages, labels, and delivery status stored in Convex.
Get new models as they drop
We provide access to all the latest models from OpenAI, Anthropic, Google, xAI, DeepSeek, Meta, Mistral AI, Amazon, Perplexity, Moonshot AI, Qwen, Z.AI, TypeSafe AI, and more.
- x-ai/grok-4.7
- prism-ml/ternary-bonsai-2-27b
- z-ai/glm-5.3-flashx
- unbiased/pareto
- inference-net/schematron-v2-small
- sakana/fugu-ultra-v2
- sakana/fugu-max
- inclusionai/ling-3.0-flash-vl
- deepseek/deepseek-v4.1-flash
- inception/mercury-2.5
- openai/gpt-6-astra
- openai/gpt-6-astra-pro
- meta/muse-spark-1.3-contributor
- meta/muse-spark-1.3
- google/gemini-3.8-flash
- anthropic/claude-fable-5.1
FAQ
Any paying team has access to AI Gateway.
Tokens are offered at list price from the upstream providers, with no markup.
Call the gateway from a Convex action with the SDK you already use — OpenAI, the Vercel AI SDK, the Agent component, or plain fetch. No account to create, no key to store. Check out the Getting Started docs for more information.
AI Gateway is one simple integration that allows access to any model you might need, when you need it. Instead of managing multiple integrations, you can do it all in one place on Convex.
Yes, you can still choose to bring your own keys.
You can set spend limits at the team, project, and deployment level.
From one single endpoint, you can access text and embedding endpoints, with more on the way. Check out the docs for the most up-to-date capabilities.
Each token is scoped to the calling deployment and only works from inside a running Convex action. That removes long-lived provider keys from your app and lets Convex automatically attribute each request’s usage.
If your stack uses the Vercel AI SDK, the Convex Agent component, OpenAI Chat Completions, OpenAI Responses, or Anthropic Messages, it can likely use AI Gateway with a small configuration change. You can also call the HTTP API directly with
fetch. Check the Getting Started guide for supported integrations and examples.AI Gateway usage is tracked at the project, deployment, and function level in the Convex dashboard.
