← All posts

BYOK: Why Enterprise Teams Should Control Their Own LLM Keys

When you sign up for most enterprise AI SaaS tools, you agree to a pricing plan, connect your data sources, and start using the platform. What you don't see is the economic structure underneath: the vendor is calling OpenAI, Anthropic, or Google on their API account, paying model costs at scale, marking them up by 2x to 5x, and embedding that markup in your monthly bill as a line item called "AI usage" or "token credits" or simply absorbed into the seat price.

You're paying for the model access. You're just not in control of it - which provider they use, which model version they call, whether they pass your data through without logging it, and what happens to your context when their API contract changes. Most teams accept this without examining it closely because the alternative seems complex: manage your own API keys, worry about rate limits, handle billing separately.

BYOK - Bring Your Own Keys - changes this arrangement. It means you connect your own API keys for the LLM providers you use, and the platform routes your requests through your account. You pay the model costs directly. You control which model runs. Your data flows through your API account, not through the vendor's. The platform provides the orchestration, the agent infrastructure, the Skills, the Clusters - but not the model access, which stays under your control.

This distinction sounds operational but has significant implications for cost, compliance, and strategic flexibility. Here's why enterprise teams increasingly require it.

What BYOK Means in Practice

In a BYOK-enabled platform, you configure API keys for one or more LLM providers in your platform settings. In Thren, that means connecting keys for OpenAI, Anthropic, Google Gemini, Vertex AI, Azure OpenAI, Groq, or Amazon Bedrock - or any combination. The platform routes model calls through LiteLLM, a unified LLM abstraction layer, which means you can use multiple providers simultaneously and switch between them without changing anything in your agent configurations.

The key management side is handled with Fernet symmetric encryption. Your API keys are encrypted at rest in Thren's database - the platform never stores them in plaintext. When a model call is made, the key is decrypted in memory for the duration of the call and never written back to disk unencrypted. This is the same key management pattern used by password managers and secrets management systems.

From a user experience perspective, BYOK is invisible after initial setup. Team members run agent sessions, build automations, generate documents - all the same. The difference is that the model calls are being billed directly to your OpenAI or Anthropic account, the data is flowing through your API subscription, and you can see exactly what's being used in your API dashboard.

Supported Providers

BYOK in Thren: 6+ Provider Support via LiteLLM

Thren supports BYOK for: OpenAI (GPT-4o, GPT-4 Turbo, o3), Anthropic (Claude Sonnet, Claude Opus), Google (Gemini 1.5 Pro, Gemini Flash), Vertex AI, Azure OpenAI, Groq, and Amazon Bedrock. You can configure a default model for the org and allow teams to override for specific use cases.

Reason One: Cost Visibility and Control

The financial case for BYOK is straightforward: API access to the frontier models is significantly cheaper than the marked-up pricing most SaaS platforms embed in their per-seat or per-usage tiers.

To make this concrete: GPT-4o costs approximately $2.50 per million input tokens and $10 per million output tokens at direct API pricing. A team running a hundred detailed agent sessions per day might consume roughly 50 million tokens per month. At direct API pricing, that's $125-500 per month in model costs, depending on the input/output ratio. A SaaS platform that marks up 3x and buries it in a $100-per-seat plan for a 20-person team is charging $2,000 per month in "seat fees" against the same underlying model cost.

These numbers vary substantially by usage pattern. Teams that primarily run short sessions with small context windows will see much lower model costs than teams running deep research workflows with large context payloads. The point is not the exact number - it's the visibility. Without BYOK, you don't know what the actual model cost is, which means you can't optimize it, allocate it to departments, or evaluate whether it's proportionate to the value produced. With BYOK, model cost appears as a line item in your API dashboard, attributable to actual usage.

For finance and procurement teams, this visibility also changes the contract conversation. Instead of negotiating a black-box seat price with an AI vendor, you negotiate a platform fee (for the orchestration, agents, clusters, and skills) separately from the model cost (which you control directly). These are structurally different purchases that should be evaluated differently - and BYOK enables that separation.

Reason Two: Data Residency and Compliance

The second reason enterprises care about BYOK is data residency. When you use an AI SaaS platform without BYOK, your data - customer records, internal documents, email content, Slack messages, Salesforce opportunities - flows through the vendor's API account to the LLM provider. You have the vendor's privacy policy, which tells you what they promise to do. You may not know what they actually do.

With BYOK, the data flow changes materially. Your API keys mean your data goes from Thren's infrastructure directly to OpenAI's or Anthropic's API under your account's terms of service. The SaaS vendor orchestrates the request but doesn't see the content - your key is used to authenticate your account, and the API response comes back to the platform. The vendor processes metadata (which model was called, how many tokens, when) but not the content.

This matters for specific regulatory contexts. HIPAA covered entities need to be able to demonstrate that PHI doesn't flow through unauthorized third parties. GDPR-regulated companies need to know where their EU residents' data goes. FedRAMP environments require audit trails of every system that processes sensitive data. SOC 2 audits will ask about data flows and who can see what.

BYOK doesn't automatically make a platform compliant with any of these frameworks - that depends on the full architecture, not just model key ownership. But it removes a class of compliance questions by ensuring that the entity with contractual access to your data is the LLM provider (with their own enterprise compliance certifications) rather than an intermediate SaaS vendor.

For teams evaluating multiple AI tools, the data residency question should be explicit: when I use this tool, which legal entities have access to my content? With BYOK, that answer is: the platform (for orchestration and metadata) and the LLM provider (for model inference). Without BYOK, the platform is also accessing model-level content, which adds a party to the audit scope.

Reason Three: Model Flexibility

The LLM landscape is moving fast. GPT-4's capabilities and pricing changed substantially across its release window. Claude's context window expanded from 100K to 200K tokens with significant implications for long-document workflows. Gemini 1.5 Pro introduced multimodal capabilities at scale. Groq introduced inference speeds that changed the viability of real-time agent workflows.

When you're locked into a SaaS vendor's model abstraction - where they choose which model to call and when - you're at the mercy of their upgrade schedule and model selection decisions. If they're running GPT-4 Turbo because they have a contract that makes it cheaper for them at scale, you may not be getting the best model for your use case. If they upgrade to a newer model version, you find out when something starts behaving differently, not when you choose to evaluate the upgrade.

With BYOK, model selection is under your control. You can run Claude Opus for deep analysis tasks where context quality matters most, Claude Haiku or GPT-4o Mini for high-volume classification tasks where speed and cost matter more, and GPT-4o for standard agent sessions where both performance and cost need to be balanced. You can experiment with a new model release on a subset of workflows before committing to it broadly. If a provider changes their pricing structure in a way that affects your team's cost profile, you switch models without waiting for a vendor decision.

For organizations with specific model requirements - a legal department that requires models with no training data retention, or a team that has negotiated an enterprise contract with a specific provider - BYOK is the only way to satisfy those requirements with a SaaS platform. Without it, you're using whatever model the vendor decided to use, under whatever data terms they have with that provider.

The Strategic Question

Vendor lock-in for AI tools doesn't look like traditional lock-in. It's not your data - you can export that. It's your model relationship: if the platform controls your LLM access, you lose the ability to negotiate directly with model providers, to use enterprise contracts you've already negotiated, and to move to a competing model without the platform's participation. BYOK keeps that relationship in your hands.

How Thren Handles BYOK

The BYOK configuration in Thren is handled at the organization level by an Admin or Owner. The process: navigate to org settings, select the LLM provider, enter the API key. The key is encrypted with Fernet symmetric encryption before storage. When a model call is made, the key is decrypted in memory for the duration of that specific call.

LiteLLM handles the abstraction layer between Thren's agent infrastructure and the various provider APIs. This means the same agent session configuration works regardless of which provider is selected - you don't rebuild your agent configurations when you switch from OpenAI to Anthropic. The platform handles the API format differences, the response schema normalization, and the error handling uniformly across providers.

Org Admins can set a default model for all agent sessions and automations, and individual Users with appropriate permissions can override the model for specific tasks. This allows a sensible default that works for most workflows while preserving the flexibility for power users to route specific tasks to the optimal model.

Usage is tracked and visible in the org's run history - which sessions ran, which model was called, how many tokens were consumed. This gives finance teams the attribution they need to understand AI spend without requiring them to dig through the LLM provider's raw API logs. The platform-level tracking and the API-level billing are separate but complementary views of the same usage.

What to Look For When Evaluating BYOK in AI Tools

Not all BYOK implementations are equivalent. Some platforms advertise BYOK but implement it in ways that don't actually deliver the data residency or cost control benefits. The questions to ask when evaluating:

  • How are keys stored? Plaintext storage of API keys is a security risk. Ask specifically what encryption standard is used for key storage and whether keys are ever logged.
  • Does the vendor's infrastructure proxy the model calls? True BYOK means the API call goes from the platform to the provider under your account. If the vendor's servers are in the middle of the model call (not just orchestrating it), your data is still flowing through their infrastructure.
  • Which providers are supported? A platform that only supports one provider via BYOK is limiting your model flexibility almost as much as no BYOK at all. Look for multi-provider support with a unified abstraction layer.
  • Is model selection granular? Org-level default model selection is useful. Task-level or session-level override is better. Ask whether you can route different workflow types to different models.
  • What happens to your data if you remove your keys? If the platform has been caching model outputs or storing context in ways that persist after key removal, that's worth understanding before you configure BYOK.

Enterprise Checklist for BYOK Adoption

For teams moving to a BYOK configuration in Thren or evaluating BYOK in any AI platform, this checklist covers the key steps:

1

Inventory your existing LLM contracts

If your organization already has enterprise agreements with OpenAI, Anthropic, Google Cloud, or Azure, those contracts likely include data retention commitments and pricing tiers that are more favorable than consumer API pricing. Use those keys for BYOK rather than creating new accounts.

2

Set rate limits and budget alerts on your API account

All major LLM providers support spending limits and usage alerts. Configure these before connecting keys to the platform, so you don't discover unexpected usage in a monthly invoice. A team suddenly running high-volume automations can generate significantly more model usage than expected.

3

Use scoped API keys, not root keys

Most providers allow you to create scoped API keys with specific permissions (e.g., inference only, no fine-tuning, no account modification). Use scoped keys for BYOK rather than your root account key. This limits the blast radius if a key is ever compromised.

4

Document the data flow for your compliance team

With BYOK configured, update your data flow documentation: content goes from Thren to [Provider] under your account. This is the documentation your SOC 2 auditors, GDPR DPO, or security review team will need to evaluate the configuration.

5

Start with one model, benchmark, then diversify

The initial temptation is to configure all six providers at once and optimize immediately. In practice, it's more useful to start with your primary model, establish a baseline for quality and cost, then evaluate whether specific tasks benefit from routing to a different model. Premature optimization here adds complexity without clear benefit.

Common Questions

Can we use BYOK for some agents and Thren's managed model for others?

Yes. BYOK can be configured as the org default while specific agent sessions or automations use a different configuration. This allows hybrid setups where cost-sensitive high-volume tasks use your own keys and occasional exploratory sessions use platform-managed access.

Does BYOK affect Thren's pricing?

BYOK is available on Teams and Enterprise plans. Thren's platform fee covers orchestration, agent infrastructure, clusters, skills, and automation - not the model costs. With BYOK, model costs flow directly to your LLM provider account and are not included in Thren's pricing.

What happens if an API key expires or gets rotated?

Model calls that use an expired or revoked key will fail with an authentication error, surfaced in the run history. Admins are notified. Key rotation is handled by updating the key in org settings - the new key takes effect immediately for all subsequent agent sessions and automations.

See Thren on your own tools.

A short call, your questions, your systems. We will show you what your teams could ask on day one.