Set up BYOK
1
Create a provider key
POST /provider_keys with a name, the provider (openai or anthropic) and the secret. The secret is accepted only on create and is never returned by any response, list or idempotent replay.GET /provider_keys lists provider keys and GET /provider_keys/{id} reads one; neither shows the secret.2
Attach the key to a group
Reference the provider key in the group’s
provider_key_ids, and include the BYOK models you want in allowed_models. A group holds at most one key per provider, the key’s provider must match at least one BYOK model the group allows, and the key and group must be in the same account.Set both when creating a group, or update an existing group with an ETag-protected PATCH. allowed_models is replaced as a whole, so include every model the group should keep:3
Call models with the LTG token key
Applications keep using their
ltg_sk_ token key exactly as before. Never place the provider secret in SDK configuration or application code. Call BYOK models on /v1/chat/completions; Anthropic BYOK models also work on /v1/messages with the Anthropic SDK.503 and code enforcement_unavailable. They never fall back to a Telnyx-hosted model.
Billing and reporting
- Requests on BYOK models are billed by your provider on your provider account, not by Telnyx.
- LTG budgets and rate limits still apply.
- Usage reporting records every BYOK request. Its
costis the budget reference valuation, not a Telnyx charge.
Rotate a provider secret
Provider keys cannot be edited;PATCH returns 405. To change a secret, create a new provider key, attach it to each group in place of the old one, then delete the old provider key.
Delete a provider key
DELETE /provider_keys/{id} requires the provider key’s current ETag in If-Match. Read the key first to get it:
503 until another key for the provider is attached.