Skip to content
Docs

vercel ai-gateway

The vercel ai-gateway command manages AI Gateway resources from the Vercel CLI, including API keys and routing rules.

terminal
vercel ai-gateway [subcommand]

Using the vercel ai-gateway command to manage AI Gateway resources for the current team.

Manage AI Gateway API keys for the current team.

terminal
vercel ai-gateway api-keys [subcommand]

Create a new AI Gateway API key. The CLI returns the plaintext key once; store it securely.

terminal
vercel ai-gateway api-keys create
Create an API key interactively, using the default settings.
terminal
vercel ai-gateway api-keys create --name my-key --budget 500 --refresh-period monthly

Create an API key with a human-readable name and a monthly $500 quota.

Options
OptionTypeDescription
--name <NAME>StringHuman-readable name for the API key
--budget <AMOUNT>NumberQuota budget amount in dollars (minimum 1)
--refresh-period <PERIOD>StringQuota refresh cadence: daily, weekly, monthly, or none (default none)

Manage AI Gateway routing rules for the current team. A rule rewrites a request from one model to another, or denies a model. See the routing rules documentation for concepts, request behavior, and propagation details.

AI Gateway routing rules are in beta and may change before general availability.

terminal
vercel ai-gateway rules [subcommand]

Add a routing rule. A rewrite rule requires --destination; a deny rule does not.

terminal
vercel ai-gateway rules add --type rewrite --source anthropic/claude-opus-4.7 --destination anthropic/claude-haiku-4.5
Route requests for one model to another.
terminal
vercel ai-gateway rules add --type deny --source openai/gpt-5.5
Block requests for a model.
Options
OptionTypeDescription
--type <TYPE>StringRule type: rewrite or deny (required)
--source <MODEL>StringModel the rule matches (required)
--destination <MODEL>StringTarget model a rewrite rule routes to
--reason <TEXT>StringReason surfaced when the rule applies
--description <TEXT>StringHuman-readable description of the rule

List routing rules for the current team. Alias: ls. Pass --include-disabled to also show disabled rules.

terminal
vercel ai-gateway rules list

Edit a rule by its ID. Change the destination, reason, or description, or toggle the rule with --enable / --disable.

terminal
vercel ai-gateway rules edit rule_123 --disable

Remove a rule by its ID. Aliases: rm, delete. Pass --yes to skip the confirmation prompt.

terminal
vercel ai-gateway rules remove rule_123 --yes
terminal
vercel ai-gateway api-keys create
Create an API key with the default settings.
terminal
vercel ai-gateway api-keys create --name my-key --budget 500 --refresh-period monthly

Create an API key named my-key with a $500 monthly quota that refreshes every month.

The following global options can be passed when using the vercel ai-gateway command:

For more information on global options and their usage, refer to the options section.

Last updated June 26, 2026

Was this helpful?

supported.