RealtimeKeep your app up to date
AuthenticationOver 80+ OAuth integrations
AI GatewayCall any major model from one API
Convex Components
ComponentsIndependent, modular, TypeScript building blocks for your backend
AI CodingGenerate high quality Convex code with AI
Open sourceSelf host and develop locally
Compare
Convex vs. Firebase
Convex vs. Supabase
Convex vs. SQL
DocumentationGet started with your favorite frameworks
SearchSearch across Docs, Stack, and Discord
TemplatesUse a recipe to get started quickly
Convex ChampionsAmbassadors that support our thriving community
Convex for StartupsStart and scale your company with Convex
Convex for Open SourceSupport for open source projects
Convex CommunityShare ideas and ask for help in our community Discord
Stack
Stack

Stack is the Convex developer portal and blog, sharing bright ideas and techniques for building with Convex.

Explore Stack
BlogChangelogDocsPricing
npm1M weekly
GitHub21,361 stars
Log inStart building
AI Gateway

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.

Get startedRead the docs

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.

See what we support
One connection. Every endpoint.
Your app connects once to the AI Gateway, which branches to text, image, audio, and embeddings endpoints.Your app connects once to the AI Gateway, which branches to text, image, audio, and embeddings endpoints.
Live agent panel showing sources found, results compared, and a response in progressLive agent panel showing sources found, results compared, and a response in progress

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.

Check out the Agent Component

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.”
Layken VarholdtofPublic ParishPublic Parish

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.

1

Unified bill

0

Upcharges

1 unified bill, 0 upcharges.

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.

Browse the component library

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
    21 SEPT 2026(September 21, 2026)
  • prism-ml/ternary-bonsai-2-27b
    18 SEPT 2026(September 18, 2026)
  • z-ai/glm-5.3-flashx
    18 SEPT 2026(September 18, 2026)
  • unbiased/pareto
    17 SEPT 2026(September 17, 2026)
  • inference-net/schematron-v2-small
    12 SEPT 2026(September 12, 2026)
  • sakana/fugu-ultra-v2
    11 SEPT 2026(September 11, 2026)
  • sakana/fugu-max
    11 SEPT 2026(September 11, 2026)
  • inclusionai/ling-3.0-flash-vl
    10 SEPT 2026(September 10, 2026)
  • deepseek/deepseek-v4.1-flash
    10 SEPT 2026(September 10, 2026)
  • inception/mercury-2.5
    8 SEPT 2026(September 8, 2026)
  • openai/gpt-6-astra
    4 SEPT 2026(September 4, 2026)
  • openai/gpt-6-astra-pro
    4 SEPT 2026(September 4, 2026)
  • meta/muse-spark-1.3-contributor
    2 SEPT 2026(September 2, 2026)
  • meta/muse-spark-1.3
    2 SEPT 2026(September 2, 2026)
  • google/gemini-3.8-flash
    2 SEPT 2026(September 2, 2026)
  • anthropic/claude-fable-5.1
    1 SEPT 2026(September 1, 2026)
Browse all models

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.

All models, no breakages.

Get an API key and make your first gateway call in minutes.

Make your agent a Convex expertWorks great with any model, any agent, any editor
Start a new Convex project
Build anything with Convex

Make your agent a Convex expert:

Get Convex-ready by following https://www.convex.dev/agent-setup.md

Works great with any model, any agent, any editor

Start a new Convex project: npm create convex@latest

Read the docsStart building
Convex logo
ProductSyncRealtimeAuthOpen sourceAI codingAI GatewayFAQMerchEnterprisePricing
DevelopersDocsBlogComponentsTemplatesConvex for StartupsConvex for Open SourceChampionsPodcastsLLMs.txt
CompanyAbout usBrandInvestorsBecome a partnerJobsNewsEventsSecurityLegal
SocialX (Twitter)DiscordYouTubeLumaLinkedInGitHub
A Trusted Solution
  • SOC 2 Type II Compliant
  • HIPAA Compliant
  • GDPR Verified
©2026 Convex, Inc.