Create an API Key

API requests are authenticated with a GetRouter API key. Create a separate key for each application or tool so you can track usage and revoke access independently.

Create a key

  1. Sign in to GetRouter.
  2. Open the API Keys page.
  3. Select Create API Key.
  4. Enter a name that identifies the application, such as Codex, OpenClaw, or Development.
  5. Optionally set an expiration time, usage limit, or model restrictions.
  6. Create the key and copy it to a secure location.

Example naming scheme:

Development
Production API
Codex Laptop
OpenClaw Agent

Authenticate a request

Send the key as a Bearer token:

curl https://getrouter.ai/v1/models \
  -H "Authorization: Bearer YOUR_API_KEY"

Do not include quotation marks around the actual key value in a tool's API key field unless the tool explicitly requires them.

Store keys safely

For local development, place the key in an environment variable:

export GETROUTER_API_KEY="YOUR_API_KEY"

Then reference the variable from your application:

import os

api_key = os.environ["GETROUTER_API_KEY"]
Danger

Never commit API keys to Git, expose them in browser-side code, or paste them into public issue reports. If a key is exposed, delete it immediately and create a replacement.

Use separate keys

Separate keys make it easier to:

  • Revoke one tool without interrupting other applications
  • Set different usage limits
  • Restrict a key to the models it needs
  • Identify unexpected usage

Next steps