In short.
OpenRouter's Python BYOK reference is for developers automating management of their own model-provider keys, but adding a key alone does not prevent use of shared provider capacity. Its five operations cover the credential lifecycle, with restrictions by workspace, OpenRouter API key, model and user. Separate routing flags control shared-capacity use, exclusivity and fallback. Region and zero data retention declarations are not verified by OpenRouter. Pricing, SDK version compatibility and runtime reliability are unknown; no examples were executed.
Researched and written by an AI model and checked by a second AI model. How it works
Covers the complete documentation page at the exact supplied URL, including all five operations, examples, parameters and listed errors. Linked pages, the documentation index, response-schema definitions and SDK implementation are excluded. No licence notice appears in the supplied page. Examples and runtime behavior were not tested; pricing, implementation security and release compatibility remain unknown.
The overview
Identity
This is the BYOK, or bring-your-own-key, API reference within OpenRouter's Python SDK documentation. It explains how to manage upstream provider credentials through open_router.byok. The source is [https://openrouter.ai/docs/client-sdks/python/sdks/byok/README.md].
The resource is a documentation page containing method examples and parameter descriptions. It does not include the SDK implementation or a complete model-request tutorial.
Assessment
This is useful when an application needs to automate provider-credential administration inside OpenRouter. Its strongest material explains the differences between routing controls that might otherwise look interchangeable.
It provides enough detail to plan credential-management calls, but installation instructions, response schemas and management-key issuance are not included. Documented behavior has not been independently verified.
Users
The documented operations suit Python backend developers and platform administrators who provision credentials, rotate secrets or restrict which applications and team members may use them. Workspace-scoped access is particularly relevant when credentials must remain separated between workspaces.
Beginners will need familiarity with Python imports, environment variables and authenticated API calls. This page does not teach those foundations.
Capabilities
The reference documents list, create, get, update and delete. Listing supports workspace and provider filters, offset pagination and a limit of at most 100 records; the example follows additional pages with res.next().
Credentials can have names, disabled status and allowlists for OpenRouter API-key hashes, model slugs and user IDs. Updates can rotate the provider key in place. Additional fields govern fallback, shared capacity, exclusive routing, declared processing region and declared zero data retention.
Using it
Requirements
All five operations require an OpenRouter management key. Creating a credential additionally requires the raw upstream provider credential and a lowercase provider slug. Reading, updating and deleting individual credentials require their credential IDs.
A workspace-scoped management key can administer only its own workspace. With an organization management key, listing and creation default to the account's default workspace; if that workspace was deleted, these requests require an explicit workspace_id or return 400. Supported Python versions, SDK releases and installation dependencies are unspecified.
Mechanism
According to the page, raw provider credentials are encrypted at rest and never returned in API responses. Supplying key during update overwrites the previous key material. Deletion wipes the encrypted material and marks the credential record deleted; upstream provider-key revocation is not described.
For the credential's provider, is_required removes shared endpoints for the models the credential applies to. is_byok_only removes that provider's shared endpoints for every model, including models outside its allowlist and after its keys fail. The provider is then skipped instead of using OpenRouter credits on its shared capacity. is_fallback tries a credential after non-fallback keys for the same provider.
is_exclusive confines covered requests to eligible exclusive credentials. Overlapping exclusive credentials can serve the same model. If no exclusive credential is eligible for a request, normal routing applies; if an eligible exclusive credential covers the model but none can serve it, the request returns 404.
Without a nonempty model allowlist, exclusive OpenAI, Anthropic and Google credentials cover that lab's closed-weight models. Open-weight models require explicit listing, and other providers need a nonempty model allowlist. Both is_exclusive and is_byok_only are restricted to non-fallback credentials.
Setup
The examples import OpenRouter from openrouter, read OPENROUTER_API_KEY from the environment and open a client using a context manager. That client must authenticate with a management key, as required by each operation, despite the environment variable's general name.
For creation, supply the provider credential and provider slug, then choose the workspace and restrictions deliberately. The page supplies no package-installation command or instructions for obtaining management keys. App URL, title and category metadata are optional.
Example
The documented creation example calls open_router.byok.create(key="sk-proj-abc123...", provider="openai", name="Production OpenAI Key"). The key value is a placeholder for an upstream provider credential; the client separately uses an OpenRouter management key.
This call creates a stored credential. Its example does not set model, user or API-key restrictions, or enable the flags that exclude shared capacity. It does not send a model request, and it was not executed.
Assessment & evidence
Limitations
declared_region and declared_zdr describe the upstream account's claimed settings; OpenRouter does not verify those declarations. A null ZDR declaration inherits the endpoint's data policy, true can make the credential eligible for ZDR-required requests, and false excludes it from those requests. These settings do not provide independent proof of actual retention practices.
Regional eligibility has exclusions for private endpoints, endpoints pinned to another cloud region, cross-region inference profiles and video models. OpenAI and Fireworks declarations must match the region in the key material; Azure accepts europe or us, while Anthropic accepts us only.
API-key allowlists must contain at least one hash when supplied and generally require account and workspace membership. Update permits retaining already-listed keys that subsequently moved workspaces. Detailed response schemas, security implementation, performance and runtime reliability were not assessed.
Reasoning
The documented workspace boundaries, allowlists and in-place rotation suggest a useful fit for centrally administered applications. This is an inference from the available controls, rather than evidence of operational reliability.
The main implementation decision is which routing behavior the application needs. Preventing shared-capacity use for one provider differs from restricting a covered model to exclusive credentials. Confusing those settings could permit unwanted shared routing or produce a documented 404 instead of the expected fallback.
Alternatives
Within this feature, ordinary BYOK routing and fallback credentials are options when shared capacity remains acceptable. is_required, is_byok_only and is_exclusive address different restrictions on model and provider routing.
The page does not compare other gateways, direct provider SDKs or credential-management interfaces. Their relative features, costs and suitability are unknown from this source.
Evidence
The source is the complete BYOK reference at [https://openrouter.ai/docs/client-sdks/python/sdks/byok/README.md], identified by source revision sha256:7e4a1565d1e560e2f6343a477d719dd9ed4b3b9ada68d567682f05e9da39d0a9. Its method descriptions, examples and parameter tables support the descriptions of documented behavior.
Linked authentication guides, provider definitions and response schemas are outside this page and were not assessed. No SDK code or examples were executed, and no service responses, benchmarks or independent security findings are available.
Access & freshness
Costs
The page provides no prices, BYOK fees, free allowance or billing calculation. Total operating cost and any savings are unknown.
It explicitly describes is_byok_only as skipping a provider instead of spending OpenRouter credits on that provider's shared endpoints. This is a provider-routing control; the page does not establish an account-wide spending limit or eliminate other possible charges.
Rights
The page does not state a documentation licence or SDK licence. Permission to redistribute the documentation or reuse SDK code is not established by this source.
Provider-account terms and permissions for using particular models are also unspecified. Credential-management access does not establish those rights.
Freshness
The source snapshot was captured at 2026-11-24T00:51:09.994Z. This is a capture timestamp, not a publication or update date.
The page names no SDK release or documentation revision date. Compatibility with a particular installed package and changes after capture are unknown.
Actions
Confirm the installed SDK's method signatures, obtain a management key and identify the intended workspace. Consider creating an initial credential in a disabled state with explicit model, API-key and user restrictions, then inspect its configuration before enabling it.
Choose shared-capacity and exclusivity settings according to the required failure behavior. Before relying on them, verify key-failure and overlapping-exclusive-credential behavior in your own environment. Confirm region and retention settings with the upstream provider, and obtain pricing and licence information separately.
