Skip to content

How to get an OpenRouter API key

Sign in at openrouter.ai, buy credits on the Credits page, then create a key on the API keys page with a credit limit. In WLN, paste it in Settings › Models and API key › OpenRouter key and press Save.

Updated

One OpenRouter key reaches models from many companies, which makes it the easiest key to start WLN with. All of WLN’s team presets run on it.

What OpenRouter is

OpenRouter sits between you and the AI companies. You send a request to OpenRouter with one key, name the model you want, and OpenRouter passes it to a company that runs that model. Its docs say it gives you hundreds of models through a single API and handles fallbacks for you (OpenRouter quickstart, checked 5 Dec 2026).

What that means in practice:

  • One balance for every model. You don’t need an account with each AI company.
  • Prices per model. Each model has its own price per million tokens, and a few have free versions.
  • A fee on top-ups. OpenRouter charges a fee when you buy credits, not on each request (see below).

The trade-off is one more company in the middle. WLN’s consent sheet says so plainly: “OpenRouter passes each request on to the company that runs the model you picked.” If you’d rather deal with one company directly, use an Anthropic or OpenAI key instead, or as well.

Before you start

  • You pay with credits. OpenRouter calls credits deposits you use for AI requests. On the standard pay-as-you-go plan, card purchases carry a 5.5% fee with a $0.80 minimum. OpenRouter also says it may expire unused credits one year after purchase (OpenRouter FAQ, checked 5 Dec 2026).
  • A balance below zero blocks everything. OpenRouter says a negative balance can cause errors even on free models, until you add credits (OpenRouter docs, checked 5 Dec 2026).

Step 1: Sign in and buy credits

Go to openrouter.ai and sign in, or create an account. Then open the Credits page and add credit.

Step 2: Create the key with a credit limit

Open the API keys page. In WLN, the Get a key link under the OpenRouter key field opens the same page. Create a key, give it a name such as “WLN on my MacBook”, and choose a credit limit.

OpenRouter recommends a credit limit on every key. When a key reaches it, OpenRouter turns its requests down until you raise the limit on that key’s page (OpenRouter docs, checked 5 Dec 2026). We’d set one even if it’s generous. It’s the cheapest insurance you can buy against a leaked key.

Copy the key and keep it somewhere safe. It starts with sk-or-, the hint WLN shows in its OpenRouter field.

Step 3: Put the key in WLN

  1. In WLN, open Settings › Models and API key. The OpenRouter key section is at the top.
  2. Paste the key and press Save. WLN keeps it in Keychain on your Mac and checks it with OpenRouter. You’ll see “Checking your key with OpenRouter…” for a moment.
  3. WLN asks “Send your chats to OpenRouter?”. Press Allow. No chat goes to OpenRouter until you do.
  4. When the line turns green and says “Saved. Live chat is ready.”, you’re set.
The OpenRouter key section in WLN with the status Saved. Live chat is ready, a Remove button and a Get a key link. The key is blurred.
A saved OpenRouter key. We blurred the key in this screenshot.

Unlike the Anthropic, OpenAI and SubQ sections, the OpenRouter section has no Test button. WLN checks the key when you press Save by loading your OpenRouter balance, and tries again when you open these settings if that didn’t work.

Choose your models

There’s no model menu in the chat. Every reply comes from WLN’s team, a Planner, a Builder and an optional Reviewer, and their models are set in Settings › Models and API key › Team. With an OpenRouter key, the presets work:

PresetPlannerBuilderReviewer
Balanced ★Claude Sonnet 5.5DeepSeek V4.1 FlashGLM 5.3
CheapestGLM 5.3GLM 5.3 FlashDeepSeek V4.1 Flash
StrongestClaude Opus 5.5DeepSeek V4.1 FlashClaude Sonnet 5.5

All of these run through OpenRouter. Custom lets you pick any model per role, with each model’s price per million tokens next to it.

Add any OpenRouter model by its ID

Below the Team section, Models · OpenRouter lists the models most used on OpenRouter this month, with their prices. To use a model that isn’t on the list, type its OpenRouter ID into the Add a model field, such as minimax/minimax-m3, and press Add. WLN checks it with OpenRouter first. If it works, you’ll see “Added … after live OpenRouter validation.” and the model shows up in the Team section’s model menus with a Custom badge in the list.

A model that can’t use tools can’t join the team. WLN greys it out and says why.

See your balance in WLN

Open Settings › Usage and billing. The OpenRouter balance section shows what OpenRouter shares about your key:

  • Credits left, and how much you’ve bought in total
  • This key, this month and today
  • This key, all time
  • Key spending limit, with how much of it is left

Press Refresh to ask OpenRouter again. Below that, WLN chats shows what your chats cost this month and in total, and which chats cost the most. WLN’s own $5 limit per new chat works on top of the key’s credit limit. More in Get started with WLN.

Using the key in your own scripts

OpenRouter’s docs use an environment variable called OPENROUTER_API_KEY in their examples and strongly recommend keeping keys out of your code (OpenRouter docs, checked 5 Dec 2026). On a Mac, open your shell settings in Terminal:

touch ~/.zshrc && open -e ~/.zshrc

Add this line with your key in place of the placeholder, save, and open a new Terminal window:

export OPENROUTER_API_KEY='paste-your-key-here'

Pasting the key into the file, not into a Terminal command, keeps it out of your shell history.

That stores the key as plain text in ~/.zshrc. WLN doesn’t read this variable; it uses the copy in Keychain. Give your scripts their own key with their own credit limit.

Keep the key safe

  • Never paste it into a chat, an email or a code repository.
  • Use one key per app or per Mac, each with its own credit limit.
  • If a key leaks, delete it on the key settings page and make a new one.

OpenRouter is a GitHub secret scanning partner. If it finds that a key was exposed, it emails you (OpenRouter docs, checked 5 Dec 2026).

When something goes wrong

For OpenRouter, WLN shows a short title on the error card and then OpenRouter’s own words, after “OpenRouter error: OpenRouter HTTP” and the status number.

WLN showsWhat it meansWhat to do
Check your OpenRouter keyOpenRouter didn’t accept the key (HTTP 401 or 403).Copy the key again, or make a new one and save it in Settings.
Not enough OpenRouter creditThe balance can’t cover the request, or it’s below zero (HTTP 402).Add credits on the Credits page. If the key has a credit limit, check that too.
Too many requests right nowA rate limit (HTTP 429). On :free models, often the daily limit.Wait, or buy at least 10 credits to raise the free-model daily limit.
The AI provider had a problemSomething failed at OpenRouter or at the company running the model (HTTP 5xx).Press Try again, or pick another model for that role.
The AI provider stopped this reply with an error before it finished. It’s usually a passing problem, so press Try again.The model’s company ended the reply early.Press Try again.
This chat is too long for “model name”…The chat no longer fits in the model’s context window.Start a new chat, shorten a long paste, or pick a model with a bigger window.
Could not load your OpenRouter balance: …Shown in Settings when the key check fails.Read OpenRouter’s words after the colon. Usually the key is wrong or was deleted.
Custom model rejected: …The model ID was wrong, or the model can’t chat.Use the form provider/model, as shown on the model’s OpenRouter page.

Questions

What is OpenRouter?

A service that gives you hundreds of AI models from many companies through one API and one key (OpenRouter, checked 5 Dec 2026). You buy credits once, and each request is paid from them at that model’s listed price.

Does OpenRouter charge a fee?

Yes, on credit purchases. OpenRouter’s FAQ lists 5.5% (at least $0.80) for card payments on its standard pay-as-you-go plan, so $10 of credit costs $10.80 (checked 5 Dec 2026).

Can I use free models with an OpenRouter key?

Yes. Models whose ID ends in :free cost nothing but have limits: 50 requests a day until you’ve bought at least 10 credits, then 1,000 a day, and 20 a minute either way (checked 5 Dec 2026).

Do I need an OpenRouter key for WLN?

Not for chat: any one key from OpenRouter, Anthropic, OpenAI or SubQ is enough. But WLN’s Balanced, Cheapest and Strongest presets all use OpenRouter models, so without an OpenRouter key you choose Custom.

Where does WLN keep my OpenRouter key?

In Keychain on your Mac. WLN sends it only to OpenRouter.

OpenRouter, Anthropic, Claude, OpenAI, SubQ, DeepSeek, GLM, MiniMax, GitHub and LiteLLM are trademarks of their owners. WLN is an independent app and isn’t affiliated with or endorsed by them.