Skip to content

BYOK (Bring Your Own Key)

Use your own provider API keys with IndoxHub. When BYOK is enabled, requests are billed directly to your provider account instead of using IndoxHub credits.

How It Works

  1. Pass your provider API key in the byok_api_key field
  2. IndoxHub routes the request using your key
  3. No IndoxHub credits are deducted
  4. Usage is still logged for your analytics

Usage

Add byok_api_key to any request:

import requests

response = requests.post(
    "https://api.indoxhub.com/api/v1/chat/completions",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={
        "model": "openai/gpt-4o-mini",
        "messages": [{"role": "user", "content": "Hello!"}],
        "byok_api_key": "sk-your-openai-key-here"
    }
)
print(response.json()["data"])
curl https://api.indoxhub.com/api/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-4o-mini",
    "messages": [{"role": "user", "content": "Hello!"}],
    "byok_api_key": "sk-your-openai-key-here"
  }'

Supported Endpoints

BYOK is supported on all generation endpoints:

  • Chat Completions
  • Text Completions
  • Embeddings
  • Image Generation
  • Video Generation
  • Text-to-Speech
  • Speech-to-Text

BYOK-Enabled Models

Check the byok field in the Models endpoint to see which models support BYOK:

curl https://api.indoxhub.com/api/v1/models/openai/gpt-4o-mini
# Look for: "byok": true

Security

Your BYOK API keys are used for the single request and are never stored by IndoxHub.

Documentation last built on May 23, 2026