What is BYOK?
Bring Your Own Key means you can use your own AI provider API keys with OCCode instead of (or alongside) the built-in credits system. This gives you:
- Model choice — use Claude, GPT, Gemini, Llama, or any supported model
- Cost control — pay your provider directly at their rates
- No credit limits — your usage is limited only by your provider’s quota
Supported providers
| Provider | Models | How to get a key |
|---|
| Anthropic | Claude 4, Claude Opus, Claude Sonnet | console.anthropic.com |
| OpenAI | GPT-5, GPT-4o, o3 | platform.openai.com |
| Google | Gemini 3, Gemini 2.5 | aistudio.google.com |
| OpenRouter | 200+ models | openrouter.ai |
OpenRouter is a great option if you want access to many models with a single key.
Adding your API key
Open the Models app
In OCCode, navigate to the Models app from the sidebar.
Click Add Provider
Select your provider from the list.
Paste your API key
Enter your API key. OCCode validates it immediately.
Set as default (optional)
Choose whether to use this provider as your default model.
How billing works with BYOK
| Setup | Who pays |
|---|
| No custom keys | You pay via OCCode credits |
| Custom keys added | Your provider bills you directly |
| Mixed (some BYOK, some default) | Each model bills its respective source |
When you use your own keys, no OCCode credits are consumed for those models. Your credit balance is only used for the built-in Legacy Model.
Which key is used where?
See Which Key is Used Where for a detailed breakdown of how OCCode decides which API key to use for each interaction.