Skip to main content

KiloCode

KiloCode provides a unified API gateway that routes to multiple underlying AI models. A single KiloCode API key gives access to models from various providers without managing individual provider credentials.

Prerequisites

Obtain an API key from kilocode.ai and set it on the gateway host:
echo 'KILOCODE_API_KEY=your-key-here' >> ~/.openclaw/.env

Configuration

{
  models: {
    providers: {
      kilocode: {
        apiKey: "KILOCODE_API_KEY", // references the env var
        models: [
          // add model IDs available through your KiloCode plan
        ],
      },
    },
  },
}
apiKey is the name of the environment variable, not the key value itself. Keep secrets in .env, not in committed config files.
KiloCode routes requests to multiple underlying providers through a single API. The available models depend on your KiloCode plan. Check the KiloCode dashboard for the model catalog available to your account.

Selecting a model

{
  agents: {
    defaults: {
      model: { primary: "kilocode/<model-id>" },
    },
  },
}
Replace <model-id> with a model ID from the KiloCode catalog. Run openclaw models list --provider kilocode to see what your key can reach.

Troubleshooting

The API key is invalid or revoked. Retrieve a valid key from the KiloCode dashboard and update ~/.openclaw/.env.
The requested model may not be included in your KiloCode plan. Check the KiloCode dashboard for your entitlements.