Set BYOK Key

Add or update a BYOK provider API key

Set BYOK Key

Store an encrypted API key for a provider. When set, the platform uses your key for all requests to that provider (zero token cost from us).

Request

POST /byok/set
Authorization: Bearer {token}
Content-Type: application/json
{
  "provider": "openai",
  "api_key": "sk-proj-..."
}

Parameters

FieldTypeRequiredDescription
providerstringYesProvider ID (e.g., openai, anthropic, groq)
api_keystringYesYour API key for the provider

Response

{
  "success": true,
  "message": "OpenAI API key saved"
}

Billing Impact

When you add a BYOK key for a provider:

  • Token cost from us: ₹0 — you pay the provider directly
  • Platform fee still applies: ₹1.50/min voice, ₹0.50/msg chat
  • GST: Already collected at wallet topup (not charged again)

Security

  • Keys are encrypted at rest using Fernet symmetric encryption
  • Keys are decrypted only at call time and never logged
  • Only masked keys are returned via API (last 4 characters)

On this page