Cue
Setup

AI Provider Auth

Set the default model for OpenClaw and verify the assistant can answer before testing Discord replies

AI provider auth must work before Discord replies will work reliably.

If you are setting this up from Cue web, this is the simplest flow:

  1. In the chat page, click the workspace icon in the top right to open the workspace.
  2. In the workspace, open the top-right three-dots menu and click Open VS Code.
  3. In VS Code, create or upload:
~/.openclaw/agents/main/agent/auth-profiles.json

Use the example auth-profiles.json further below on this page as the starting format.

  1. Open a terminal in VS Code with `Ctrl+`` or from the top-left menu via Terminal.
  2. Point OpenClaw at that profile explicitly:
openclaw config set auth.order.openai-codex '["openai-codex:default"]' --json
openclaw config set agents.defaults.model.primary openai-codex/gpt-5.4
openclaw config set agents.defaults.model.fallbacks '[]' --json
  1. Verify the runtime sees the profile:
openclaw models status --json

This workflow is useful when you already have a working auth-profiles.json and want to reuse it inside the sandbox without going through interactive login first.

Anthropic API Key

If you want to use Anthropic in the sandbox:

openclaw config set auth.profiles.anthropic:default '{"provider":"anthropic","mode":"api_key"}' --json
openclaw config set auth.order.anthropic '["anthropic:default"]' --json
openclaw config set agents.defaults.model.primary "anthropic/claude-opus-4-6"
openclaw config set agents.defaults.model.fallbacks '[]' --json

Then add the Anthropic key with the auth flow you prefer.

Example ~/.openclaw/agents/main/agent/auth-profiles.json:

{
  "version": 1,
  "profiles": {
    "anthropic:default": {
      "type": "api_key",
      "provider": "anthropic",
      "key": "sk-ant-..."
    }
  }
}

Set the Default Model Explicitly

If you use an API key flow, set the default model explicitly:

openclaw config set agents.defaults.model.primary "anthropic/claude-opus-4-6"
openclaw config set agents.defaults.model.fallbacks '[]' --json

If you use OpenAI Codex OAuth, set an OpenAI Codex model instead:

openclaw config set agents.defaults.model.primary "openai-codex/gpt-5.3-codex"
openclaw config set agents.defaults.model.fallbacks '[]' --json

OpenAI Codex OAuth

OpenClaw supports interactive Codex login:

openclaw models auth login --provider openai-codex --set-default

Use this inside the same sandbox where OpenClaw will run.

Do not assume cached OAuth tokens copied from another tool or machine will refresh cleanly inside a new sandbox. If refresh fails, re-authenticate inside that sandbox.

OpenAI Codex Manual Config

To configure OpenAI Codex via config commands (without interactive login):

openclaw config set auth.profiles.openai-codex:default '{"provider":"openai-codex","mode":"oauth"}' --json
openclaw config set auth.order.openai-codex '["openai-codex:default"]' --json
openclaw config set agents.defaults.model.primary openai-codex/gpt-5.4
openclaw config set agents.defaults.model.fallbacks '[]' --json

Profile fields (provider and mode) must be set together as a JSON object. Setting them individually will fail validation because the schema requires both fields.

OpenAI Codex in a Sandbox

If you already have a working Codex OAuth profile and want to reuse it in a sandbox, copy the real auth store into:

~/.openclaw/agents/main/agent/auth-profiles.json

Example:

{
  "version": 1,
  "profiles": {
    "openai-codex:default": {
      "type": "oauth",
      "provider": "openai-codex",
      "access": "<ACCESS_TOKEN>",
      "refresh": "<REFRESH_TOKEN>"
    }
  }
}

Then point OpenClaw at that profile explicitly:

openclaw config set auth.order.openai-codex '["openai-codex:default"]' --json
openclaw config set agents.defaults.model.primary openai-codex/gpt-5.4
openclaw config set agents.defaults.model.fallbacks '[]' --json

The copied auth-profiles.json already carries the provider and auth type. For a seeded sandbox profile, the required follow-up is selecting it via auth.order and setting the default model.

Verify the runtime sees the profile:

openclaw models status --json

What you want:

  • defaultModel is openai-codex/gpt-5.4
  • providersWithOAuth includes openai-codex
  • missingProvidersInUse does not include anthropic

Final Verification

Before testing Discord, verify the assistant itself can answer:

openclaw agent --agent main --message "Reply with OK only"

Expected:

OK

If this command fails, fix model auth before continuing.

Common Failure

If you see:

No API key found for provider "anthropic"

then the default model is still pointing at Anthropic, or no default model was set at all.

On this page