Mindket
Tool guideOpenRouter by OpenRouterFree plan

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.

Good for
  • One API for many models
  • Free models to learn on
  • Fallbacks if a provider fails
  • Spending caps per key

At a glance

  • 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.
All tools
On this page
  1. YouTube tutorials
  2. What OpenRouter is
  3. What OpenRouter is good for
  4. When to use OpenRouter, and when to pick another tool
  5. How to use OpenRouter, step by step
  6. An example to try
  7. Tips for better results
  8. Limits and costs
  9. Learn more about OpenRouter
  10. Frequently asked questions
  11. Sources

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 jobUse OpenRouter?Or try
Compare several models from one account and one keyYes. This is its main jobEach maker's own API, as in the OpenAI API quickstart
Call a model through the OpenAI SDK with a different base URLYes, as its documentation describesThe maker's own endpoint
A feature that only one maker's API offersCheck the model page first, since support varies by model and providerThe maker's own API
Keep prompts on your own computerNo. Requests go to a hosted providerOllama or LM Studio
Chat with an assistant and no codeIt has a chat room, but assistants are built for thisChatGPT, Claude or Gemini
Download open model filesNo, it routes requests and does not hand out filesHugging Face
Build a workflow around an AI stepNo, not by itself. It supplies the model, not the stepsn8n, Zapier or 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. 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 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. The FAQ says each request cost is taken from your credit balance, and prices are per million tokens.
  4. Open the keys page 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 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.
  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.
  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.
  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.

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.

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 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 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.

Learn more about OpenRouter

  1. 1OpenAI API course: Responses, tools, structured output and agents · Lesson 1 of 4OpenAI API tutorial: the Responses API in Python and JavaScriptAn OpenAI API tutorial for developers: get a key, install the SDK, call the Responses API in Python and JavaScript, stream it and keep conversation state.12 min
  2. 2AI basics course for beginners · Lesson 2 of 4Which AI model should I use for my task?Which AI model should I use? Pick the assistant by your task and where your files live, then a fast or deep-thinking model, and test two on your own work.8 min

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.

Sources

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

Share this lesson

Make your first API call

The lesson covers an API key, a first request and streaming with the Responses API, the request shape OpenRouter accepts.

Start the lesson

This lesson as Markdown · All tools · All courses