Skip to main content

Overview

ARouter supports both platform credits and the option to bring your own provider keys (BYOK). When you use your own keys, requests are routed through your provider account while keeping all ARouter features — unified API, failover, analytics, and spend controls. Your provider keys are securely encrypted and automatically prioritized for routing. No code changes needed — just add your keys in the dashboard and your existing ARouter API key works as before.

How It Works

Your App → ARouter API (your ARouter key) → Provider (your BYOK key)
  1. Add your provider API key in Settings → Integrations.
  2. ARouter automatically uses your key for that provider.
  3. If your key is unavailable, ARouter can fall back to platform keys (configurable).
  4. Usage is tracked separately: BYOK vs. platform.

Supported Providers

ARouter supports BYOK for any provider with one of these credential types:
Credential TypeProvidersRequired Fields
API KeyOpenAI, Anthropic, DeepSeek, xAI, Mistral, and moreAPI key
AzureAzure OpenAIAPI key, endpoint URL, deployment name
BedrockAWS BedrockAccess key, secret key, region
Vertex AIGoogle Vertex AIService account JSON, region

Adding a BYOK Key

Dashboard

  1. Go to Settings → Integrations.
  2. Click Add Provider Key.
  3. Select your provider and credential type.
  4. Enter your key/credentials.
  5. (Optional) Click Test Key to verify it works.
  6. Click Save.

Advanced Options

When adding a key, you can configure:
OptionDescriptionDefault
LabelA name for this key (e.g. “Production”)
Always use this keyNever fall back to platform keysOff (allow fallback)
WeightRouting weight when you have multiple keys for the same provider1
RPM LimitMax requests per minute for this keyUnlimited
Base URLCustom endpoint URLProvider default
RegionPreferred region for routingAny
Supported ModelsRestrict this key to specific modelsAll models
Daily/Monthly BudgetSpending limit in USDUnlimited

Fallback Behavior

By default, if your BYOK key encounters a rate limit or error, ARouter falls back to platform keys seamlessly. You can change this per key:
Fallback PolicyBehavior
Allow (default)Fall back to platform keys when BYOK is unavailable
DenyReject the request if BYOK key is unavailable
Enable “Always use this key” in the dashboard to set deny fallback.

Multiple Keys

You can add multiple BYOK keys for the same provider. ARouter uses weighted random selection across all available keys. Configure the weight field to control traffic distribution.

BYOK Usage Tracking

BYOK requests are tracked separately in your usage dashboard:
  • BYOK Requests — number of requests using your keys
  • Estimated BYOK Spend — estimated cost based on provider pricing
  • Platform Spend — cost of requests using platform keys
The per-model usage table shows a Source column indicating whether each model’s requests came from BYOK, platform, or a mix.

Azure Configuration

For Azure OpenAI, provide your key configuration as JSON:
{
  "api_key": "your-azure-api-key",
  "endpoint_url": "https://your-resource.openai.azure.com/openai/deployments/your-deployment/chat/completions?api-version=2024-08-01-preview",
  "deployment_name": "your-deployment-name"
}

AWS Bedrock Configuration

For AWS Bedrock, provide your AWS credentials:
{
  "access_key": "AKIAIOSFODNN7EXAMPLE",
  "secret_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
  "region": "us-east-1"
}

Google Vertex AI Configuration

For Vertex AI, provide your service account credentials:
{
  "service_account_json": "{...your service account JSON...}",
  "region": "us-central1"
}

Debugging BYOK Issues

If BYOK requests fail:
  1. Go to Settings → Integrations and check the key health status.
  2. Click the key to see the last error message.
  3. Use the Test Key button to verify the key is still valid.
  4. Check the Usage page for BYOK-specific error rates.
Common issues:
SymptomCauseFix
invalid x-api-keyKey is expired or revokedGenerate a new key from your provider
Key shows unhealthyToo many errors triggered cooldownWait for cooldown to expire, or edit and re-enable
Requests not using BYOKProvider/model mismatchCheck the key’s supported models and region
Fallback to platformBYOK key rate-limitedIncrease RPM limit or add more keys