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
- Go to Dashboard → My API Keys
- Click a provider from Quick Add (OpenAI, Groq, etc.) or enter a custom API slug
- Paste your provider API key
- 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-chatAuth 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 proxyPriority Order
- Your BYOK key (if set for this API)
- apitree system key (if configured by admin)
- No-auth call (for free/public APIs)