ONE_CLICK_IMPORT

CC Switch one-click setup

CC Switch is a desktop tool for managing Codex provider configs. Once your BRUCEAI keys are imported, you can switch between OpenAI, Grok and DeepSeek from its UI without editing config.toml or auth.json by hand.

The builder below assembles a ccswitch:// import link in your browser with the Base URL, default model and key filled in. Each key type is imported as its own provider.

One-click import also enables usage queries automatically, so CC Switch shows your BRUCEAI available balance. Existing or manually created providers do not pick this up on their own; re-import them or paste the script below.

Model IDs

Copy these model IDs into config files, API request bodies, or any OpenAI-compatible client that asks for a model name. Each group needs the matching key type.

GPTNeeds an OpenAI key
GrokNeeds a Grok key
DeepSeekNeeds a DeepSeek key
BEFORE YOU START

Prepare your API key

1. Open the API key page

After signing in, open the API key page to create or copy a key. It looks like sk-or-v1-xxxxxxxxxxxx. Treat it like a password.

Create API key
3. Confirm the Base URL
https://api.bruceai.net/v1

Codex providers always use https://api.bruceai.net/v1; the /v1 suffix is required.

2. Create a key for the provider you want

Click Create API key, give it a name you will recognize, then pick the key type by the models you plan to call:

OpenAI key
Serves gpt-6-astra, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna and gpt-5.5. Works with Codex, GitHub Copilot and any OpenAI-compatible client.
Grok key
Serves grok-4.6 and grok-4.5. Works with Grok Build, Codex and any OpenAI-compatible client.
DeepSeek key
Serves deepseek-v4.1-flash: 1M context, thinking mode, tool calling and image input. Works with Codex and any OpenAI-compatible client.

A key only serves its own provider's models. Sending a GPT model id with a Grok key, or a Grok id with an OpenAI key, is refused with a 400. Create one key per provider if you use several.

Do not share your API key with anyone, and do not commit it to GitHub, GitLab, or any public repository.

STEP 01

Install and open CC Switch

Download the latest build for your system from the official CC Switch Releases page. Open CC Switch once after installation so your system can register the ccswitch:// link protocol.

Also make sure Codex CLI is installed (npm install -g @openai/codex@latest). CC Switch manages the configuration; Codex still sends the requests.

STEP 02

Create an API key

Sign in to BRUCEAI, open API keys, click Create API key and choose the OpenAI, Grok or DeepSeek type depending on the models you want.

The full key is shown only once; copy it before closing the dialog. To use several providers, create one key per provider and import each one.

STEP 03

Build the import link and open CC Switch

Pick the key type and default model, paste the key you just created, and click Open CC Switch import. When the browser asks to open an external application, allow it.

The import link contains the complete API key. Do not copy, forward, or post it in chats, tickets, or public pages. Open it only on your own computer.

One-click import link

Pick the key type and default model, paste the key, then click to open CC Switch. The link is built in your browser only; the key is never sent to BRUCEAI.

Key type
Open CC Switch importPaste a complete key (starts with sk-or-v1-) to enable the button.

If nothing opens, confirm that CC Switch is installed and has been launched, and that the browser is not blocking external-application links. Retry with Chrome, Edge, or your system browser if needed.

STEP 04

Verify the imported fields

The confirmation screen should show the values below; confirm to add or update the provider. The /v1 suffix is required, and the default model depends on the key type you chose.

OpenAI key
text
App: Codex
Provider: BRUCEAI
API endpoint: https://api.bruceai.net/v1
Default model: gpt-5.6-terra
Grok key
text
App: Codex
Provider: BRUCEAI Grok
API endpoint: https://api.bruceai.net/v1
Default model: grok-4.6
DeepSeek key
text
App: Codex
Provider: BRUCEAI DeepSeek
API endpoint: https://api.bruceai.net/v1
Default model: deepseek-v4.1-flash
STEP 05

Verify balance queries

A provider imported through the link above already includes the usage-query script and refreshes periodically; no manual setup is required. It calls https://api.bruceai.net/v1/usage with the provider API key and returns only your own BRUCEAI available balance.

CC Switch cannot infer this endpoint for an older, migrated, or manually created provider. Re-import it with step 3, or enable a custom usage query in the CC Switch provider and paste the script below. It accepts a Base URL with or without /v1.

CC Switch usage-query script
javascript
({
  request: {
    url: "{{baseUrl}}".replace(/\/+$/, "")
      + ("{{baseUrl}}".replace(/\/+$/, "").endsWith("/v1") ? "" : "/v1")
      + "/usage",
    method: "GET",
    headers: { "Authorization": "Bearer {{apiKey}}" }
  },
  extractor: function(response) {
    return {
      isValid: response?.isValid ?? true,
      remaining: response?.remaining ?? response?.balance,
      unit: response?.unit ?? "USD"
    };
  }
})

The unit field in CC Switch reads USD, but the number is your BRUCEAI credit balance, not dollars.

STEP 06

Add a provider manually (without the import link)

In CC Switch select Add new provider, keep the top tab on Codex providers, then pick Custom configuration in the top-left corner. Do not pick OpenAI Official or any other preset.

Set any provider name you like, for example BRUCEAI, set the homepage to https://bruceai.net, paste your key (it starts with sk-or-v1-) into API Key, and set the API endpoint to https://api.bruceai.net/v1. The /v1 suffix is required.

Set the default model to a model ID that belongs to this key's provider (for example gpt-5.6-terra, grok-4.6 or deepseek-v4.1-flash), expand Advanced options, and set the upstream format to Responses (native). Save when done.

The upstream format must be Responses (native). Chat or Anthropic Messages adds a format conversion layer, which can make Codex receive a 400 or an empty reply.

STEP 07

Activate the provider and verify

Open the Codex section in CC Switch and make BRUCEAI the active provider. A running Codex terminal does not reload the config automatically, so exit it and start it again.

In Codex, use /model to inspect or change the model. Only models of this key's provider are accepted; to change providers, switch to another imported provider in CC Switch.

Codex
bash
codex
STEP 08

Troubleshooting

401 / invalid token: remove the old provider, create a new key, and import it again. Make sure the key is complete and has no extra whitespace.

Requests still use the previous provider: fully exit the running Codex session, confirm that BRUCEAI is active in CC Switch, then restart it.

400 / unsupported_model: the model ID does not belong to this key's provider. OpenAI keys only accept GPT models, Grok keys only grok-4.6 / grok-4.5, DeepSeek keys only deepseek-v4.1-flash.

Codex cannot connect: confirm that you imported into the Codex section, the endpoint includes /v1, and the upstream format is Responses (native).

For manual setup or an isolated config that preserves your existing account, use the Codex guide in the sidebar.