Overview
BYOK endpointsAvailable Operations
- List - List BYOK provider credentials
- Create - Create a BYOK provider credential
- Delete - Delete a BYOK provider credential
- Get - Get a BYOK provider credential
- Update - Update a BYOK provider credential
List
List the bring-your-own-key (BYOK) provider credentials for the authenticated entity’s default workspace, or a workspace-scoped management key’s own workspace. Use theworkspace_id query parameter to scope the result to a different workspace, or the provider query parameter to filter by upstream provider. A workspace-scoped management key can only list its own workspace; any other workspace_id returns 403. Management key required.
Example Usage
Parameters
Response
*operations.ListBYOKKeysResponse, errorErrors
Create
Create a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. Whenworkspace_id is omitted, the credential is created in the default workspace; if that default has been deleted, the request returns a 400 and you must pass workspace_id explicitly. A workspace-scoped management key creates the credential in its own workspace when workspace_id is omitted, and any other workspace_id returns 403. Treat the raw key as write-only; it is never returned after creation. Use allowed_api_key_hashes to restrict the credential to specific OpenRouter API keys. Management key required.
Example Usage
Parameters
Response
*components.CreateBYOKKeyResponse, errorErrors
Delete
Delete (soft-delete) a bring-your-own-key (BYOK) provider credential by itsid. The encrypted key material is wiped and the record is marked as deleted. A workspace-scoped management key only reaches credentials in its own workspace; any other id returns 404. Management key required.
Example Usage
Parameters
Response
*components.DeleteBYOKKeyResponse, errorErrors
Get
Get a single bring-your-own-key (BYOK) provider credential by itsid. A workspace-scoped management key only reaches credentials in its own workspace; any other id returns 404. Management key required.
Example Usage
Parameters
Response
*components.GetBYOKKeyResponse, errorErrors
Update
Update an existing bring-your-own-key (BYOK) provider credential by itsid. Include the key field to rotate the raw provider API key in-place (the previous key material is overwritten). Use allowed_api_key_hashes to restrict the credential to specific OpenRouter API keys (null clears the restriction). A workspace-scoped management key only reaches credentials in its own workspace; any other id returns 404. Management key required.