Find a model

Browse the full catalog →

Bring your own upstream provider key

BYOK lets TrustedRouter use a provider credential from your workspace for inference. Your upstream provider account supplies the key; your TrustedRouter key authenticates requests to TrustedRouter. Uploaded secrets are encrypted, and responses return key metadata and hints rather than the secret.

Management base URL: https://trustedrouter.com/v1. BYOK registration and workspace/key management belong to the control plane. https://api.trustedrouter.com/v1 serves inference; management calls there return 404 because the services are separated. The compatibility endpoints /v1/byok and /v1/byok/{id} are unsupported stubs; use /v1/byok/providers below.

Authenticate management calls with Authorization: Bearer $TRUSTEDROUTER_MANAGEMENT_KEY, using a management key for the workspace (or a signed-in management session). An inference key or delegated scope does not grant management access. Wallet-only accounts cannot register provider credentials; use an account eligible for BYOK registration.

List providers

curl https://trustedrouter.com/v1/byok/providers \
  -H "Authorization: Bearer $TRUSTEDROUTER_MANAGEMENT_KEY"

GET /v1/byok/providers/{provider} returns one configured provider. Choose a provider that supports BYOK; the provider slug must match the catalog.

Set a provider key

curl -X PUT https://trustedrouter.com/v1/byok/providers/openai \
  -H "Authorization: Bearer $TRUSTEDROUTER_MANAGEMENT_KEY" \
  -H "Content-Type: application/json" \
  --data '{"api_key":"YOUR_UPSTREAM_OPENAI_KEY"}'

PUT /v1/byok/providers/{provider} stores the workspace's key for that provider, replacing any earlier one. It returns 201 when it creates the configuration and 200 when it replaces it, with the key's metadata under data. For Amazon Bedrock, Google Vertex, and Azure, send the provider-native credential object instead of a plain API key; see the request schemas in the OpenAPI specification.

Use BYOK at inference

Send inference to https://api.trustedrouter.com/v1 with a TrustedRouter inference API key from the same workspace. Do not send the upstream key as the bearer token. A configured provider's BYOK routes are eligible alongside credit routes. Set provider.usage: "byok" to restrict the request to BYOK.

curl https://api.trustedrouter.com/v1/chat/completions \
  -H "Authorization: Bearer $TRUSTEDROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{"model":"openai/gpt-4o","messages":[{"role":"user","content":"Hello"}],"provider":{"only":["openai"],"allow_fallbacks":false,"usage":"byok"}}'

Choose a current BYOK-capable model from the catalog. You can also require provider.min_privacy; see provider routing and privacy controls.

Delete a provider configuration

curl -X DELETE https://trustedrouter.com/v1/byok/providers/openai \
  -H "Authorization: Bearer $TRUSTEDROUTER_MANAGEMENT_KEY"

Deleting the provider removes its stored key. This does not revoke the credential at the upstream provider.

Workspace access

Sign in

Choose a sign in method to access your TrustedRouter workspace.

New to TrustedRouter?

By continuing you agree to the terms of service and privacy policy.