OpenRouter

{/* Generated by scripts/generate-integration-catalog.mjs. Do not edit by hand. */}

At a glance

Credentials

Set these per environment. See Connect an integration.

VariableRequiredDescription
OPENROUTER_API_KEYYesOpenRouter API key (starts with sk-or-) Docs.

Setup

  1. Create an OpenRouter account: Go to https://openrouter.ai and sign up or sign in. Some models offer free variants for testing; paid models require purchasing credits under Settings → Credits.
  2. Create an API key: Open https://openrouter.ai/settings/keys, click 'Create Key', and optionally set a credit limit for the key.
  3. Store the key: Copy the key and add it to your .env file as OPENROUTER_API_KEY=sk-or-...
  4. Verify access: Run the List Models tool to confirm the key works, then try a chat completion with a model like openai/gpt-4o-mini.

Provider notes

  • Model IDs are namespaced as vendor/model, e.g. anthropic/claude-sonnet-4
  • Chat completions consume prepaid credits; use the Get Generation tool to inspect the exact cost of a request
  • The Get Credits endpoint requires a management key per OpenRouter's docs - a regular inference key may be rejected there

Provider API reference.

Tools

ToolAccessDescription
List Models<br /><code className="reference-identifier">openrouter__list_models</code>ReadList models
Create Chat Completion<br /><code className="reference-identifier">openrouter__create_chat_completion</code>WriteGenerate chat completion
Get Generation<br /><code className="reference-identifier">openrouter__get_generation</code>ReadGet generation
Get Current Key<br /><code className="reference-identifier">openrouter__get_key</code>ReadGet current key
Get Credits<br /><code className="reference-identifier">openrouter__get_credits</code>ReadGet credits (requires management key)

Verify the connection

Call a read tool such as openrouter__list_models with arguments for your account. Confirm that the result comes from the intended account or workspace before enabling write tools.