> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Anthropic CLI

> CLI commands for Anthropic provider

# Anthropic CLI Commands

Manage and test Anthropic Claude provider via the command line.

## Environment Setup

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
export ANTHROPIC_API_KEY=sk-ant-...
```

## Commands

### Check Provider Status

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts providers doctor anthropic
```

**Output:**

```
Provider Doctor: anthropic

  Package: @ai-sdk/anthropic
  Description: Anthropic Claude models
  Environment Variable: ANTHROPIC_API_KEY
  Status: ✅ Ready
  Key Preview: sk-a...xxxx

  Modalities:
    Text/Chat: ✅  Embeddings: ❌  Image: ✅
    Audio: ❌  Speech: ❌  Tools: ✅
```

### JSON Output

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts providers doctor anthropic --json
```

**Output:**

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "success": true,
  "data": {
    "provider": "anthropic",
    "env_key": "ANTHROPIC_API_KEY",
    "has_key": true,
    "key_preview": "sk-a...xxxx",
    "package": "@ai-sdk/anthropic",
    "modalities": {
      "text": true,
      "chat": true,
      "embeddings": false,
      "image": true,
      "tools": true
    },
    "status": "ready"
  }
}
```

### Test Provider

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts providers test anthropic claude-sonnet-4-20250514
```

**Output:**

```
ℹ Testing anthropic/claude-sonnet-4-20250514...

  ✅ Test Passed
  Provider: anthropic
  Model: claude-sonnet-4-20250514
  Latency: 2429ms
  Response: "test ok"
```

### Test with JSON Output

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts providers test anthropic claude-sonnet-4-20250514 --json
```

**Output:**

```json theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
{
  "success": true,
  "data": {
    "provider": "anthropic",
    "model": "claude-sonnet-4-20250514",
    "status": "success",
    "latency_ms": 2429,
    "response_preview": "test ok"
  }
}
```

### Chat with Anthropic

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts chat "Explain quantum computing" --provider anthropic --model claude-sonnet-4-20250514
```

## Advanced Usage

### Using Alias

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts providers doctor claude
# Same as: praisonai-ts providers doctor anthropic
```

### Verbose Output

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts providers doctor anthropic --verbose
```

## Options Reference

| Option            | Description               |
| ----------------- | ------------------------- |
| `--json`          | Output in JSON format     |
| `--verbose`       | Show detailed information |
| `--model <model>` | Specify model for test    |

## Troubleshooting

### Missing API Key

```
Status: ❌ Missing API Key
```

**Solution:**

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
export ANTHROPIC_API_KEY=sk-ant-your-key-here
```

### Invalid Model Name

```
Error: model: claude-3-5-sonnet
```

**Solution:** Include the full model name with date:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai-ts providers test anthropic claude-3-5-sonnet-20241022
```

### Rate Limit

```
Error: Rate limit exceeded
```

**Solution:** Wait and retry, or implement exponential backoff.

## Related

* [Anthropic Code Usage](/docs/js/providers/anthropic-code)
* [Providers CLI Overview](/docs/js/providers-cli)
