Skip to Content
aicentos

Command Code

Use aicentos in Command Code — add a BYOK provider through providers.json

Last updated:

Command Code is a terminal coding agent that uses its built-in providers by default and also supports BYOK: register a custom provider in ~/.commandcode/providers.json and point the baseURL at aicentos.

Prerequisites

First create a dedicated key for Command Code on the console's "API Keys" page (naming it command-code makes usage easier to track):

Configuration to fill in

FieldValue
Config file~/.commandcode/providers.json
baseURLhttps://aicentos.com/v1
apiKey$AICENTOS_API_KEY
ModelA model name from the Model Gallery in the console

Setup steps

1. Set the environment variable

export AICENTOS_API_KEY="sk-your-API-Key"

Add it to ~/.zshrc or ~/.bashrc to persist it.

2. Edit providers.json

Edit ~/.commandcode/providers.json and add an entry under the provider object:

{
  "provider": {
    "aicentos": {
      "name": "aicentos",
      "api": "openai-completions",
      "baseURL": "https://aicentos.com/v1",
      "apiKey": "$AICENTOS_API_KEY",
      "models": {
        "gpt-4o": {}
      }
    }
  }
}

Field descriptions:

FieldDescription
nameDisplay name, shown in /connect and /model
apiopenai-completions (default) or anthropic-messages
baseURLRequired. API root address, must include /v1
apiKeySupports $VAR, {env:VAR}, !command, or set to false for unauthenticated endpoints
modelsRequired; {} is enough, model IDs must match the endpoint

Replace the model IDs in models with names from the Model Gallery in the console; see Supported models.

3. Select the provider

Once inside Command Code:

  • Run /connect, select aicentos and complete the key confirmation;
  • Run /model and choose the model to use.

Note: after modifying providers.json, you need to reopen /model for the new configuration to load.

Test

After picking the model, send a simple prompt:

Answer in one sentence: what is 1+1?

A normal response means the integration works. You can also press u on the provider in /connect to have it call the endpoint's /models and refresh the model list.

Notes

  • Command Code uses OpenAI-compatible Chat Completions by default, so setting api to openai-completions is enough.
  • To use Claude-family models, you need a separate provider entry with api: "anthropic-messages" — the two protocols build paths differently (the OpenAI SDK appends /chat/completions, the Anthropic SDK appends /v1/messages), so a single baseURL cannot serve both.
  • baseURL must include /v1; Command Code appends the remaining path itself.
  • Pasting a plain-text key directly into apiKey is rejected; use the $VAR form.
  • Troubleshooting order: can you see the model in /model → are the environment variables visible in the terminal you launched from → does baseURL stop at /v1 → is the balance sufficient.