# How to use OpenRouter: one API key for hundreds of AI models

> OpenRouter is a gateway that gives you one API and one account for hundreds of AI models from many makers. You send a request in the OpenAI format, name the model you want, and OpenRouter passes it to a provider that serves that model. It can fall back to another provider if one fails, and it has free models with limits.

Mindket editors · Published 2026-11-06 · Updated 2026-11-06 · https://mindket.com/learn/tools/openrouter

## In short

- One OpenRouter key reaches hundreds of models, and you switch models by changing one name in the request.
- It accepts the OpenAI request format, so the OpenAI SDK works once you change the base URL and the key.
- Free models need no credits but have per-minute and per-day caps, and a fallback to a paid model is billed.
- Set a credit limit on every key, and keep the key out of code you share.
- Your prompts go to a provider with its own data policy, so check it before you send private text.

## What OpenRouter is

OpenRouter is a gateway for AI models, not a model. Instead of opening an account with OpenAI, another with Anthropic and a third with Google, you open one OpenRouter account, add credits and call any of their models through one address. Its GitHub page calls it the unified interface for LLMs, with more than 400 models and automatic fallbacks across more than 90 providers.

The request looks like an OpenAI request. OpenRouter's documentation says its schema is close to OpenAI's and that it supports both the Responses API and Chat Completions, so the OpenAI SDK works if you change the base URL and the key. Wikipedia says the company was founded in 2023 in New York City.

## What OpenRouter is good for

- **Trying many models with one key**: change the model name in the request and the same code talks to a different model.
- **Learning on free models**: `:free` model versions and the `openrouter/free` router cost no credits, within daily caps.
- **Fallbacks**: if a provider is down or rate-limited, OpenRouter tries the next provider, and a `models` list lets you name backup models.
- **Comparing providers**: each model page shows latency and throughput for every provider that serves it, and the `:nitro` and `:floor` suffixes sort by speed or by price.
- **More than text**: the models list can be filtered for image, video, speech, transcription and embedding models.
- **Coding tools**: OpenRouter's docs have guides for using it with Claude Code, Codex CLI and Cursor.

## When to use OpenRouter, and when to pick another tool

| Your job | Use OpenRouter? | Or try |
| --- | --- | --- |
| Compare several models from one account and one key | Yes. This is its main job | Each maker's own API, as in the [OpenAI API quickstart](https://mindket.com/learn/openai-api/openai-api-quickstart) |
| Call a model through the OpenAI SDK with a different base URL | Yes, as its documentation describes | The maker's own endpoint |
| A feature that only one maker's API offers | Check the model page first, since support varies by model and provider | The maker's own API |
| Keep prompts on your own computer | No. Requests go to a hosted provider | [Ollama](https://mindket.com/learn/tools/ollama) or [LM Studio](https://mindket.com/learn/tools/lm-studio) |
| Chat with an assistant and no code | It has a chat room, but assistants are built for this | [ChatGPT](https://mindket.com/learn/tools/chatgpt), [Claude](https://mindket.com/learn/tools/claude) or [Gemini](https://mindket.com/learn/tools/gemini) |
| Download open model files | No, it routes requests and does not hand out files | [Hugging Face](https://mindket.com/learn/tools/hugging-face) |
| Build a workflow around an AI step | No, not by itself. It supplies the model, not the steps | [n8n](https://mindket.com/learn/tools/n8n), [Zapier](https://mindket.com/learn/tools/zapier) or [Make](https://mindket.com/learn/tools/make) |

## How to use OpenRouter, step by step

These steps are for OpenRouter's website. Pages move when the site updates, so they name the parts that stay put: the models list, credits, keys and activity.

1. Create an account on [OpenRouter's website](https://openrouter.ai/). Its FAQ says you add credits to pay for paid models, and that an account with no credits can still call free models within the free caps.
2. Open the [models page](https://openrouter.ai/models) and browse. Each model has its own page with its providers, its context length and what it supports, such as images or tool calls. Filter for free models to start.
3. For paid models, add credits on the [Credits page](https://openrouter.ai/settings/credits). The FAQ says each request cost is taken from your credit balance, and prices are per million tokens.
4. Open the [keys page](https://openrouter.ai/keys) and create an API key. Give it a name and set a credit limit, since the documentation recommends a limit on every key.
5. Store the key in an environment variable named `OPENROUTER_API_KEY`. Never paste it into code you commit or share.
6. Send a first request with the example below. It uses `openrouter/free`, so OpenRouter picks a free model for you.
7. Read the reply. Its `model` field names the model that answered. To use a particular model next time, change only the model name.
8. Open the [Activity page](https://openrouter.ai/activity) to see your usage and cost for each request, and check your key limit before you run a long job.

1. Open the **Models** page and set the **Prompt pricing** slider in the left column to **FREE**. The list narrows to free models, a good place to start.
   ![An illustration of OpenRouter's Models page with a gold ring around the Prompt pricing slider in the left column.](https://mindket.com/blog/screens/openrouter-1-prompt-pricing.webp?v=05cfaf2b9df3)
2. To use paid models, open **Credits** and press **Add Credits**. Free models need no credits.
   ![An illustration of OpenRouter's Credits page with a gold ring around the Add Credits button.](https://mindket.com/blog/screens/openrouter-2-add-credits.webp?v=8ec0c747dfe8)
3. Open **Keys** and press **Create API Key**. Type a name, then fill in **Credit limit (optional)** so a runaway loop stops at that amount.
   ![An illustration of OpenRouter's Create a Key dialog with a gold ring around the Credit limit (optional) field.](https://mindket.com/blog/screens/openrouter-3-credit-limit.webp?v=2e9d00854bb6)
4. After your first request, open **Activity** in the left menu. It lists each request with its model, tokens and cost.
   ![An illustration of OpenRouter's Activity page with a gold ring around Activity in the left menu.](https://mindket.com/blog/screens/openrouter-4-activity.webp?v=c14de7c92afe)

*AI-made illustrations of OpenRouter's screens, drawn on 6 November 2026 to match these steps. They are not screenshots, so the real app may look different: follow what you see.*

> The tutorials at the top of this page show these steps on screen. OpenRouter changes its pages now and then, so if a name differs, follow the one you see.

## An example to try

Run this in a Mac or Linux shell or in Git Bash, with your key in `OPENROUTER_API_KEY`. It is the free router example from OpenRouter's documentation with a new question.

````bash
curl https://openrouter.ai/api/v1/responses \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openrouter/free",
    "input": "Explain in two sentences what an API gateway does."
  }'
````

- The reply is JSON. Its `model` field names the free model OpenRouter picked, and it can differ from one request to the next.
- Free requests are capped per minute and per day, so a second call a moment later can be refused.
- To use Python's `openai` package instead, set `base_url` to `https://openrouter.ai/api/v1` and `api_key` to your OpenRouter key, as OpenRouter's documentation shows.
- To use another model, replace `openrouter/free` with a model name copied from its page.

## Tips for better results

- Learn on `openrouter/free` first. Move to a named model when you know what the task needs.
- Set a credit limit on every key. A leaked key or a runaway loop then stops at the limit instead of draining your balance.
- To keep a request free, put only `:free` models in a `models` list. A fallback to a paid model is billed at that model's own price.
- Use the `:nitro` suffix when speed matters and `:floor` when price matters. Both change how providers are sorted.
- Read a model's page before you build on it. Tool calls, images and structured output are not supported by every model.
- For sensitive text, open your [privacy settings](https://openrouter.ai/settings/privacy) and restrict routing to providers whose data policy you accept.

## Limits and costs

- OpenRouter's FAQ and limits page, read on 6 November 2026, give free models 20 requests a minute. The daily cap is 50 requests if you have bought fewer than 10 credits in all, and 1,000 if you have bought at least 10.
- OpenRouter says it passes through the providers' prices with no markup on inference, and it charges a fee when you buy credits. Check the fee on its [FAQ](https://github.com/OpenRouterTeam/docs/blob/main/faq.mdx) before you add a large balance.
- A free model may be rate-limited or unavailable at any time, and free versions can have different limits from the paid model.
- OpenRouter does not store your prompts and replies unless you opt in to logging or content is flagged for abuse review. The provider that runs your request keeps its own data policy, and some providers may train on prompts, so check each one.
- Third-party tools may need a specific provider. Its Claude Code guide says the setup is only guaranteed to work with Anthropic's own provider.

## YouTube tutorials

- [What is OpenRouter | All about OpenRouter in 10 minutes](https://www.youtube.com/watch?v=fjd2hm6-qtM) (codebasics)
- [How to Use AI Models API for Free | OpenRouter Tutorial](https://www.youtube.com/watch?v=VvJvJ0uXiVQ) (The Coding Koala)
- [OpenRouter Explained: One API Key for Every AI Model](https://www.youtube.com/watch?v=5XMkwyQnyQs) (Coding Fab)
- [How to Use OpenRouter (Tutorial for Beginners)](https://www.youtube.com/watch?v=iZM2DcOhaaY) (MMX)

## Learn more about OpenRouter

- [OpenAI API tutorial: the Responses API in Python and JavaScript](https://mindket.com/learn/openai-api/openai-api-quickstart)
- [Which AI model should I use for my task?](https://mindket.com/learn/ai-basics/choose-an-ai-model)

## Frequently asked questions

### Is OpenRouter free?

Partly. An account with no credits can call free models within the free caps, which its docs give as 50 requests a day, or 1,000 once you have bought at least 10 credits. Paid models take credits, and OpenRouter charges a fee when you buy them.

### What does OpenRouter do?

It sits between your code and the companies that run AI models. You send one request to OpenRouter, it picks a provider that serves the model you named, and it handles billing and fallbacks. Its GitHub page lists more than 400 models and more than 90 providers.

### Does OpenRouter work with the OpenAI SDK?

Yes. OpenRouter's documentation says any SDK that supports OpenAI also supports it, and its GitHub page says to change the base URL and the key. The request shapes it accepts are the Responses API and Chat Completions.

### Does OpenRouter see my prompts?

Requests pass through it, but its privacy page says it does not store prompts or replies unless you opt in to logging or content is flagged for abuse review. It does store metadata such as token counts and latency. The model provider has its own policy.

### Who makes OpenRouter?

OpenRouter is a company based in New York City. Wikipedia says it was founded in 2023 by Alex Atallah and Louis Vichy.

### Can I use OpenRouter with Claude Code or Cursor?

Its documentation has guides for Claude Code, Codex CLI and Cursor. The Claude Code guide warns that the setup is only guaranteed to work with Anthropic's own provider, so follow [the guide's provider advice](https://github.com/OpenRouterTeam/docs/blob/main/cookbook/coding-agents/claude-code-integration.mdx).

## Sources

- [GitHub: OpenRouterTeam docs, Quickstart](https://github.com/OpenRouterTeam/docs/blob/main/quickstart.mdx) (read 2026-11-06)
- [GitHub: OpenRouterTeam docs, FAQ](https://github.com/OpenRouterTeam/docs/blob/main/faq.mdx) (read 2026-11-06)
- [GitHub: OpenRouterTeam docs, API reference overview](https://github.com/OpenRouterTeam/docs/blob/main/api_reference/overview.mdx) (read 2026-11-06)
- [GitHub: OpenRouterTeam docs, Authentication](https://github.com/OpenRouterTeam/docs/blob/main/api_reference/authentication.mdx) (read 2026-11-06)
- [GitHub: OpenRouterTeam docs, Limits](https://github.com/OpenRouterTeam/docs/blob/main/api_reference/limits.mdx) (read 2026-11-06)
- [GitHub: OpenRouterTeam docs, Free Models Router](https://github.com/OpenRouterTeam/docs/blob/main/guides/routing/routers/free-router.mdx) (read 2026-11-06)
- [GitHub: OpenRouterTeam docs, Model fallbacks](https://github.com/OpenRouterTeam/docs/blob/main/guides/routing/model-fallbacks.mdx) (read 2026-11-06)
- [GitHub: OpenRouterTeam docs, Data collection](https://github.com/OpenRouterTeam/docs/blob/main/guides/privacy/data-collection.mdx) (read 2026-11-06)
- [GitHub: OpenRouterTeam docs, Claude Code guide](https://github.com/OpenRouterTeam/docs/blob/main/cookbook/coding-agents/claude-code-integration.mdx) (read 2026-11-06)
- [GitHub: OpenRouterTeam organization profile](https://github.com/OpenRouterTeam/.github/blob/main/profile/README.md) (read 2026-11-06)
- [Wikipedia: OpenRouter](https://en.wikipedia.org/wiki/OpenRouter) (read 2026-11-06)
- [codebasics on YouTube: What is OpenRouter](https://www.youtube.com/watch?v=fjd2hm6-qtM) (read 2026-11-06)
- [The Coding Koala on YouTube: How to Use AI Models API for Free](https://www.youtube.com/watch?v=VvJvJ0uXiVQ) (read 2026-11-06)
- [Coding Fab on YouTube: OpenRouter Explained](https://www.youtube.com/watch?v=5XMkwyQnyQs) (read 2026-11-06)
- [MMX on YouTube: How to Use OpenRouter (Tutorial for Beginners)](https://www.youtube.com/watch?v=iZM2DcOhaaY) (read 2026-11-06)

[Start the lesson](https://mindket.com/learn/openai-api/openai-api-quickstart)
