SYSTEM NOTICE

Auto translation by AI. Be sure, accuracy, nuances and authorial intent may not be fully reflected.
見出し画像

Trying out various LLMs via API using OpenRouter's free models

There are moments when I think, 'I'm satisfied with just Claude or just ChatGPT, but I wonder what other models are like.' Qwen, Gemma, Llama, GLM, Nemotron—I hear these names often, but it's a hassle to sign up for an API contract for each one just to try them out. Some of them don't even have enough memory to run on my local Ollama.

That's where OpenRouter comes in handy; it's a service that lets you call over 100 models with a single API key. On top of that, there are over 20 models available for free (those marked with :free) that you can test without needing to pay. I use this as a 'tasting corner' for models I'm curious about.

In this article, I will introduce how to try out various things using OpenRouter's free models, as well as models that I can recommend 'you should definitely try' as of April 2026.

https://openrouter.ai/models?q=free

What is OpenRouter?

Roughly speaking, it is a service that allows cross-access to over 100 types of models using an OpenAI-compatible API.

  • Famous ones like Anthropic (Claude), OpenAI (GPT), Google (Gemini), Meta (Llama), Qwen, DeepSeek, Mistral, and xAI (Grok) are almost all available.

  • The endpoint is https://openrouter.ai/api/v1, and since the API is OpenAI-compatible, you can use the openai SDK as is.

  • Billing is credit-based (prepaid or pay-as-you-go).

  • Some models are released by providers as a 'free tier', and can be called using the ID model-name:free.

  • Since they are released for free, please assume they are being used for training when you use them. (Although it is stated, let's protect personal information, etc.)

The official website is here.

https://openrouter.ai/

How to use free models

1. Create an account and get an API key

Create an account on the OpenRouter site and issue an API key from Keys in the dashboard. The key will be in a format like sk-or-v1-.... You need a key even if you only use free models.

2. Try hitting it with curl

The easiest way to try it out. An example of calling openai/gpt-oss-20b:free.

curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-oss-20b:free",
    "messages": [
      {"role": "user", "content": "日本の秋の食べ物を3つ挙げて、それぞれ1行で説明して"}
    ]
  }'

You can switch to another model just by replacing the model value. This is the most satisfying part of OpenRouter.

3. Use it from Python

Since the existing OpenAI SDK can be used as-is, you can swap it in with almost zero learning cost.

from openai import OpenAI

client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key="sk-or-v1-xxxxxxxxxxxx",
)

res = client.chat.completions.create(
    model="qwen/qwen3-next-80b-a3b-instruct:free",
    messages=[
        {"role": "user", "content": "Pythonの非同期処理を3行で説明して"}
    ],
)

print(res.choices[0].message.content)

Just replace the base_url and api_key. You can reuse scripts written for ChatGPT and compare them with other models at the same time.

4. Regarding free tier limitations

The exact numbers change frequently based on operational policies, so checking the official 'Limits' page is the right approach, but here is the general outline.

  • Even free models have rate limits (requests per minute).

  • There is also a cap on the total number of requests per day, and the limit increases once you add a certain amount of credit to your account.

  • Some free tiers are 'provided by providers for a limited time,' so some models may suddenly lose their :free status.

In short, it is not suitable for production use. It is intended for purposes like 'testing,' 'comparing,' and 'building prototypes.'

https://openrouter.ai/docs/api-reference/limits

Recommended free models as of April 2026

From the models with :free on OpenRouter, I will list the ones that I personally think will broaden your horizons if you try them out. All of them can be called via API, and all are 0 yen.

For a solid experience in Japanese: Llama 3.3 70B

meta-llama/llama-3.3-70b-instruct:free

Meta's 70B model. Its Japanese responses are quite natural, and it can be used for summarizing long texts or rewriting. The Llama series remains strong as a 'current baseline.' Start here if you want to try just one model.

The latest top contender: Qwen3-Next 80B

qwen/qwen3-next-80b-a3b-instruct:free

A next-generation model in the Qwen3 series. It is quite surprising that a 262K token context length is available for free. It follows Japanese instructions well and excels at tasks like feeding it long documents for summarization.

Coding-focused: Qwen3-Coder

qwen/qwen3-coder:free

As the name suggests, it is for code. The way it writes comments and the granularity of its diff suggestions are just right, so it is also a good option to connect to Cursor/Cline-style editors as a 'sub-LLM'.

Trending OSS: GPT-OSS 120B / 20B

  • openai/gpt-oss-120b:free

  • openai/gpt-oss-20b:free

Open-weight models released by OpenAI for the first time in a while. Unlike closed APIs, you can access the internals, making them perfect for those who want to dissect OpenAI-style behavior on their own. The 120B model is heavy on inference, but since it's free, you can easily compare it.

For those who want to reproduce it on a single machine: Gemma 3 27B

google/gemma-3-27b-it:free

Google's Gemma 3 series. If you are running Ollama locally, you can use the :free version on OpenRouter to see how the same model reacts and use it as a benchmark to see if it produces the same output as your own environment. The Japanese is also quite natural.

The heavy hitter: Hermes 3 Llama 3.1 405B

nousresearch/hermes-3-llama-3.1-405b:free

A 405B model fine-tuned by Nous Research. Being able to call a size that an individual would normally never be able to touch via API is an experience unique to the free tier. It shows its personality in long-form writing support and difficult reasoning tasks.

Interested in agent use cases: GLM-4.5 Air

z-ai/glm-4.5-air:free

Zhipu's GLM-4.5 Air. Its behavior regarding tool calling (function calling) is different from other models and interesting. It's worth keeping an eye on if you want to try out agent-like tasks.

Lightweight and fast: Nemotron Nano 9B

nvidia/nemotron-nano-9b-v2:free

NVIDIA's small model. With the lightness and speed of 9B, it can be used for tasks where you want to throw a large number of requests casually. It's not bad as a chatbot prototype or a working model when playing around in Jupyter.

Try out super-large models for free: Nemotron 3 Super 120B / Minimax M2.5

  • nvidia/nemotron-3-super-120b-a12b:free

  • minimax/minimax-m2.5:free

Both are large 120B-class / MoE-based models. They are perfect for filling in the 'I haven't really touched them, but I know the names' category. The context length is also generous, ranging from 196K to 262K.

A few tips

Also check x-ai, mistralai, and openrouter/auto

Beyond the free tier, OpenRouter's 'openrouter/auto' router feature is interesting. It automatically distributes the prompts you send based on cost and performance. It's easy to use this for production while keeping the model fixed with :free for prototyping.

Include HTTP-Referer and X-Title headers

If you include your project URL and title in the headers when making a request to OpenRouter, it will be displayed in the official 'App List' (optional). It's not necessary if you're just using the API alone, but it's nice to have if you're building and publishing something.

client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key=API_KEY,
    default_headers={
        "HTTP-Referer": "https://github.com/your/repo",
        "X-Title": "my-side-project",
    },
)

Streaming responses work as is

If you set stream=True in the OpenAI SDK, tokens will stream sequentially even via OpenRouter. The perceived response speed varies significantly by model, making it easy to compare things like 'Is it this fast even at this size?'

Each model has its own strengths and weaknesses

For example,

  • Long-form summarization → Qwen3-Next 80B, Gemma 3 27B, Llama 3.3 70B

  • Code generation → Qwen3-Coder, GPT-OSS 120B

  • Agents / Tool calling → GLM-4.5 Air, Hermes 3 405B

  • Light and fast → Nemotron Nano 9B, GPT-OSS 20B, Gemma 3 12B

If you spend about 30 minutes 'sending the same prompt to three models and comparing the results side-by-side,' you'll start to see which models fit your use case.

Agent tools that connect to OpenRouter

If you only hit the API directly, you might end up thinking, 'ChatGPT is more convenient after all.' This is where OpenRouter's true value shines: using it by swapping the base_url in editors and agent tools. Here, I'm just introducing that it's supported. I plan to write a separate article for detailed settings and comparisons.

Tools in the coding space that have OpenRouter as a built-in setting.

  • Cline (VSCode extension) … A VSCode extension that acts like an agent. It has an OpenRouter preset in the settings screen, allowing you to specify :free models directly.

  • Roo Code (Cline fork) … A derivative fork of Cline. It adds features quickly and is useful when you want to try the latest models via OpenRouter.

  • Continue (VSCode / JetBrains) … A long-standing AI coding assistant. You can use it just by writing the OpenRouter settings in config.json.

  • Aider (Terminal) ... A terminal-resident coding companion. Instantly compatible via --openai-api-base https://openrouter.ai/api/v1

  • Zed (Editor) ... An editor built in Rust. You can select OpenRouter as the provider for its assistant features

Chat / General-purpose UI systems.

  • Open WebUI ... Famous for being Ollama-centric, but you can also configure OpenRouter as an OpenAI-compatible endpoint. It's convenient to have local LLMs and free cloud models side-by-side in the same UI

  • LibreChat ... A chat UI that supports multiple providers. You can use it by entering the OpenRouter endpoint in librechat.yaml

  • ChatBox / BoltAI and other desktop clients ... Most support adding OpenAI-compatible endpoints, so they work as-is if you specify OpenRouter

Agent / Autonomous execution systems.

  • OpenHands (formerly OpenDevin) ... An autonomous agent OSS. You can select OpenRouter as the LLM provider

  • LangChain / LlamaIndex ... If your configuration uses an OpenAI-compatible client on the framework side, you can migrate just by replacing the base_url

In short, you just need to remember “If it's a tool that accepts an OpenAI-compatible API, you can almost always swap it for OpenRouter.” This is the fastest route to start playing around by plugging in :free models.

Injecting it into your everyday coding CLI via export

Taking it a step further, your everyday OpenAI-compatible CLI can often be pointed to OpenRouter just by swapping environment variables. This is the easiest way to do it in practice.

Since many CLIs are implemented to read OPENAI_API_KEY and OPENAI_BASE_URL (or OPENAI_API_BASE), you can set them in your shell like this.

export OPENAI_API_KEY="sk-or-v1-xxxxxxxxxxxx"
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"
export OPENAI_MODEL="qwen/qwen3-coder:free"   # ツールが読む場合のみ

With just this,

  • OpenAI Codex CLI series

  • Aider (the type that uses OPENAI_API_BASE. It often works with either name)

  • Custom scripts (those hitting endpoints via openai / httpx / curl)

  • LangChain / LlamaIndex scripts using the default client

and similar tools can be switched to OpenRouter's free models without rewriting a single line of source code. For personal projects, if you write it in .envrc using direnv, it's convenient to be able to switch per repository, saying, “I'll try this free model for now.”

Cases that don't work / aren't straightforward

However, not all CLIs can be switched using export, so be careful.

  • Claude Code or Anthropic SDK-based tools ... Since they assume Anthropic's proprietary endpoint (/v1/messages), simply replacing the OpenAI-compatible base_url will not work. You need to set up a relay proxy like LiteLLM in between.

  • Gemini CLI / Google AI Studio SDK ... Because these are Google's proprietary APIs, they cannot be directly swapped either.

  • Some vendor-native CLIs (e.g., xAI Grok, Cohere, etc.) ... Some are designed with fixed internal endpoints and cannot be redirected via environment variables.

  • There are also some tools that do not read environment variables and only look at configuration files (like config.yaml). In that case, simply edit the configuration file directly.

As a way to tell, the fastest method is to check the tool's documentation to see if it supports 'OPENAI_API_KEY and OPENAI_BASE_URL (or OPENAI_API_BASE)'. If it does, there is a 99% chance it can be pointed to OpenRouter.

Points to note

Just one last thing. It is safer to assume that free models should not be used in production.

  • As written above, :free models can disappear suddenly.

  • Some providers have an option to use prompts submitted via the free tier for training, and you may need to configure opt-in/out settings (it is safest to have a policy of never entering confidential information).

  • The official documentation is the source of truth for rate limits.

I think it is best used as a 'tasting corner' or a place to cross-compare various models.

Summary

  • OpenRouter is a service that allows you to call over 100 models with a single API key.

  • Models marked with :free can be tried without charge (around 25 as of April 2026).

  • Since it is OpenAI SDK compatible, you just need to replace the base_url and api_key in your existing code.

  • If you want to try them out, start with Llama 3.3 70B, Qwen3-Next 80B, Qwen3-Coder, or GPT-OSS 120B.

  • Most agent tools that support OpenAI compatibility, such as Cline, Continue, Aider, and Open WebUI, are supported.

  • It is better suited for 'model comparison,' 'prototyping,' and 'broadening your horizons' than for production operations.

I hope those who have been curious about models other than Claude/ChatGPT but haven't gotten around to trying them will use this as a first step.

↓ Click here for the model list

https://openrouter.ai/models?q=free

いいなと思ったら応援しよう!

zephel01 サーバー代とコーヒー代になります☕ 役に立ったら応援よろしくお願いします!