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

# Use in Claude Code

> Integrate AnyFast AI models with Claude Code — the AI coding assistant in your terminal.

## Overview

Claude Code is a command-line AI assistant for coding tasks. By integrating with AnyFast, you can access powerful AI models directly from your terminal for code generation, debugging, and analysis.

## Prerequisites

* macOS or Linux (or Windows with WSL)
* Terminal access with a bash shell
* A valid AnyFast API Key
* Internet connection

## Method 1: Manual Configuration (Recommended)

### Environment Variables

Add the following to your shell profile (`.bashrc`, `.zshrc`, or `.profile`):

```bash theme={null}
# AnyFast API Configuration
export ANTHROPIC_BASE_URL="https://www.anyfast.ai/"
export ANTHROPIC_MODEL="claude-opus-4-7"
export ANTHROPIC_API_KEY="sk-your-api-key-here"
```

### Apply Configuration

```bash theme={null}
# bash users
source ~/.bashrc

# zsh users
source ~/.zshrc
```

### Start Claude Code

```bash theme={null}
claude
```

## Method 2: OpenAI-Compatible Mode

Add to your shell profile:

```bash theme={null}
export OPENAI_API_KEY="sk-your-api-key-here"
export OPENAI_BASE_URL="https://www.anyfast.ai/v1"
```

## Switching Models

To change models, update the environment variable:

```bash theme={null}
export ANTHROPIC_MODEL="claude-sonnet-4-6"
source ~/.zshrc
```

## Tips

* Use specific, detailed prompts for better code suggestions.
* Break complex tasks into smaller, manageable requests.
* Review generated code before implementing.
* Monitor your usage in the [AnyFast console](https://www.anyfast.ai/).

## Troubleshooting

**Authentication errors:**

```bash theme={null}
echo $ANTHROPIC_API_KEY
```

**Model not found:**

```bash theme={null}
echo $ANTHROPIC_MODEL
```

**Connection issues:**

```bash theme={null}
curl -H "Authorization: Bearer $ANTHROPIC_API_KEY" https://www.anyfast.ai/v1/models
```

<script src="/feedback.js" />
