Create a BYOK provider credential
Changed onCreate a new bring-your-own-key (BYOK) provider credential. The raw key is encrypted at rest and never returned in API responses. When workspace_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. 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.
Request
- Base URL: https://openrouter.ai/api/v1
- URL: https://openrouter.ai/api/v1/byok
- Auth: HTTP bearer
Request body
Example request
{
"key": "sk-proj-abc123...",
"name": "Production OpenAI Key",
"provider": "openai"
}Response
BYOK credential created successfully
Example response
{
"data": {
"allowed_api_key_hashes": null,
"allowed_models": null,
"allowed_user_ids": null,
"created_at": "2025-08-24T10:30:00Z",
"declared_region": null,
"declared_zdr": null,
"disabled": false,
"id": "11111111-2222-3333-4444-555555555555",
"is_byok_only": false,
"is_fallback": false,
"is_required": false,
"label": "sk-...AbCd",
"name": "Production OpenAI Key",
"provider": "openai",
"sort_order": 0,
"workspace_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Changes
- info
added the new optional request property
- info
added the required property
/////to the response with the status
- info
- warning
added the new
elevenlabsenum value to the/////response property for the response status - info
added the new
elevenlabsenum value to the request property
- warning