Flireo AI
WebsiteLinkedin
WebsiteLinkedin
  1. Api's
  • API Reference
    • Agents
      • List all agents
      • Create a new agent
      • Get an agent
      • Update an agent
      • Delete an agent
    • Tool Templates
      • List all tool templates
      • Create a new tool template
      • Get a tool template
      • Update a tool template
      • Delete a tool template
    • Numbers
      • List all phone numbers
      • Register a phone number
      • Get a phone number
      • Update a phone number
      • Delete a phone number
    • Calls
      • List calls
      • Get call by ID
      • Initiate outbound call
    • Call Control
      • Send control command to active call
    • Usage
      • Get usage logs
    • SIP Trunks
      • List SIP trunks
      • Create a SIP trunk
      • Get a SIP trunk
      • Delete a SIP trunk
    • Voices
      • List available voices
    • BYOK
      • Get BYOK configurations
      • Add BYOK configuration
      • Delete BYOK configuration
      • Get BYOK provider configurations
    • Domains
      • Get your domain
      • Add a domain
      • Delete your domain
      • List available Resend domains
      • Select and sync a Resend domain
      • Verify domain DNS records
      • Refresh domain status
    • Webhooks
      • Dynamic assistant configuration webhook
      • Tool/Function Call
      • Call Status Update
      • End of Call Report
    • Analysis Templates
      • List analysis templates
      • Create analysis template
      • Get analysis template
      • Update analysis template
      • Delete analysis template
    • Organization
      • Get organization information
    • Campaigns
      • List all campaigns
      • Create a campaign
      • Get a campaign
      • Update a campaign
      • Delete a campaign
      • List campaign leads
      • Add a lead
      • Remove a lead
  • Documentation
    • Get started
      • Quickstart
      • Introduction
      • Authentication
    • Core concepts
      • Agents
      • Phone numbers
      • Calls
      • Webhooks
    • Api's
      • Organization
      • Agents
      • Phone numbers
      • Sip trunks
      • Calls
      • Call control
      • Usage
      • Voices
      • BYOK
      • Domains
      • Analysis templates
      • Tool templates
    • Webhooks
      • Overview
      • Assistant request
      • Tool calls
      • Status update
      • End of call report
      • Security
    • Guides
      • BYOK Setup
      • Call analysis
      • Custom Tools
      • Call Transfers
      • xAI Realtime Integration
      • Analysis templates
      • Billing
      • Error codes
      • Rate limits
      • Sip Trunks
      • Tool templates
      • Troubleshooting
WebsiteLinkedin
WebsiteLinkedin
  1. Api's

BYOK

Bring Your Own Key (BYOK) allows you to use your own API keys for AI providers, giving you direct control over costs and configuration.

Endpoints#

MethodEndpointDescription
GET/byokGet BYOK configurations
POST/byokAdd BYOK configuration
DELETE/byokDelete BYOK configuration
GET/byok/configGet provider configurations

Supported Providers#

ProviderCategoryDescription
deepgramSTTSpeech-to-Text (transcription)
openaiLLMLarge Language Model (GPT)
elevenlabsTTSText-to-Speech
xaiRealtime VoicexAI Realtime Voice API
resendEmailEmail notifications
INFO
All API keys are securely stored in Supabase Vault. Only vault secret IDs are stored in the database.

Get BYOK Configurations#

Retrieve all configured BYOK providers and their configurations for your organization.
GET /byok

Request#

Response#

{
  "byok_keys": {
    "deepgram_secret_id": "vault-secret-id-1",
    "openai_secret_id": "vault-secret-id-2",
    "elevenlabs_secret_id": null,
    "xai_secret_id": null,
    "resend_secret_id": null
  }
}
Response Fields:
byok_keys - Object containing vault secret IDs for each provider
A non-null value indicates the provider has an API key configured
Null values mean no key is configured for that provider
WARNING
The actual API keys are never returned - only the vault secret IDs. This ensures your keys remain secure.

Add BYOK Configuration#

Add or update a BYOK API key. The key is securely stored in Supabase Vault.
POST /byok

Request Body#

FieldTypeRequiredDescription
providerstringYesProvider ID: deepgram, openai, elevenlabs, xai, or resend
api_keystringYesAPI key for the provider

Example Request#

Response#

{
  "success": true,
  "byok_keys": {
    "deepgram_secret_id": "vault-secret-id-1",
    "openai_secret_id": "vault-secret-id-new",
    "elevenlabs_secret_id": null,
    "xai_secret_id": null,
    "resend_secret_id": null
  }
}
INFO
If a key already exists for the provider, it will be replaced. The old secret is automatically deleted from the vault.

Delete BYOK Configuration#

Remove a BYOK configuration and delete the secret from Vault.
DELETE /byok

Request Body#

FieldTypeRequiredDescription
providerstringYesProvider to remove

Example Request#

Response#

{
  "success": true,
  "byok_keys": {
    "deepgram_secret_id": "vault-secret-id-1",
    "openai_secret_id": null,
    "elevenlabs_secret_id": null,
    "xai_secret_id": null,
    "resend_secret_id": null
  }
}

Get Provider Configurations#

Retrieve metadata about available BYOK providers and their supported models.
GET /byok/config

Request#

Response#

{
  "providers": [
    {
      "id": "deepgram",
      "name": "Deepgram",
      "category": "stt",
      "docsUrl": "https://developers.deepgram.com/",
      "models": [
        { 
          "id": "nova-3-general", 
          "name": "Nova 3 General", 
          "default": true 
        }
      ]
    },
    {
      "id": "openai",
      "name": "OpenAI",
      "category": "llm",
      "docsUrl": "https://platform.openai.com/docs",
      "models": [
        { 
          "id": "gpt-4o-mini", 
          "name": "GPT-4o Mini", 
          "default": true 
        },
        { 
          "id": "gpt-4o", 
          "name": "GPT-4o", 
          "default": false 
        }
      ]
    },
    {
      "id": "elevenlabs",
      "name": "ElevenLabs",
      "category": "tts",
      "docsUrl": "https://elevenlabs.io/docs",
      "models": [
        { 
          "id": "eleven_flash_v2_5", 
          "name": "Flash v2.5", 
          "default": true 
        }
      ]
    },
    {
      "id": "xai",
      "name": "xAI",
      "category": "realtime",
      "docsUrl": "https://docs.x.ai/docs",
      "models": [
        {
          "id": "grok-beta-realtime",
          "name": "Grok Beta Realtime",
          "default": true
        }
      ],
      "voices": [
        { "id": "alloy", "name": "Alloy" },
        { "id": "echo", "name": "Echo" },
        { "id": "shimmer", "name": "Shimmer" }
      ]
    },
    {
      "id": "resend",
      "name": "Resend",
      "category": "email",
      "docsUrl": "https://resend.com/docs",
      "models": []
    }
  ]
}
Response Fields:
providers - Array of available BYOK providers
id - Provider identifier used in API calls
category - Provider category (stt, llm, tts, realtime, email)
docsUrl - Link to provider's official documentation
models - Available models for the provider (if applicable)
voices - Available voices (only for xAI Realtime)

Usage with Agents#

Once you configure a BYOK key, you can reference it in agent configurations:
{
  "name": "My Agent",
  "llm_provider": "openai",
  "model": "gpt-4o",
  "tts_provider": "elevenlabs",
  "tts_model": "eleven_flash_v2_5"
}
The system automatically uses your BYOK keys when:
1.
A provider is configured in BYOK
2.
An agent specifies that provider
TIP
This allows you to:
Control costs directly with your provider
Use custom models or voices
Track usage in your provider dashboard
Comply with data residency requirements

Security Notes#

API keys are stored in Supabase Vault, not in the database
Only vault secret IDs are stored in the database
Keys are encrypted at rest and in transit
Deleting a BYOK config permanently removes the secret from Vault
Each organization's keys are isolated and cannot be accessed by others

Related Endpoints#

Agents API - Configure agents to use BYOK providers
Calls API - Start calls with BYOK-enabled agents
Usage API - Track usage across BYOK and standard providers
Modified at 2025-12-29 14:17:32
Previous
Voices
Next
Domains
Built with