Coding tools

OpenClaw

OpenClaw keeps its own long-lived memory and runs continuously, so it makes far more calls over a day than an editor extension does. Point it at xKiro by adding a provider block to its config file.

Wire format

OpenAI format

Base URL

https://api.xkiro.com/v1

Configured by

~/.openclaw/openclaw.json

Model IDs always carry the vendor prefix

Use openai/gpt-5.6-sol, never a bare gpt-5.6-sol. Full list at GET /v1/models.

Configure the provider#

OpenClaw keeps its own long-lived memory and runs continuously, so it makes far more calls over a day than an editor extension does. Point it at xKiro by adding a provider block to its config file.

The file is openclaw.json — one path, every platform

Not config.json, and there is no separate Windows location: it is ~/.openclaw/openclaw.json on macOS, Linux and Windows alike. Put it anywhere else and OpenClaw silently falls back to its defaults — no error, no warning, just a provider that never appears. Set OPENCLAW_CONFIG_PATH if you need the file somewhere specific.

The format is JSON5, so comments, trailing commas and unquoted keys are all fine. Symlinked layouts are not supported for writes.

// ~/.openclaw/openclaw.json  —  cùng đường dẫn trên macOS, Linux và Windows
{
  models: {
    mode: "merge",
    providers: {
      xkiro: {
        baseUrl: "https://api.xkiro.com/v1",
        apiKey: "${XKIRO_API_KEY}",
        api: "openai-completions",
        timeoutSeconds: 300,
        models: [
          {
            id: "openai/gpt-5.6-sol",
            name: "GPT-5.6 Sol",
            contextWindow: 1000000,
            maxTokens: 65536,
            input: ["text", "image"],
            reasoning: true,
            cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
          },
        ],
      },
    },
  },
}
Select the model, then confirm
export XKIRO_API_KEY="sk-xt-..."

openclaw models set xkiro/openai/gpt-5.6-sol
openclaw models list --provider xkiro

models list wants the ID, not the display name

--provider takes the provider ID you chose (xkiro), not the label shown in interactive pickers. The Gateway reloads openclaw.json on change, so no restart is needed. If a write is rejected, OpenClaw keeps it beside the original as openclaw.json.rejected.*, and openclaw doctor --fix repairs a clobbered file.

Editing the config from the command line#

Editing the config without hand-writing JSON

mode: "merge" makes the block additive, so it does not wipe providers you already had. To apply it from the command line instead of an editor:

openclaw config set models.providers.xkiro '{"baseUrl":"https://api.xkiro.com/v1","apiKey":"${XKIRO_API_KEY}","api":"openai-completions"}' --strict-json --merge

OpenClaw speaks both of our formats

api: "openai-completions" targets /v1/chat/completions and is the one to use with the /v1 base URL above. OpenClaw also supports api: "anthropic-messages" — if you pick that, drop the /v1 and use https://api.xkiro.com, exactly as Claude Code does. Do not use openai-responses: that targets /v1/responses, which xKiro does not serve.

Declare model capabilities honestly#

Declare contextWindow and maxTokens honestly

OpenClaw budgets its memory and context trimming from the numbers in the model entry, not from anything the gateway reports. Numbers larger than the model really has produce upstream rejections on long sessions; numbers that are too small make it trim history it did not need to. Copy the real values from GET /v1/models.

cost only drives what OpenClaw displays — it does not change what you are charged. Leaving it at zero is fine; filling it in makes its own spend estimate meaningful.

Declaring the provider is not enough on its own

A provider block makes the model available; an agent still has to be pointed at it through agents.defaults.model (or the agents.defaults.models map). If everything looks configured but OpenClaw keeps using its previous model, that assignment is usually what is missing. agents.defaults.modelPolicy.allow is the optional explicit allowlist on top.

If it does not work#

Send one request by hand before touching OpenClaw's settings again. A reply proves the URL and key are both fine, which means whatever is left is in the tool's own configuration — and that is a much smaller place to look.

curl https://api.xkiro.com/v1/chat/completions \
  -H "Authorization: Bearer $XKIRO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-5.6-sol","messages":[{"role":"user","content":"ping"}],"max_tokens":8}'

An error naming an unknown model still counts as a success here: the request was authenticated before the model was rejected. Common failures and what each one means are on the overview page.

Was this page helpful?