Skip to main content

Bring Your Own Key (BYOK)

Use your own API keys for providers like OpenAI, Anthropic, and Groq through apitree. You get caching, monitoring, MCP integration, and health tracking — without sharing credentials with apitree.

How It Works

  1. Go to Dashboard → My API Keys
  2. Click a provider from Quick Add (OpenAI, Groq, etc.) or enter a custom API slug
  3. Paste your provider API key
  4. Call the API through apitree proxy — your key is injected automatically

API Endpoint

# Add a key
POST /api/v1/byok
{
  "apiSlug": "openai-chat",
  "providerName": "OpenAI",
  "keyValue": "sk-...",
  "authMethod": "bearer"
}

# List your keys (masked)
GET /api/v1/byok

# Remove a key
DELETE /api/v1/byok/openai-chat

Auth Methods

  • bearer — Key sent as Authorization: Bearer <key> (default, most APIs)
  • header — Key sent as custom header (e.g., X-API-Key)
  • query — Key appended as query parameter

SDK Usage

// After adding your OpenAI key via BYOK:
const apitree = new ApitreeClient('nxs_live_YOUR_KEY');
const result = await apitree.call('openai-chat', {
  messages: [{ role: 'user', content: 'Hello' }]
}, { method: 'POST' });
// → Uses YOUR OpenAI key, through apitree proxy

Priority Order

  1. Your BYOK key (if set for this API)
  2. apitree system key (if configured by admin)
  3. No-auth call (for free/public APIs)
apitree · AI-Native API Marketplace