Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content
Get started

Set up with your coding agent

Use this page when you want your coding agent (Claude Code, Codex, Cursor or similar) to make the base-URL change in your app. You create the Mubit key yourself and keep it in an environment variable. The agent edits your code to read that variable, and never needs the key's value.

⚠️Warning

Don't paste a key into the agent's chat, its prompt or a file it can commit. A pasted key lands in the session's transcript. If you pasted one by mistake, revoke it under Mubit keys and create a new one.

1. Create the key yourself

  1. Open app.mubit.ai and sign in.
  2. In Your Mubit key, select Create key, and copy the key. The console shows it once. You can also create one under Mubit keys. See the Quickstart.
  3. Add your provider's key under Provider keys, so Mubit can pass calls on. See Provider keys.
  4. In your own terminal, set the key as an environment variable. Use the shell or secret store that your app's runtime reads:
export MUBIT_API_KEY='YOUR_MUBIT_KEY'

Start the agent from a shell where the variable is set, so the app it edits can read it.

2. Paste this prompt

Point this project's model calls at Mubit by changing each client's base URL and key source. Change nothing else.

Rules:
- Never ask me for an API key, and never print, log, copy or write a key's value anywhere. The Mubit key is in the environment variable MUBIT_API_KEY. Read it from there in code. Do not read it yourself.
- Do not put a key in any file. Do not edit .env files or commit anything.
- Keep every model ID, prompt, tool definition and request option as it is.

Steps:
1. Find every place the code creates a client or sends an HTTP request to OpenAI, Anthropic or Gemini. Also check framework settings and environment-variable configuration. List what you found before editing.
2. For each one, set the base URL to Mubit's, and set the API key to the value of MUBIT_API_KEY:
   - OpenAI SDK or OpenAI-compatible: base URL https://api.mubit.ai/openai/v1
   - Anthropic SDK: base URL https://api.mubit.ai/anthropic (no /v1; the SDK adds it)
   - Gemini SDK: base URL https://api.mubit.ai/gemini (no version path)
   - Plain HTTP: keep the provider's path, and use https://api.mubit.ai plus the prefix /openai, /anthropic or /gemini in place of the provider's host.
   Mubit takes each provider's own request format, so the request body stays the same.
3. For frameworks (Vercel AI SDK, LangChain, the OpenAI Agents SDK) and coding tools, read https://docs.mubit.ai/guides/frameworks.md or https://docs.mubit.ai/guides/coding-tools.md. The full index is at https://docs.mubit.ai/llms.txt.
4. Leave the provider's own key where it is. Do not delete it. Tell me these calls no longer use it, and that I add it under Provider keys in the Mubit console.
5. If MUBIT_API_KEY is set in the shell you are running in, run one existing call path once with a harmless input, without printing the key. If it is not set, stop and tell me to set it.
6. Tell me what you changed, file by file, and that I should open Requests in the Mubit console at https://app.mubit.ai/ to see the call.

For a project that uses several providers, the agent repeats step 2 for each one. Each provider keeps its own prefix.

3. Check the result

When the agent finishes, run your app once. In the console, open Requests: the call is at the top, with its Request, Reply and Served by. See Find calls in Requests.

If the call fails, the error names its code. Troubleshooting lists the codes and what to do.

ℹ️Note

The agent edits the code that sends calls. It doesn't create keys for you and doesn't need to. Creating, rotating and revoking keys stays in the console. See Keys and projects.

Next