vercel ai-gateway
The vercel ai-gateway command manages AI Gateway resources from the Vercel CLI, including API keys and routing rules.
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.
vercel ai-gateway api-keys [subcommand]Create a new AI Gateway API key. The CLI returns the plaintext key once; store it securely.
vercel ai-gateway api-keys createvercel ai-gateway api-keys create --name my-key --budget 500 --refresh-period monthlyCreate an API key with a human-readable name and a monthly $500 quota.
Options
| Option | Type | Description |
|---|---|---|
--name <NAME> | String | Human-readable name for the API key |
--budget <AMOUNT> | Number | Quota budget amount in dollars (minimum 1) |
--refresh-period <PERIOD> | String | Quota 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.
vercel ai-gateway rules [subcommand]Add a routing rule. A rewrite rule requires --destination; a deny rule does not.
vercel ai-gateway rules add --type rewrite --source anthropic/claude-opus-4.7 --destination anthropic/claude-haiku-4.5vercel ai-gateway rules add --type deny --source openai/gpt-5.5Options
| Option | Type | Description |
|---|---|---|
--type <TYPE> | String | Rule type: rewrite or deny (required) |
--source <MODEL> | String | Model the rule matches (required) |
--destination <MODEL> | String | Target model a rewrite rule routes to |
--reason <TEXT> | String | Reason surfaced when the rule applies |
--description <TEXT> | String | Human-readable description of the rule |
List routing rules for the current team. Alias: ls. Pass --include-disabled to also show disabled rules.
vercel ai-gateway rules listEdit a rule by its ID. Change the destination, reason, or description, or toggle the rule with --enable / --disable.
vercel ai-gateway rules edit rule_123 --disableRemove a rule by its ID. Aliases: rm, delete. Pass --yes to skip the confirmation prompt.
vercel ai-gateway rules remove rule_123 --yesvercel ai-gateway api-keys createvercel ai-gateway api-keys create --name my-key --budget 500 --refresh-period monthlyCreate 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:
--cwd--debug--global-config--help--local-config--no-color--non-interactive--scope--team--token--version
For more information on global options and their usage, refer to the options section.
Was this helpful?