answers.delivery

Guide · 7 steps · 1 min read

How to connect your own API key for AI roleplay

If you already pay for a model through OpenRouter, Anthropic, DeepSeek or another provider, you can use that key for roleplay and pay the provider's own rate. The steps below take you from a fresh account to a story running on your own key, with the settings tuned the way you like.

Published
17 Nov 2026
Delivery
No. 12
Topic
AI and agents
Evidence
Every step quoted from thecodexai.com
Review
Approved by the founder
  1. 1

    Sign in and open the BYOK setup. The docs list it as an essential guide and say the connection takes about a minute.

    ScreenBYOK configuration screen with the provider list

    Connect your API keys in 60 seconds and start playing with raw provider rates.Quoted from thecodexai.com
  2. 2

    Pick your provider from the list. OpenRouter, Anthropic, OpenAI, Google, DeepSeek, xAI, Mistral, NovelAI and AI Horde are all there.

    ScreenProvider picker with OpenRouter selected

    Direct browser-to-LLM streaming with 18+ providers — OpenRouter, Anthropic, OpenAI, Google, DeepSeek, xAI, Mistral, NovelAI, AI Horde, or fully local Ollama and LM Studio.Quoted from thecodexai.com
  3. 3

    Paste your key. It is encrypted on your side before it is saved, and requests go from your browser to the provider.

    ScreenKey entry field after a key has been saved

    Connect to OpenRouter, Claude 3.5, GPT-4o, DeepSeek R1/V3, or Gemini with client-encrypted API keys.Quoted from thecodexai.com
  4. 4

    If you run a model on your own computer, choose the local option instead and point it at Ollama, LM Studio or KoboldCpp.

    ScreenLocal model connection settings

    AI Horde (100% Free), and Local LLMs (Ollama, LM Studio, KoboldCpp)Quoted from thecodexai.com
  5. 5

    Set the samplers. Start with temperature, then try Min-P or repetition penalty if replies feel flat or keep looping.

    ScreenSampler settings panel

    Fine-tune Temperature, Top-P, Top-K, Repetition Penalty, Min-P, and Top-A.Quoted from thecodexai.com
  6. 6

    Open a story and send a first message to check the connection. No markup is added, so the cost shows up on your provider's bill at their normal price.

    ScreenA story session with the first reply from the connected model

    zero filters, zero prompt censorship, and zero platform token markupsQuoted from thecodexai.com
  7. 7

    Before you write anything long, set your E2EE passphrase so your saved chats stay private.

    ScreenEncryption passphrase setup

    Not even the database admins can access your chats as long as you've setup your E2EE passphrase.Quoted from thecodexai.com

More from The Codex AI

All 11 answers