Skip to main content
OpenClaw can connect to 4096bytes through a custom model Provider. Write the OpenAI compatible Provider config, set the agent default model, restart the gateway, and activate the new model.

Prerequisites

  • You have completed Create an account.
  • You have completed Get an API Key.
  • OpenClaw is installed and openclaw --version works.
  • You have the 4096bytes API Key, Base URL, and model name.
The commands below write the API Key into local OpenClaw config. Do not commit commands, config files, screenshots, or terminal output that contain the real API Key.

Configure a custom Provider

Run this command to add 4096bytes as a custom model Provider.
openclaw config set models.providers.4096bytes '{
  "api": "openai-completions",
  "baseUrl": "https://api.4096bytes.com/v1",
  "apiKey": "YOUR_4096BYTES_API_KEY",
  "auth": "api-key",
  "headers": {
    "User-Agent": "Mozilla/5.0"
  },
  "models": [
    {
      "id": "gpt-5.5",
      "name": "GPT-5.5",
      "contextWindow": 200000,
      "reasoning": true,
      "input": [
        "text"
      ]
    }
  ]
}' --strict-json --merge
Replace YOUR_4096BYTES_API_KEY with the API Key you created in the dashboard. Use the current dashboard values for id, name, contextWindow, and reasoning.
The command uses --strict-json. JSON cannot include trailing commas, or OpenClaw will reject the config.

Set the agent default model

Set the 4096bytes model as the agent default model and give it a short alias.
openclaw config set agents.defaults.models '{"4096bytes/gpt-5.5": {"alias": "G55"}}' --strict-json --merge
If your model name is not gpt-5.5, replace 4096bytes/gpt-5.5 in the command.

Restart the gateway

After writing the config, restart the OpenClaw gateway.
openclaw gateway restart

Activate the new model

Set the current session to use the 4096bytes model.
openclaw models set 4096bytes/gpt-5.5
If you use another model name, replace gpt-5.5 with the model ID shown in the dashboard.

Test the model call

Send a short message to verify the connection.
openclaw chat --message "hi"
If OpenClaw responds without authentication or model-not-found errors, the config is active.

Common issues

Check for trailing commas, unescaped quotes, or missing braces. With --strict-json, the value must be valid JSON.
Check that apiKey is complete and copied without extra spaces or newlines. Confirm the API Key was not deleted, expired, or over quota.
Confirm that the id in models matches the model ID used by openclaw models set. Copy the model name from the dashboard instead of old screenshots or another user’s config.
Run openclaw gateway restart first. If it still fails, check that both models.providers.4096bytes and agents.defaults.models were written successfully.