---
title: OpenRouter
description: Sign in with OpenRouter to run the Railway Agent, cloud agents, dev.new, and the Slack and Discord bots on models from several vendors, paid from your OpenRouter credits.
---
Signing in with OpenRouter gives Railway access to models from several vendors through one account, including OpenAI, Anthropic, xAI, Z.ai, and Moonshot AI. OpenRouter bills the requests to your OpenRouter credits.

The connection is saved for the workspace you connect it in, so connect OpenRouter again in each workspace where you want to use it. For how models are chosen across Railway, see [Bring Your Own Models](/ai/bring-your-own-models).

## Connect OpenRouter

Railway connects to OpenRouter through a popup on openrouter.ai.

1. Navigate to <a href="https://railway.com/account/agents" target="_blank">Account Settings, then **Agents**</a>, with the workspace you want to connect selected.
2. Find the **OpenRouter** card in the **Providers** section.
3. Click **Connect**. OpenRouter opens in a popup.
4. Approve the connection in the popup.

Approving creates an API key labeled **Railway Agents** in your OpenRouter account. Railway stores it encrypted, and the strip at the bottom of the card shows the key's last four characters, and **Manage** opens your keys on openrouter.ai.

## Disconnect OpenRouter

Click **Disconnect** on the **OpenRouter** card. Disconnecting removes the key from this workspace only. The key stays active in your OpenRouter account until you delete it at <a href="https://openrouter.ai/settings/keys" target="_blank">openrouter.ai/settings/keys</a>.

## Troubleshooting

Most OpenRouter problems show up as a status line on the **OpenRouter** card.

<Collapse title="The OpenRouter popup didn't open">
Your browser blocked it. Allow popups for `railway.com` and click **Connect** again.
</Collapse>

<Collapse title="An OpenRouter model returns an error">
Check your OpenRouter credit balance and the key's spending limit at <a href="https://openrouter.ai/settings/keys" target="_blank">openrouter.ai/settings/keys</a>. If you deleted the **Railway Agents** key in OpenRouter, disconnect and connect again to create a new one.
</Collapse>

<Collapse title="My cloud agent doesn't list my OpenRouter GPT or Claude models">
The Railway Agent harness can't reach those models through OpenRouter. Use a linked [Anthropic Claude Platform](/ai/bring-your-own-models/claude-platform) organization or a Railway model for Claude, and [ChatGPT](/ai/bring-your-own-models/chatgpt) sign-in for GPT models.
</Collapse>