Skip to main content
This guide shows you how to configure OpenRouter as an external model provider in AI Studio. After setting up this provider, you can use models from OpenRouter’s unified catalog when building agents.

Prerequisites

Before adding OpenRouter models to AI Studio, you need:
AI Studio supports text generation and embedding models from OpenRouter. Video, audio, and image generation models are not supported.

Get an OpenRouter API key

OpenRouter authenticates requests with a single API key that works across its model catalog. Create one from your OpenRouter account.
  1. Sign up or log in at OpenRouter
  2. Navigate to the API Keys page
  3. Select Create Key
  4. Enter a name for the key (for example, AI Studio integration)
  5. Copy the key, which starts with sk-or-...
For more details, see the OpenRouter quickstart.
Store your API key securely. If a key is compromised, revoke it from the API Keys page and create a new one.

Add OpenRouter models in AI Studio

After creating your API key, add OpenRouter models to AI Studio.
  1. Navigate to Models & Guardrails > Models in AI Studio
  2. Select + Add model
  3. Select OpenRouter as the provider
  4. Select the model you want to add from the Model name dropdown
  5. Enter a Display name for the model
  6. Provide your credentials using one of the following options:
    • Select an existing credential set from the Credentials name dropdown
    • Enter a new Credential name and your OpenRouter API key to save credentials for reuse
  7. Configure team access:
    • All teams: Anyone with builder access can use the model
    • Specific teams: Restrict to selected teams
  8. Select Save

Monitor costs

OpenRouter bills usage directly to your OpenRouter account based on the tokens processed by each model. WRITER also charges a 10% pass-through fee on external model usage, paid via credits. AI Studio tracks usage and costs for external models, providing visibility into spending across all your models in one place.

Troubleshoot OpenRouter configuration

Invalid API key error

If you see an “Invalid API key” or “Authentication failed” error:
  • Verify the API key is copied correctly without extra spaces
  • Confirm the key starts with sk-or-...
  • Check that the key is still active on the API Keys page
  • Ensure your OpenRouter account has sufficient credits

Model not available error

If a model doesn’t appear or returns an error:
  • Confirm the model is available in the OpenRouter model catalog
  • Verify your OpenRouter account has access to the model
  • Check that your account has credits to run the model

Next steps