
The OpenRouter API Link You Paste Into Any OpenAI-Compatible Client
Use https://openrouter.ai/api/v1 as the base URL in any OpenAI-compatible SDK or app, and use https://openrouter.ai/api/v1/chat/completions only when you send raw HTTP requests yourself. Which form works depends on one thing: whether the tool you are configuring appends the chat path automatically or expects the complete request address.
Getting that distinction right before you touch an API key saves the most time. Almost every failed first connection comes from pasting the full chat completions path into a field that only wanted the base URL, or leaving the path off when writing a direct POST request.
The Exact Base URL and Chat Completions Path
Base URL (for SDKs, extensions, and no-code tools):
https://openrouter.ai/api/v1
Full chat completions endpoint (for raw HTTP / cURL):
POST https://openrouter.ai/api/v1/chat/completionsEvery part of those two lines has a strict job. The scheme (https://) encrypts your Bearer token in transit, and the host (openrouter.ai) routes the call to OpenRouter instead of OpenAI's default servers. The /api/v1 segment is the versioned root that matches the OpenAI Chat Completions contract, which is why official OpenAI SDKs work once you override their base URL.
When you send a raw HTTP request instead of using an SDK, you append /chat/completions yourself and pass your OpenRouter key in the Authorization header as a Bearer token. Inside the JSON body, you name a provider-prefixed model string such as anthropic/claude-sonnet-5.5, openai/gpt-6.1-sol, or mistralai/mistral-large-4-0. Changing that single string routes the exact same request structure to a different lab without touching the URL or the header.
POST https://openrouter.ai/api/v1/chat/completions
Authorization: Bearer <YOUR_OPENROUTER_API_KEY>
Content-Type: application/json
{
"model": "anthropic/claude-sonnet-5.5",
"messages": [
{
"role": "user",
"content": "Return the word ok."
}
]
}If you are comparing how this layout lines up with gateways like Vercel AI Gateway, Portkey, or LiteLLM Proxy, our walkthrough on OpenAI-compatible endpoint setup breaks down the shared request format.
Before you test a workflow against a free model, check the rate limits attached to the model ID you pick. Free model variants on OpenRouter (IDs ending in :free) are capped at 20 requests per minute and 50 requests per day, rising to 1,000 requests per day once the account has bought $10 of credits. That cap applies to the :free tier specifically, so a small test script will pass right away while a busy loop will hit a limit quickly unless you account for the ceiling.
The two forms are not interchangeable, and the field label in your tool is the only reliable signal for which one to use. A field that says base URL, endpoint root, or API host wants the short form. A field that asks for a full URL, request URL, or complete endpoint, or a code block where you write the POST line yourself, wants the long form. When a tool gives you both a base URL field and a separate path field, put the short form in the first and /chat/completions in the second, and leave neither blank.
Watch for tools that prefill the base URL field with a vendor default. Some clients show a greyed placeholder rather than an actual value, and typing nothing leaves the default in force, so your key travels to the wrong host and fails in a way that looks like a bad credential. Overwrite the field explicitly rather than assuming an empty box means no value.
If you are behind a corporate proxy or a self-hosted relay, the host segment is the part you change and the version segment is the part you keep. Swap openrouter.ai for your relay's hostname, keep /api/v1 intact, and the client's path logic still lands on the right route. Dropping the version segment during that swap is a common slip, and it produces a not-found that looks identical to a typo in the host.
Finally, treat the address as a constant in your own code. Define it once, reference it everywhere, and never let a copy-pasted string from a chat window become a second source of truth. The doubled path error is almost always born that way.
What Each Part of the Endpoint Address Tells Your Client
An OpenRouter base URL is the shared root address (https://openrouter.ai/api/v1) that tells an OpenAI-compatible client where to send standard chat requests so one integration can reach models from Anthropic, OpenAI, and Mistral without rewriting code. It serves anyone connecting a browser extension, a spreadsheet workflow, a local script, or an official OpenAI SDK to multiple model providers through a single billing and key layer. Unlike a provider-specific endpoint that locks your request shape to one vendor, this address acts as a uniform front door where the model field inside the payload does the routing. It also differs from the full /chat/completions URL, which targets one specific action rather than the root directory an SDK expects. Keep in mind that pricing and rate rules still vary by model behind that same address: “other $0 models skip these caps but can still hit per-model limits set by OpenRouter or the provider” (OpenRouter Free AI Models collection page (FAQ)). For a broader look at how OpenAI-compatible services standardize these paths across different gateways, see our dedicated comparison.
The version segment deserves more attention than it usually gets, because it is the piece that decides whether an SDK's built-in assumptions hold. An official OpenAI SDK ships with a hardcoded default host and a path it appends on every call; when you override only the base URL, you are swapping the host and the version root at once while leaving the SDK's path logic untouched. That is the intended seam. Point the override at anything other than the versioned root and the SDK will happily build a request against a shape the router does not serve, and the error you get back will describe a missing route rather than a bad key, which sends most people hunting in the wrong place.
There is a second consequence of routing everything through one root: the URL no longer identifies the vendor, so the model string becomes the only thing that does. That is convenient right up until you copy a request from a tutorial, change the model, and forget that the surrounding payload may have been written for a provider that accepts different optional fields. The router forwards what it can and rejects what it cannot map, so a request that worked against one lab can fail here even though the address and header are identical. Treat the base URL as the stable part of your configuration and the model string plus body as the parts you re-check on every switch.
Teams often ask whether to store the base URL per model or once globally. Store it once. Splitting it per model invites drift, and drift is how one script ends up with the doubled path while the rest of the codebase is fine. Keep the base URL in a single configuration value, keep the model in the request, and the address stops being something you debug.
Mistakes That Break Requests Before a Model Ever Replies
OpenAI-compatible clients automatically join /chat/completions onto whatever base address you give them, so a full endpoint turns into /api/v1/chat/completions/chat/completions on the wire. Strip everything after /v1 whenever the app or SDK asks for a base URL, and reserve the full path for raw HTTP calls.
Leaving a trailing slash on https://openrouter.ai/api/v1/ can trip up strict URL builders in smaller tools and extensions. Some HTTP libraries normalize double slashes silently, while others send /api/v1//chat/completions and fail before authentication even runs. Copy the base URL without a trailing slash so the client can append its own path cleanly.
Sending a bare model name like claude-sonnet-5.5 or gpt-6.1-sol instead of the provider-prefixed ID causes OpenRouter to reject the payload. Because one address fronts multiple labs, the router needs the prefix (anthropic/, openai/, mistralai/) to know which upstream model you mean. Copy the exact model slug from OpenRouter's model listing, including any :free suffix when you intend to use a free variant.
Assuming every $0 model behaves identically under load leads to surprise throttling mid-run. Even at $0 prompt pricing, :free variants follow the strict per-minute and daily caps, while other zero-cost models can still enforce provider-side limits. Test your target model with a short, single-turn prompt first, then scale up only after you see clean responses.
Forgetting the Bearer prefix in the Authorization header returns an authentication error even when the API key itself is valid. Raw HTTP clients do not add the scheme for you, so sending the raw key string fails immediately. Always format the header as Authorization: Bearer <YOUR_OPENROUTER_API_KEY> with a single space between Bearer and the key.
Verify the Connection From Scratch
- Create or copy your key from the OpenRouter API keys page, keeping in mind that a single OpenRouter API key works for both free and paid models, so you create one key on the API keys page and reuse it across every model.
- Open the configuration screen of your SDK, HTTP client, or browser tool and locate the base URL field.
- Paste
https://openrouter.ai/api/v1with no trailing slash if the tool is an OpenAI-compatible client, orhttps://openrouter.ai/api/v1/chat/completionsif you are writing a raw POST request. - Enter your OpenRouter key in the API key field, or add
Authorization: Bearer <YOUR_OPENROUTER_API_KEY>to your request headers. - Set the model string to a full provider-prefixed ID such as
openai/gpt-6.1-soloranthropic/claude-sonnet-5.5.
BrowseWiz runs as an extension in your own Chrome and supports model choice with your own API key or an OpenAI-compatible endpoint. If you want to connect your OpenRouter key inside Chrome to pull web data into Google Sheets, you can enter the base URL on the BrowseWiz settings page and follow our custom model configuration docs. If you run into a setup snag or need help with a team configuration, reach out on our contact page.
Frequently Asked Questions
Can I get free API from OpenRouter?
Yes. OpenRouter offers a collection of free AI models with zero prompt pricing, including variants whose IDs end in :free as well as other zero-cost models. You do not need a separate account or a separate key to call them, though :free variants carry per-minute and daily request caps that expand once you add paid credits to your account, and other zero-cost models may still enforce provider-level limits.
How do I get an API key for OpenRouter?
Sign in to your OpenRouter account, open the API keys page, and generate a new key. Copy it immediately and store it in your password manager or environment variables, because you will paste it into your client's API key field or Authorization: Bearer header. That single key works across both free and paid models, so you do not need to rotate or create extra keys when switching providers.
What is the API link?
For OpenAI-compatible SDKs, browser extensions, and no-code apps, the link is the base URL https://openrouter.ai/api/v1. For direct HTTP requests where you construct the POST call yourself, the link is the full chat completions endpoint https://openrouter.ai/api/v1/chat/completions. Both point to the same OpenAI-compatible interface; the only difference is whether your client appends /chat/completions on its own.

About Tom
I'm a software engineer and solutions architect specializing in AI-driven tools and productivity software, passionate about helping users reclaim their valuable time through intelligent automation.
This article was written with AI and reviewed by Tom.