Skip to content
Gab AI

Use Gab AI with Claude Code: setup, access and checks

Connect your terminal coding workflow to Gab models through Claude Code’s Messages gateway.

Connect your client to Gab AI

Have your client installed and a Gab API key ready. Follow the configuration for your client below, then select a model and try a first prompt.

Configure the Claude Code gateway

Replace YOUR_GAB_API_KEY with your complete Gab key, then run the commands below in the shell that launches Claude Code. Use the root URL https://gab.ai: the client appends /v1/messages. The example selects Arya.

Set your Gab API key
Bash/Zsh
export GAB_API_KEY="YOUR_GAB_API_KEY"

Claude Code CLI gateway
Bash/Zsh
export ANTHROPIC_BASE_URL="https://gab.ai"
export ANTHROPIC_AUTH_TOKEN="$GAB_API_KEY"
export ANTHROPIC_MODEL="arya"
claude

Confirm the active gateway and model

Run /status inside Claude Code and check the base URL and credential source. Confirm the selected model, then try the prompt below. For another Claude Code surface, use its own gateway settings rather than assuming it inherits this terminal’s environment.

Try a first prompt and follow-up

Select your configured Gab provider and model in Claude Code. Send the first prompt, then continue the same conversation with the follow-up.

First prompt for Claude Code
Text
For a workshop, income is USD 480 and base cost is USD 370. Reply with the remaining amount only.

Expected result: USD 110.

Follow-up prompt for Claude Code
Text
Change only the base cost to USD 395. Keep income at USD 480 and reply with the new remaining amount only.

Expected result after the change: USD 85.

Check the API connection separately

This cURL example checks Chat Completions directly. Use the in-client prompts above to check your Claude Code connection.

Try a small Chat Completions request
cURL
curl -sS https://gab.ai/v1/chat/completions \
  -H "Authorization: Bearer $GAB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "arya",
  "messages": [
    {
      "role": "user",
      "content": "For a workshop, income is USD 480 and base cost is USD 370. Reply with the remaining amount only, as USD 110."
    }
  ],
  "max_tokens": 1024,
  "stream": false
}'

API access and usage

Authenticated API requests require active Plus or Plus Premium and applicable credits. API use is billed separately from included in-app Chat. Daily request limits and credit balance are separate; the authentication reference explains allowances and reset times.

Resolve failed or incomplete requests

Read the client’s error and confirm its active provider, base URL and model. For key, account or rate-limit errors, use the authentication guide. If an answer stops early, inspect the completion status and output budget before retrying. For tool failures, check the selected model’s capabilities and the client’s tool configuration.

Was this page helpful?