Skip to main content
# Before
from openai import OpenAI
import os

client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key=os.environ["OPENROUTER_API_KEY"],
)

# After
from openai import OpenAI
import os

client = OpenAI(
    base_url="https://api.concentrate.ai/v1",
    api_key=os.environ["CONCENTRATE_API_KEY"],
)

Prerequisites

1

A Concentrate AI account with an active API key

Sign up or log in at concentrate.ai and create an API key. Your key should start with sk-cn.
2

An existing OpenRouter integration

This guide assumes you are already calling OpenRouter from the OpenAI SDK, fetch, requests, or another HTTP client. If you are starting fresh, follow the Quickstart instead.

Quick Start for Claude Code users

If you use Claude Code, you can install a skill that walks through this migration interactively. It searches your project for OpenRouter usage, removes OpenRouter-specific headers and parameters, maps model slugs, and generates a verification script. Drop the skill into your ~/.claude/skills/ directory:
mkdir -p ~/.claude/skills/migrate-openrouter && \
  curl -fsSL https://concentrate.ai/scripts/migrate-openrouter.md \
  -o ~/.claude/skills/migrate-openrouter/SKILL.md
Then start a Claude Code session in your project and ask it to “migrate from OpenRouter to Concentrate” or run /migrate-openrouter. Claude will load the skill and run the steps.

Step 1: Update Your Environment Variables

Replace your OpenRouter configuration with Concentrate’s:
# Before
export API_KEY="sk-or-..."
export BASE_URL="https://openrouter.ai/api/v1"

# After
export API_KEY="sk-cn-..."
export BASE_URL="https://api.concentrate.ai/v1"

Step 2: Update Your Client

from openai import OpenAI
import os

client = OpenAI(
    base_url="https://api.concentrate.ai/v1",
    api_key=os.environ["CONCENTRATE_API_KEY"],
)

response = client.chat.completions.create(
    model="anthropic/claude-opus-4-6",
    messages=[{"role": "user", "content": "Say hello in one word"}],
)

print(response.choices[0].message.content)
Remove OpenRouter-specific headers like HTTP-Referer and X-Title. They serve no purpose on Concentrate. Attribution and project context live in the Concentrate dashboard.

Step 3: Update Model Identifiers

Concentrate accepts model strings in two forms:
  • Bare slug, e.g. gpt-4o, claude-haiku-4-5, auto. Routing picks a provider.
  • provider/model-id, e.g. bedrock/claude-haiku-4-5, openai/gpt-4o. Pins the request to a specific provider.
One thing to know about the slashed form: the prefix is the provider that serves the request, not the model’s author. OpenRouter uses the model’s author in the slug; Concentrate uses the provider. For most popular names the two are the same string (openai, anthropic, mistral, cohere), so existing OpenRouter slugs usually keep working. They diverge whenever a model is hosted by something other than its author:
AuthorProvider serving the requestConcentrate slug
Anthropic (claude-haiku-4-5)Anthropicanthropic/claude-haiku-4-5
Anthropic (same model, different host)AWS Bedrockbedrock/claude-haiku-4-5
Anthropic (same model, different host)Azureazure/claude-haiku-4-5
Google (gemini-3.5-flash)Google AI Studioai-studio/gemini-3.5-flash
Meta (llama-3-8b-instruct)AWS Bedrockbedrock/llama-3-8b-instruct
Bare slugs work in all of these cases. Use them when you don’t care which provider serves the request. Use the provider/ prefix when you specifically want to pin to one host (for ZDR compliance, contractual reasons, or latency in a specific region). The only required slug change vs. OpenRouter is auto-routing:
OpenRouterConcentrate AI
openrouter/autoauto (see Auto Routing)
For the authoritative list of available models, call GET /v1/models or browse the Model Fortress.

Step 4 (Optional): Adopt the Responses API

For new code, we recommend the native Responses API. It supports streaming, tool calling, structured output, multi-modal input, and web search through a single normalized shape across every provider.
curl https://api.concentrate.ai/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $CONCENTRATE_API_KEY" \
  -d '{
    "model": "anthropic/claude-opus-4-6",
    "input": "What is the capital of France?"
  }'

Why migrate to Concentrate

OpenRouter exposes an OpenAI-compatible endpoint at https://openrouter.ai/api/v1. Concentrate exposes the same OpenAI Chat Completions shape at https://api.concentrate.ai/v1/chat/completions, plus a native Responses API at https://api.concentrate.ai/v1/responses.To migrate, point your existing client at the Concentrate base URL, swap your API key, and (optionally) update model identifiers to Concentrate’s author/model-id format.Billing and usage are managed through your Concentrate AI credits. All usage, including reasoning and cached tokens, appears in your Concentrate dashboard.
Concentrate organizes billing around an organization → team → developer → key hierarchy. Set budgets at any level and roll spend up into a single dashboard without provisioning a separate key for every contributor.
Concentrate ships first-party dashboards that aggregate usage, spend, latency, providers, models, and cache hit rates across your whole org, broken down by team, developer, and key with no external integration to wire up.
Concentrate’s model: "auto" lets you pick the optimization target explicitly (minimize cost, minimize latency, or maximize performance) instead of relying on a single opaque optimizer. See Auto Routing.
Concentrate’s routing layer goes beyond ordered fallbacks: an uptime gate skips providers below a per-feature success threshold, feature degradation keeps requests alive when no provider supports the full requested feature set, and cache-affinity routing prefers providers where your actor already has cached tokens.
In addition to OpenAI Chat Completions compatibility, Concentrate exposes a first-class Responses API and an Anthropic-compatible Messages API, so you can pick whichever request format best fits your client.For the full catalog and current rates, see our Model Fortress.

Troubleshooting

OpenRouter and Concentrate use different model slugs. Call GET /v1/models to see the exact identifier, or check the Model Fortress.
Concentrate keys start with sk-cn. If you are still sending an sk-or-... key you will see a 401. Verify the value in your dashboard and confirm there are no extra spaces or quotes in the environment variable.
Confirm the base URL is https://api.concentrate.ai/v1 (note: no /api segment). Test the connection manually:
curl https://api.concentrate.ai/v1/responses/health

Next Steps

API Reference

Explore the full API capabilities

Available Models

Browse all supported models

Auto Routing

Optimize model selection automatically

Get Support

Contact our support team

Feedback

If you hit anything that didn’t translate cleanly from OpenRouter, email support@concentrate.ai. We use migration friction reports to prioritize compatibility fixes.