Skip to content

Configure Claude Code CLI

This page explains how to use Claude Code CLI with Cubicspaces through the Claude Messages compatible API.

For long-context cache behavior and request stability, see Cache & Request Affinity.

Prerequisites

  • Claude Code CLI is installed.
  • You have created a Cubicspaces API key.
  • Your account can access the Claude model you want to use.

Configure Environment Variables

Claude Code CLI uses Anthropic-style authentication and Base URL settings. Set the Base URL to the Cubicspaces domain root, without /v1; the client will call /v1/messages.

powershell
$env:ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
$env:ANTHROPIC_BASE_URL="https://cubicspaces.cloud"
claude
bash
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
export ANTHROPIC_BASE_URL="https://cubicspaces.cloud"
claude

For long-term use, save these variables in your shell profile or system environment variables.

Verify the Setup

Open a project directory and start:

bash
claude

Then send a simple prompt:

text
Read the current project structure and summarize the main directories.

If Claude Code CLI returns a project summary, the Cubicspaces connection is working.

Troubleshooting

401 or authentication failed

Check that ANTHROPIC_AUTH_TOKEN is set to your Cubicspaces API key and is available in the current terminal session.

404 or wrong request path

Check that ANTHROPIC_BASE_URL is:

text
https://cubicspaces.cloud

Do not set it to https://cubicspaces.cloud/v1.