Skip to content

feat(cli): allow creating ai gateway api keys#15744

Merged
mclenhard merged 7 commits into
mainfrom
ai-gateway-api-key-creation
Apr 14, 2026
Merged

feat(cli): allow creating ai gateway api keys#15744
mclenhard merged 7 commits into
mainfrom
ai-gateway-api-key-creation

Conversation

@markandrus

@markandrus markandrus commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Adds the ability for users or agents to programmatically create new api keys for ai gateway through the vercel cli. Also allows for setting budgets and refresh periods on the keys

@markandrus markandrus requested review from mclenhard and shaper March 27, 2026 23:04
@changeset-bot

changeset-bot Bot commented Mar 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e0acec2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vercel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

📦 CLI Tarball Ready

The Vercel CLI tarball for this PR is now available!

Quick Test

You can test this PR's CLI directly by running:

npx https://vercel-aflbejn7d.vercel.sh/tarballs/vercel.tgz --help

Use in vercel.json

To use this CLI version in your project builds, add to your vercel.json:

{
  "build": {
    "env": {
      "VERCEL_CLI_VERSION": "vercel@https://vercel-aflbejn7d.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

Python Runtime Wheel

A vercel-runtime wheel was also built for this PR.
To use in your Python project builds, also set this environment variable:

VERCEL_RUNTIME_PYTHON="vercel-runtime @ https://vercel-aflbejn7d.vercel.sh/tarballs/vercel_runtime-0.13.0.dev1776124125+e0acec2-py3-none-any.whl"

Python Workers Wheel

A vercel-workers wheel was also built for this PR.
To use in your Python project builds, also set this environment variable:

VERCEL_WORKERS_PYTHON="vercel-workers @ https://vercel-aflbejn7d.vercel.sh/tarballs/vercel_workers-0.1.0.dev1776124125+e0acec2-py3-none-any.whl"

@github-actions

github-actions Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

🧪 Unit Test Strategy

Comparing: da0959de0acec2 (view diff)

Strategy: Affected packages only

✅ Only testing packages that have been modified or depend on modified packages.

Affected packages - 1 (3%)
  1. vercel
Unaffected packages - 39 (98%)
  1. @vercel-internals/get-package-json
  2. @vercel/backends
  3. @vercel/build-utils
  4. @vercel/cervel
  5. @vercel/cli-auth
  6. @vercel/client
  7. @vercel/config
  8. @vercel/detect-agent
  9. @vercel/edge
  10. @vercel/elysia
  11. @vercel/error-utils
  12. @vercel/express
  13. @vercel/fastify
  14. @vercel/firewall
  15. @vercel/frameworks
  16. @vercel/fs-detectors
  17. @vercel/functions
  18. @vercel/gatsby-plugin-vercel-builder
  19. @vercel/go
  20. @vercel/h3
  21. @vercel/hono
  22. @vercel/hydrogen
  23. @vercel/koa
  24. @vercel/nestjs
  25. @vercel/next
  26. @vercel/node
  27. @vercel/oidc
  28. @vercel/oidc-aws-credentials-provider
  29. @vercel/python
  30. @vercel/python-analysis
  31. @vercel/redwood
  32. @vercel/related-projects
  33. @vercel/remix-builder
  34. @vercel/routing-utils
  35. @vercel/ruby
  36. @vercel/rust
  37. @vercel/static-build
  38. @vercel/static-config
  39. examples

Results

  • Unit tests: Only affected packages will run unit tests
  • E2E tests: Running in parallel via E2E Tests workflow
  • Type checks: Only affected packages will run type checks

This comment is automatically generated based on the affected testing strategy

@vercel

vercel Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Low Risk — New CLI command feature with input validation, telemetry, and tests.

  • commands/ai-gateway/: new CLI command for creating AI Gateway API keys
  • util/ai-gateway/create-api-key.ts: API client for POST /v1/api-keys
  • test/unit/commands/ai-gateway/: unit tests for command validation and success paths

Assessed at 651749c.

@vercel

vercel Bot commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
00-list-directory Error Error Mar 28, 2026 3:24am
01-node Error Error Mar 28, 2026 3:24am
04-create-react-app Error Error Mar 28, 2026 3:24am
07-hexo-node Error Error Mar 28, 2026 3:24am
10-nextjs-node Error Error Mar 28, 2026 3:24am
10a-nextjs-routes Building Building Preview Mar 28, 2026 3:24am
28-vercel-json-and-ignore Error Error Mar 28, 2026 3:24am
30-next-image-optimization Error Error Mar 28, 2026 3:24am
41-tsconfig-jsx Error Error Mar 28, 2026 3:24am
42-dynamic-esm-ext Error Error Mar 28, 2026 3:24am
43-compress-encoding Error Error Mar 28, 2026 3:24am
edge-function Error Error Mar 28, 2026 3:24am
force-module-commonjs Error Error Mar 28, 2026 3:24am
go-external-module Building Building Preview Mar 28, 2026 3:24am
go-work-with-shared Error Error Mar 28, 2026 3:24am
handle-filesystem-missing Error Error Mar 28, 2026 3:24am
index-html-priority Error Error Mar 28, 2026 3:24am
middleware-500-response Error Error Mar 28, 2026 3:24am
middleware-error-in-handler Error Error Mar 28, 2026 3:24am
middleware-matchers Error Error Mar 28, 2026 3:24am
middleware-no-response Error Error Mar 28, 2026 3:24am
middleware-redirect Building Building Preview Mar 28, 2026 3:24am
middleware-response Error Error Mar 28, 2026 3:24am
middleware-rewrite-query Error Error Mar 28, 2026 3:24am
nested-tsconfig Error Error Mar 28, 2026 3:24am
no-api Building Building Preview Mar 28, 2026 3:24am
python-fastapi Error Error Mar 28, 2026 3:24am
test-clean-urls Error Error Mar 28, 2026 3:24am
test-clean-urls-custom-404 Error Error Mar 28, 2026 3:24am
test-clean-urls-trailing-slash Error Error Mar 28, 2026 3:24am
test-clean-urls-with-output-directory Ready Ready Preview Mar 28, 2026 3:24am
test-cors-routes Error Error Mar 28, 2026 3:24am
test-external-rewrites-and-redirects Error Error Mar 28, 2026 3:24am
test-rewrites Error Error Mar 28, 2026 3:24am
test-rewrites-with-segments Error Error Mar 28, 2026 3:24am
test-routing-case-sensitive Error Error Mar 28, 2026 3:24am
test-trailing-slash Building Building Preview Mar 28, 2026 3:24am
test-trailing-slash-custom-404 Error Error Mar 28, 2026 3:24am
test-trailing-slash-false Error Error Mar 28, 2026 3:24am

Request Review

@mclenhard mclenhard marked this pull request as ready for review April 8, 2026 21:29
@mclenhard mclenhard requested review from a team as code owners April 8, 2026 21:29

@brookemosby brookemosby left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mclenhard mclenhard merged commit 294990f into main Apr 14, 2026
178 checks passed
@mclenhard mclenhard deleted the ai-gateway-api-key-creation branch April 14, 2026 02:06
healeycodes pushed a commit that referenced this pull request Apr 14, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @vercel/build-utils@13.15.0

### Minor Changes

- [services] allow multiple v2beta triggers for a single Lambda when
config is coming from services
([#15890](#15890))

### Patch Changes

- Add deserialization utilities
([#15927](#15927))

## @vercel/fs-detectors@5.16.0

### Minor Changes

- Parse python module:variable entrypoint notation in
experimentalServices for all service types.
([#15844](#15844))

### Patch Changes

- Updated dependencies
\[[`4e62f6c2204dd148643f86f140f0ae7995778017`](4e62f6c),
[`42a70e1e6318615bd420933f9cc978bed3a43936`](42a70e1)]:
    -   @vercel/build-utils@13.15.0

## @vercel/python@6.31.0

### Minor Changes

- Parse python module:variable entrypoint notation in
experimentalServices for all service types.
([#15844](#15844))

### Patch Changes

- [python] set the `UV_PROJECT_ENVIRONMENT` and `UV_NO_DEV` env vars so
that custom `installCommand` and `buildCommand` commands can be called
without the `--active` and `--no-dev` flags
([#15715](#15715))

## @vercel/backends@0.0.60

### Patch Changes

- Include the entrypoint path in the build complete log message.
([#15914](#15914))

- Updated dependencies
\[[`4e62f6c2204dd148643f86f140f0ae7995778017`](4e62f6c),
[`42a70e1e6318615bd420933f9cc978bed3a43936`](42a70e1)]:
    -   @vercel/build-utils@13.15.0

## @vercel/cervel@0.0.47

### Patch Changes

- Updated dependencies
\[[`8b77cdcd71ba645df4eed52cdccde9a2cbb913f8`](8b77cdc)]:
    -   @vercel/backends@0.0.60

## vercel@51.2.1

### Patch Changes

- Add `ai-gateway api-keys create` command for creating AI Gateway API
keys with optional quota limits
([#15744](#15744))

- Improve `vercel blob list-stores` with `--json` and `--no-projects`,
exclude non-blob stores when the API returns a `type` field, and show a
richer table for non-TTY output while keeping linked-project filtering,
`--all`, and interactive store selection on TTY.
([#14653](#14653))

- Add a `project rename` command to rename projects from the CLI.
([#15918](#15918))

- Updated dependencies
\[[`8b77cdcd71ba645df4eed52cdccde9a2cbb913f8`](8b77cdc),
[`2d7d14db1c6448f716d1ccc30844b43f47e8e6ee`](2d7d14d),
[`d731f1b69030ddcaa0b7f4f1854f79ea92671b1e`](d731f1b),
[`4e62f6c2204dd148643f86f140f0ae7995778017`](4e62f6c),
[`45c8d4f54cc831695375794964a29145860fa45b`](45c8d4f),
[`42a70e1e6318615bd420933f9cc978bed3a43936`](42a70e1)]:
    -   @vercel/backends@0.0.60
    -   @vercel/python@6.31.0
    -   @vercel/next@4.16.7
    -   @vercel/build-utils@13.15.0
    -   @vercel/elysia@0.1.63
    -   @vercel/express@0.1.73
    -   @vercel/fastify@0.1.66
    -   @vercel/go@3.5.0
    -   @vercel/h3@0.1.72
    -   @vercel/hono@0.2.66
    -   @vercel/hydrogen@1.3.6
    -   @vercel/koa@0.1.46
    -   @vercel/nestjs@0.2.67
    -   @vercel/node@5.7.5
    -   @vercel/redwood@2.4.12
    -   @vercel/remix-builder@5.7.2
    -   @vercel/ruby@2.3.2
    -   @vercel/rust@1.1.0
    -   @vercel/static-build@2.9.13

## @vercel/client@17.3.2

### Patch Changes

- Updated dependencies
\[[`4e62f6c2204dd148643f86f140f0ae7995778017`](4e62f6c),
[`42a70e1e6318615bd420933f9cc978bed3a43936`](42a70e1)]:
    -   @vercel/build-utils@13.15.0

## @vercel/elysia@0.1.63

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/node@5.7.5

## @vercel/express@0.1.73

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/cervel@0.0.47
    -   @vercel/node@5.7.5

## @vercel/fastify@0.1.66

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/node@5.7.5

## @vercel/gatsby-plugin-vercel-builder@2.1.13

### Patch Changes

- Updated dependencies
\[[`4e62f6c2204dd148643f86f140f0ae7995778017`](4e62f6c),
[`42a70e1e6318615bd420933f9cc978bed3a43936`](42a70e1)]:
    -   @vercel/build-utils@13.15.0

## @vercel/h3@0.1.72

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/node@5.7.5

## @vercel/hono@0.2.66

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/node@5.7.5

## @vercel/koa@0.1.46

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/node@5.7.5

## @vercel/nestjs@0.2.67

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/node@5.7.5

## @vercel/next@4.16.7

### Patch Changes

- Update to latest Next.js adapter
([#15456](#15456))

## @vercel/node@5.7.5

### Patch Changes

- Updated dependencies
\[[`4e62f6c2204dd148643f86f140f0ae7995778017`](4e62f6c),
[`42a70e1e6318615bd420933f9cc978bed3a43936`](42a70e1)]:
    -   @vercel/build-utils@13.15.0

## @vercel/static-build@2.9.13

### Patch Changes

-   Updated dependencies \[]:
    -   @vercel/gatsby-plugin-vercel-builder@2.1.13

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants