Vercel AI Gateway MCP server for AI agents and assistants

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Vercel AI Gateway MCP or direct API to discover models, run inference, generate text and images, and retrieve usage metrics through natural language.

Vercel AI Gateway logoVercel AI Gateway
Api Key

Vercel AI Gateway is a unified AI model gateway offering model discovery, inference, generation, and usage APIs. It provides a single, consistent API surface to route and scale model workloads across providers.

22 Tools

Try Vercel AI Gateway now

Type what you want done — sign in and watch it run live in the Tool Router playground.

TOOL ROUTER PLAYGROUND
Vercel AI Gateway
Try asking
TOOLS

Supported Tools

Every Vercel AI Gateway action and event your agent gets out of the box.

Compact Response

Compact a long OpenAI Responses conversation into replayable context through Vercel AI Gateway.

Count Message Tokens

Estimate input tokens for Anthropic-format messages, system content, and tools before sending a model request through Vercel AI Gateway.

Create Anthropic Message

Create one non-streaming Anthropic Messages-compatible result through Vercel AI Gateway, with multimodal content, tools, extended thinking, and routing controls.

Create Chat Completion

Create one non-streaming OpenAI Chat Completions-compatible result through Vercel AI Gateway, with multimodal messages, tools, structured output, fallback models, and routing controls.

Create Embeddings

Generate OpenAI-compatible vector embeddings through Vercel AI Gateway for text or token inputs, with optional dimensions and routing controls.

Edit Images

Create edited images from up to 16 HTTPS or base64 data-URL source images and a text instruction.

Evaluate State

Evaluate one shared state against one or more typed choice, score, or boolean questions using an AI Gateway evaluation model.

Generate Images

Generate one or more images from a text prompt through an image-only Vercel AI Gateway model.

Generate Response

Generate one non-streaming OpenAI Responses-compatible result through AI Gateway, with optional instructions, tools, structured output, reasoning, and routing controls.

Generate Speech

Generate spoken audio from text through a Vercel AI Gateway speech model.

Get Credit Balance

Return the connected team's remaining AI Gateway credit balance and lifetime credit usage in USD.

Get Generation

Look up cost, token usage, provider routing, latency, and finish details for one completed Vercel AI Gateway generation.

Get Model

Return detailed capabilities, modalities, limits, tags, and pricing for one exact Gateway model ID.

Get Model Endpoints

Compare provider endpoints serving one Vercel AI Gateway model, including limits, pricing, caching, availability, throughput, and latency.

Get Spend Report

Query aggregated Vercel AI Gateway spend and token usage.

List Model Catalog

List AI Gateway model-to-provider routes and capability tags, with bounded local filtering by model text, provider, or tag.

List TypeSafe Models

List evaluation models available through AI Gateway's TypeSafe-compatible API, including each accepted model name, description, and release date.

Rerank Object Documents

Rank structured object documents by relevance through the Cohere v1 route, using selected rank fields and optionally returning each source document.

Rerank Text Documents

Rerank string documents through the current Cohere v2 compatibility endpoint.

Search Models

Search the AI Gateway model catalog by text, model type, and tags, returning capability and pricing metadata for matching models.

Transcribe Audio

Transcribe base64-encoded recorded audio through a Vercel AI Gateway transcription model.

Evaluate with TypeSafe API

Evaluate one shared state through AI Gateway's TypeSafe-compatible System One API.

SETUP GUIDE

Connect Vercel AI Gateway MCP Tool with your Agent

1

Install Composio

typescript
npm install @composio/core ai @ai-sdk/openai @ai-sdk/mcp
Install the Composio SDK for Python or TypeScript
2

Initialize Client and Create Tool Router Session

typescript
import { Composio } from '@composio/core';

const composio = new Composio({ apiKey: 'your-api-key' });
const session = await composio.create('your-user-id');
console.log(`Tool Router session created: ${session.mcp.url}`);
Import and initialize the Composio client, then create a Tool Router session for Vercel AI Gateway
3

Connect to AI Agent

typescript
import { openai } from '@ai-sdk/openai';
import { experimental_createMCPClient as createMCPClient } from '@ai-sdk/mcp';
import { generateText } from 'ai';

const client = await createMCPClient({
  transport: {
    type: 'http',
    url: session.mcp.url,
    headers: {
      'x-api-key': 'your-composio-api-key',
    },
  },
});

const tools = await client.tools();
const { text } = await generateText({
  model: openai('gpt-4o'),
  tools,
  messages: [{
    role: 'user',
    content: 'YOUR_SPECIFIC_PROMPT_HERE'
  }],
  maxSteps: 5,
});

console.log(`Agent: ${text}`);
Use the MCP server with your AI agent (Anthropic Claude or Mastra)
SETUP GUIDE

Connect Vercel AI Gateway API Tool with your Agent

1

Install Composio

typescript
npm install @composio/openai
Install the Composio SDK
2

Initialize Composio and Create Tool Router Session

typescript
import OpenAI from 'openai';
import { Composio } from '@composio/core';
import { OpenAIResponsesProvider } from '@composio/openai';

const composio = new Composio({
  provider: new OpenAIResponsesProvider(),
});
const openai = new OpenAI({});
const session = await composio.create('your-user-id');
Import and initialize Composio client, then create a Tool Router session
3

Execute Vercel AI Gateway Tools via Tool Router with Your Agent

typescript
const tools = session.tools;
const response = await openai.responses.create({
  model: 'gpt-4.1',
  tools: tools,
  input: [{
    role: 'user',
    content: 'YOUR_SPECIFIC_PROMPT_HERE'
  }],
});
const result = await composio.provider.handleToolCalls(
  'your-user-id',
  response.output
);
console.log(result);
Get tools from Tool Router session and execute Vercel AI Gateway actions with your Agent

Why Use Composio?

AI Native Vercel AI Gateway Integration

  • Supports both Vercel AI Gateway MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for reading, writing, and querying your Vercel AI Gateway data

Managed Auth

  • Built-in OAuth handling with automatic token refresh and rotation
  • Central place to manage, scope, and revoke Vercel AI Gateway access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Vercel AI Gateway
  • Scoped, least privilege access to Vercel AI Gateway resources
  • Full audit trail of agent actions to support review and compliance

Rolling this out across your team?

Give your team centralized access control across every framework with Composio’s MCP Gateway.

EXPLORE MCP GATEWAY
FAQ

Frequently asked questions

Yes, Vercel AI Gateway requires you to configure your own API key credentials. Once set up, Composio handles secure credential storage and API request handling for you.

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Yes. Composio is SOC 2 Type II compliant and is built to keep your Vercel AI Gateway connection and credentials secure. OAuth tokens and API keys are encrypted, and sensitive customer data is protected at rest and in transit.

Composio also undergoes independent security testing and continuously monitors its systems for security threats. You can review the latest reports and policies in the Composio Trust Center.

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Create the key in your Vercel AI Gateway account settings, then paste it once on Composio's connection page. Composio stores it encrypted and uses it only for the Vercel AI Gateway actions your agent runs. Nobody else in your workspace can read it, and you can revoke it inside Vercel AI Gateway at any time.

When you connect a Vercel AI Gateway account through Composio, every action runs under that account, so anything the agent creates, sends, or changes shows up in Vercel AI Gateway as done by you. Keep an approval step in your prompt for actions with side effects, such as sending or deleting, and have the agent draft first.

Whatever the credentials you connect allow inside Vercel AI Gateway. If Vercel AI Gateway lets you scope a key to specific permissions, create a scoped one so the agent can only do what you intend. You can revoke the key inside Vercel AI Gateway at any time.

Yes. Composio supports multiple connected accounts for the same app, and that works in Claude, ChatGPT, or any other assistant you connect through Composio. Give each Vercel AI Gateway connection a name such as work or personal, and the assistant uses the one you mention in the request. Each account keeps its own credentials and nothing is merged.

The connection stops working the moment Vercel AI Gateway rejects the old key. Create a new key in Vercel AI Gateway and reconnect the account from the Composio dashboard or by asking your agent to reconnect Vercel AI Gateway. Nothing else changes.

Composio's free plan includes 100,000 tool calls per month with no credit card, which covers most personal Vercel AI Gateway use. Paid plans add higher limits and team features. Your Vercel AI Gateway plan and its API limits still apply as usual.

Built-in connectors usually give one AI access to a limited set of apps. Many people use Composio because it lets their AI connect to more apps than it normally supports, or connect to multiple accounts for the same app (e.g. connect Claude to multiple Vercel AI Gateway accounts).

With Composio, you connect Vercel AI Gateway once and then use it across different AI assistants without setting it up separately in each one. Connect your apps to Composio once, then connect Composio to whichever AI you use, whether that's Claude, ChatGPT, Hermes, or your own custom assistant.

Start with Vercel AI Gateway.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Vercel AI Gateway tool your agent needs.Free to start.

Start building