# Use Claude Code with GoiAPI

> Use Claude Code with your own API key: set ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN, pick a Claude model, then send a test message from your terminal.

Source: https://goiapi.com/en/docs/integrations/claude-code

## 1. Before you start

- An API key: [sign up](https://goiapi.com/en/signup), top up your balance, then create a key in the dashboard. Put your key where `<API_KEY>` appears below.
- The name of the model you want to use, from [Models](https://goiapi.com/en/models). The examples below use `claude-haiku-5-5`. This tool uses the Anthropic format, so pick a Claude model.

## 2. Set up Claude Code

Open Terminal (macOS/Linux) or PowerShell (Windows), paste the lines below one by one, then run Claude Code as usual.

**macOS / Linux: paste into Terminal**

```bash
export ANTHROPIC_BASE_URL="https://api.goiapi.com"
export ANTHROPIC_AUTH_TOKEN="<API_KEY>"
export ANTHROPIC_MODEL="claude-haiku-5-5"
claude
```

**Windows: paste into PowerShell**

```powershell
$env:ANTHROPIC_BASE_URL = "https://api.goiapi.com"
$env:ANTHROPIC_AUTH_TOKEN = "<API_KEY>"
$env:ANTHROPIC_MODEL = "claude-haiku-5-5"
claude
```

## 3. Send a test message

Send a short message (for example "Hello") from Claude Code. The **Request history** page in the dashboard shows the request as soon as it happens, with token counts and cost.

If something fails, see [Error codes](https://goiapi.com/en/docs/error-codes): `401` means the key is wrong or missing, `402` means your balance is too low, `404` means the model name is wrong.
