- BYOK mode
- Config-driven
Prerequisites
A Concentrate AI account with an active API key
sk-cn-v1-.An existing Portkey integration
portkey-ai SDK, fetch, requests, or another HTTP client (in BYOK or Config-driven mode).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 Portkey usage, stripsx-portkey-* headers, decomposes Configs, maps model slugs, and generates a verification script. Drop the skill into your ~/.claude/skills/ directory:
/migrate-portkey. Claude will load the skill and run the steps.
Step 1: Update Your Environment Variables
Replace your Portkey key and any upstream provider keys with a single Concentrate key:Step 2: Update Your Client
The two big changes are the base URL and stripping everyx-portkey-* header. If you were using the portkey-ai SDK, swap to the OpenAI SDK pointed at Concentrate. Concentrate does not ship a dedicated SDK because the OpenAI-compatible shape covers every endpoint.
Step 3: Remove x-portkey-* Headers
None of Portkey’s custom headers carry over to Concentrate, so they should come out. They’re dead weight in your client config and mislead future readers. Expand the tables below for the full mapping if any of these are in your code.
Request header mapping
Request header mapping
`portkey-ai` SDK parameter equivalents
`portkey-ai` SDK parameter equivalents
portkey-ai SDK, the snake_case (Python) or camelCase (Node) parameters map to the same headers above:Response header mapping
Response header mapping
Step 4: Decompose Your Portkey Config
Portkey’sx-portkey-config bundles caching, fallbacks, load balancing, retries, conditional routing, and timeouts into a single saved or inline object. Concentrate does not have a Config primitive. Each behavior is either on by default or expressed as a body param on the request. Expand the table below for the full mapping.
Config key mapping
Config key mapping
Step 5: 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.
gpt-4o or claude-sonnet-4-6 and provider selection via x-portkey-provider or a Virtual Key, drop the header and let the model slug carry provider intent. Most Portkey model strings work as-is once you remove the provider header.
One thing to know about the slashed form: the prefix is the provider that serves the request, not the model’s author.
Portkey customers steering through x-portkey-provider: bedrock (or a Bedrock Virtual Key) with model: "claude-sonnet-4-6" should switch to model: "bedrock/claude-haiku-4-5" (or whichever slug GET /v1/models returns). For most popular names the two are the same string (openai, anthropic, mistral), but they diverge whenever a model is hosted by something other than its author:
provider/ prefix when you specifically want to pin to one host (for ZDR compliance, contractual reasons, or latency in a specific region).
The only universally required slug change is auto-routing:
provider/model-id pairs, call GET /v1/models or browse the Model Fortress.
Step 6: Reconnect Observability
Concentrate’s dashboard covers the major surfaces you used in Portkey.Exporting your Portkey history
Portkey’s dashboards do not import into Concentrate, and the reverse is also true. Historical request logs stay where they were created. If your migration is driven by compliance or audit requirements, Portkey exposes Log Exports via their Admin API; pull your history out before deprovisioning your Portkey workspace.Step 7: Migrate Admin and Governance Surface
Portkey’s Admin API (Workspaces, Virtual Keys, Configs, Prompts, Policies, SCIM mappings) maps roughly to Concentrate’s organization/team/key hierarchy plus dashboard-managed settings rather than a separate API surface.Step 8 (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, andprevious_response_id replaces Portkey’s trace_id-grouped sessions with a server-managed conversation tree.
Why migrate to Concentrate
How it works
How it works
- BYOK mode. Point the OpenAI SDK at
https://api.portkey.ai/v1, setx-portkey-api-key, and pass your own provider key viaAuthorization(withx-portkey-provider: openai) or a stored Virtual Key (x-portkey-virtual-key, orx-portkey-provider: @provider-slug). Migrating here gets you off provider keys entirely. - Config-driven mode. Use
x-portkey-configto reference a saved or inline JSON config covering caching, fallbacks, load balancing, retries, and timeouts. Decompose the Config: most settings become Concentrate body params or are handled automatically. See Step 4.
Team-scale spend management
Team-scale spend management
Feature-aware resiliency
Feature-aware resiliency
routing.model.fallbacks, routing.provider.fallbacks), Concentrate’s routing layer ships:- Uptime gate. Providers whose per-feature success rate drops below 90% are skipped.
- Feature degradation. If no provider supports the full requested feature set (e.g.
json_schema), the request is downgraded tojson_objector text instead of failing. - Cache-affinity routing. When multiple providers can serve a request, the one where your actor already has cached tokens is preferred.
Strategy-driven auto routing
Strategy-driven auto routing
model: "auto" accepts an explicit optimization target via routing.model.sort: cost, latency, or performance (default). See Auto Routing.Native Responses and Messages APIs
Native Responses and Messages APIs
Managed provider credentials by default
Managed provider credentials by default
Troubleshooting
Model not found
Model not found
gpt-4o, claude-haiku-4-5) and provider/model-id slugs both work. If you’re using a provider/ prefix and getting a miss, double-check the prefix is a provider (e.g. bedrock, azure, ai-studio) and not just the author (e.g. meta, google). Call GET /v1/models for the authoritative list.Invalid API key error
Invalid API key error
sk-cn-v1-. If you are still sending a Portkey x-portkey-api-key value (or an upstream provider key from BYOK mode) as the Authorization bearer, you will see a 401. Verify the value in your dashboard and confirm there are no extra spaces or quotes.Requests succeed but nothing shows up in the Concentrate dashboard
Requests succeed but nothing shows up in the Concentrate dashboard
https://api.concentrate.ai/v1, not api.portkey.ai. If the SDK is still pointed at Portkey it is logging against your Portkey workspace, not Concentrate.My metadata filters stopped working
My metadata filters stopped working
_user, _environment, and _organisation map to the key/team/org hierarchy. Issue a separate key per user or environment and analytics roll up automatically. Custom metadata keys have no equivalent today.My Config-based routing stopped applying
My Config-based routing stopped applying
x-portkey-config is a no-op on Concentrate. Express fallbacks via routing.model.fallbacks / routing.provider.fallbacks body params, or use model: "auto" with a routing strategy. Conditional routing by metadata has no direct equivalent. Handle in application code.Cache hit rate dropped after migrating
Cache hit rate dropped after migrating
simple and semantic cache modes do not carry over. Caches are seeded per API key by default; pass prompt_cache_key in the request body if you want to set the seed explicitly (the analog of x-portkey-cache-namespace).Connection errors
Connection errors
https://api.concentrate.ai/v1 (no /api segment, no per-provider subdomain). Test the connection manually: