Skip to main content

Overview

Claude Code is Anthropic’s official CLI tool for AI-assisted coding. You can configure it to use LemonData as the API provider.

Configuration

Environment Variables

Set the following environment variables:
export ANTHROPIC_API_KEY="sk-your-lemondata-key"
export ANTHROPIC_BASE_URL="https://api.lemondata.cc"
Add these to your shell profile (~/.bashrc, ~/.zshrc, etc.) for persistence.

Configuration File

Alternatively, create or edit ~/.claude/settings.json:
{
  "apiKey": "sk-your-lemondata-key",
  "baseUrl": "https://api.lemondata.cc"
}

Usage

After configuration, use Claude Code normally:
# Start an interactive session
claude

# Run a single command
claude "Explain this code" < main.py

# Chat mode
claude chat

Available Models

LemonData supports all Claude models:
ModelDescription
claude-opus-4-20250514Most capable, complex reasoning
claude-sonnet-4-20250514Balanced performance
claude-3-5-sonnet-20241022Fast, excellent for coding
claude-3-5-haiku-20241022Fastest, cost-effective
claude-3-7-sonnet-20250219Latest Sonnet
claude-3-7-sonnet-20250219-thinkingExtended thinking

Model Selection

Specify a model with the --model flag:
claude --model claude-3-5-sonnet-20241022 "Review this PR"
Or set a default in your configuration:
{
  "apiKey": "sk-your-lemondata-key",
  "baseUrl": "https://api.lemondata.cc",
  "model": "claude-3-5-sonnet-20241022"
}

Extended Thinking

For complex reasoning tasks, use models with extended thinking:
claude --model claude-3-7-sonnet-20250219-thinking "Design a microservices architecture for..."

Troubleshooting

Verify the base URL is exactly https://api.lemondata.cc (no /v1 suffix for Anthropic SDK).
Ensure your LemonData API key starts with sk- and has sufficient balance.
Check the model name is correct. Use claude-3-5-sonnet-20241022 format.

Benefits

Cost savings

LemonData offers competitive pricing with significant discounts.

No rate limits

Higher rate limits than official API for most users.

Multiple models

Access to 300+ models beyond just Claude.

Usage tracking

Detailed usage analytics in your dashboard.