Skip to main content
POST
/
byok
/
set
curl -X POST https://api.thinnest.ai/byok/set \
  -H "Authorization: Bearer $THINNESTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "provider": "openai",
  "api_key": "sk-proj-..."
}'
{
  "success": true,
  "message": "OpenAI API key saved"
}
curl -X POST https://api.thinnest.ai/byok/set \
  -H "Authorization: Bearer $THINNESTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "provider": "openai",
  "api_key": "sk-proj-..."
}'

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)

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
provider
string
required
api_key
string
required

Response

Successful Response