AI code editors like Cursor, Roo Code, and Cline are powerful — but their built-in pricing can add up. Most of these tools support "bring your own key" (BYOK), letting you route API calls through your own endpoint.
Here's how to set up each tool with a custom API gateway.
Why BYOK?
- Cost control: Pay per token instead of flat subscriptions
- Model flexibility: Switch between Claude, GPT, and Gemini without changing tools
- No rate limits: Your usage, your limits
- Unified billing: One dashboard for all model costs
Cursor
Cursor supports custom API endpoints through its settings:
- Open Settings → Models
- Under OpenAI API Key, enter your gateway key
- Set OpenAI API Base to your gateway URL:
https://futurmix.ai/v1
- Select your preferred model from the dropdown
Now Cursor routes all AI requests through your gateway.
Roo Code (VS Code Extension)
Roo Code has built-in support for OpenAI-compatible providers:
- Open Roo Code settings in VS Code
- Select OpenAI Compatible as the provider
- Configure:
-
Base URL:
https://futurmix.ai/v1 - API Key: Your gateway key
-
Model ID:
claude-sonnet-4-5-20250929
-
Base URL:
That's it — Roo Code will now use your custom endpoint for all completions.
Cline (VS Code Extension)
Cline also supports OpenAI-compatible endpoints:
- Open Cline settings
- Choose OpenAI Compatible as the API provider
- Enter:
-
Base URL:
https://futurmix.ai/v1 - API Key: Your gateway key
-
Model ID:
claude-sonnet-4-5-20250929
-
Base URL:
Continue (VS Code / JetBrains)
Edit your config.json:
{
"models": [
{
"title": "Claude Sonnet 4.5",
"provider": "openai",
"model": "claude-sonnet-4-5-20250929",
"apiBase": "https://futurmix.ai/v1",
"apiKey": "your-gateway-key"
}
]
}
Claude Code (Terminal)
Claude Code supports custom API endpoints via environment variables:
export ANTHROPIC_BASE_URL=https://futurmix.ai
export ANTHROPIC_API_KEY=your-gateway-key
claude
Note: Claude Code uses the Anthropic /v1/messages format, not OpenAI format. Your gateway needs to support both.
Comparing BYOK vs Built-in Pricing
| Cursor Pro | BYOK via Gateway | |
|---|---|---|
| Monthly cost | $20/month fixed | Pay per token |
| Light usage (~$5/mo) | Overpaying | Save 75% |
| Heavy usage (~$50/mo) | Underpaying | Pay actual cost |
| Model choice | Limited | 22+ models |
| Provider lock-in | Yes | No |
The break-even point depends on your usage. For most developers doing moderate AI-assisted coding, BYOK is cheaper.
Quick Setup Cheat Sheet
# Works with most OpenAI-SDK-based tools
export OPENAI_API_BASE=https://futurmix.ai/v1
export OPENAI_API_KEY=your-gateway-key
# For Anthropic-native tools (Claude Code, Claude Desktop)
export ANTHROPIC_BASE_URL=https://futurmix.ai
export ANTHROPIC_API_KEY=your-gateway-key
What to Look for in an API Gateway
When choosing a gateway for BYOK:
-
OpenAI compatibility — Must support
/v1/chat/completions - Model coverage — Claude, GPT, Gemini at minimum
- Reliability — Look for SLA guarantees
- No data retention — Your code shouldn't be stored
- Transparent pricing — No hidden markups
What BYOK setup are you using? Share your config in the comments.
Top comments (0)