Skip to main content

Anthropic Direct API

Use your Anthropic API key directly to access Claude models without going through CLIProxy. Perfect for users who already have Anthropic subscriptions and want direct API control.

Overview

Quick Start

Authentication

Getting Your API Key

1

Visit Anthropic Console

2

Navigate to API Keys

Click on your profile → SettingsAPI Keys
3

Create New Key

Click Create Key and copy the generated keyFormat: sk-ant-...
Keep this key secure. Treat it like a password. Do not commit to git or share publicly.
4

Create CCS Profile

Rotating Keys

When you need to change your API key:

Configuration

Default Setup

Manual Configuration

Edit ~/.ccs/config.yaml:

Custom Base URL (Advanced)

For organizations using Anthropic Workbench or custom deployments:

Available Models

Claude 5 Series (Latest)

Claude 4.8 Series

Opt in explicitly via ANTHROPIC_MODEL or the dashboard; the default profile model is unchanged.

Claude 4.6 Series

Claude 4.5 Series

Claude 3 Series (Previous)

Usage Examples

Basic Chat

Model Selection

Temperature and Creativity

Response Length Control

API Features Supported

Full Feature Support

Direct Anthropic API access supports all Claude features:
  • ✅ Vision (image analysis)
  • ✅ Extended thinking
  • ✅ Tool use (function calling)
  • ✅ Batch processing
  • ✅ Long context (200K tokens)
  • ✅ Token counting
  • ✅ Streaming

How to Enable

Billing & Rate Limits

Usage Tracking

Check your API usage:

Rate Limits

Default limits (can be increased):
Enterprise users can request higher limits at Anthropic console.

Cost Estimation

Visit console.anthropic.com/pricing for current rates. Rates are per million tokens. Typical usage:
  • Claude 3.5 Sonnet: ~$3-10/month for light use
  • Extended thinking: Additional cost based on thinking tokens

Comparison with CLIProxy Providers

Troubleshooting

Invalid API Key

Symptom: Error: 401 Unauthorized or Invalid authentication credentials Solutions:
  1. Verify key starts with sk-ant-
  2. Check key hasn’t expired or been revoked
  3. Copy key again from console.anthropic.com/settings/keys
  4. Update with: ccs api create --preset anthropic

Rate Limited

Symptom: Error: 429 Too Many Requests or Rate limit exceeded Solutions:
  1. Wait a few minutes before retrying
  2. Reduce concurrent requests
  3. Use Haiku for high-volume tasks (cheaper, faster)
  4. Request higher limits at Anthropic console

Connection Timeout

Symptom: Error: Request timeout or ECONNREFUSED Causes & Solutions:
  • Network issue — Check internet connection
  • API down — Check Anthropic status
  • Firewall blocked — Check firewall/proxy settings

Insufficient Balance

Symptom: Error: Insufficient balance or Credit limit exceeded Solutions:
  1. Check remaining balance at console.anthropic.com/dashboard
  2. Add payment method or credits
  3. Switch to lower-cost model (Haiku)

Cost Optimization

Use Right Model for Task

Limit Response Length

Batch Processing

For bulk operations, use Anthropic’s Batch API (available through direct API):

Storage Locations

Security Best Practices

  1. Never commit API keys — Use .gitignore for config files
  2. Rotate keys regularly — Generate new keys, revoke old ones
  3. Use environment variables — For CI/CD pipelines instead of files
  4. Monitor usage — Check console.anthropic.com regularly for suspicious activity
  5. Limit key scope — Create separate keys for different applications if possible

Next Steps

API Profiles

Learn more about creating and managing API profiles

Claude Accounts

Compare with OAuth-based Claude accounts

All Providers

Explore other available providers

Dashboard

Manage profiles via web interface