Use Claude Code with Gab AI through the Anthropic-compatible /v1/messages endpoint.
Prerequisites
A Gab AI Plus subscription
A Gab AI API key
Claude Code installed locally
Configuration
Claude Code expects Anthropic's Messages API and appends /v1/messages itself. Set the base URL to the root domain, not https://gab.ai/v1. Use ANTHROPIC_MODEL=auto for the agent/main model only, and set a cheap explicit ANTHROPIC_SMALL_FAST_MODEL (arya or the admin quick default) for compact and title calls. GET /v1/agent-setup?client=claude-code returns the env vars to copy.
export ANTHROPIC_BASE_URL="https://gab.ai"
export ANTHROPIC_AUTH_TOKEN="YOUR_GAB_API_KEY"
export ANTHROPIC_MODEL="auto"
export ANTHROPIC_SMALL_FAST_MODEL="arya"
claude
Base URL
Use https://gab.ai for Claude Code. If you set https://gab.ai/v1, Claude Code may call /v1/v1/messages.
Supported Features
Anthropic /v1/messages request and response shape
Streaming server-sent events, including tool_use input_json_delta
Tool use with tool_use and tool_result blocks
Prompt caching via cache_control (auto-marked on system + last tool when omitted)
Extended thinking / reasoning_effort
Model aliases (anthropic/claude-sonnet-4-5, date-stamped Claude ids)
/v1/messages/count_tokens compatibility
stop_sequences, temperature, top_p, top_k, and max_tokens
Image blocks from URL, base64, or Gab AI uploaded file_id
Smoke Test
You can validate the endpoint directly with cURL before launching Claude Code: