# Project8 Gateway Setup Guide

## What is Project8?

Project8 is a Claude-compatible API gateway. You get an API key that works with Claude Code and with tools that speak the Anthropic or OpenAI request formats; you change the base URL.

Project8 is an independent gateway built on third-party AI models. Not affiliated with or endorsed by Anthropic. Claude is a trademark of Anthropic.

**Base URL:** `https://api.project8.app`

Keys start with `p8-`.

---

## Quick Setup

### Option 1: Setup wizard

```bash
npx project8-cli
```

The wizard asks for your API key, writes the Claude Code settings (terminal or desktop app) and checks the connection. `npx project8-cli uninstall` removes those settings.

### Option 2: Windows PowerShell

```powershell
irm https://project8.app/setup.ps1 | iex
```

### Option 3: macOS / Linux

```bash
curl -fsSL https://project8.app/setup.sh | bash
```

---

## Manual Setup

### Claude Code

Edit `~/.claude/settings.json`:

```json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_BASE_URL": "https://api.project8.app",
    "CLAUDE_CODE_AUTO_MODE_SERVER": "0"
  }
}
```

> `CLAUDE_CODE_AUTO_MODE_SERVER` set to `0` keeps auto mode's classifier on your own
> machine. Without it, Claude Code shows a one-off notice about classifier requests
> the first time it starts on a new machine.

The VS Code extension for Claude Code reads the same file.

### Cursor

Open Settings > Models and add an OpenAI-compatible model:

- **Base URL:** `https://api.project8.app/v1`
- **API Key:** your Project8 key
- **Model:** `claude-sonnet-4-6`

### Cline / Roo Code

Add to VS Code `settings.json`:

```json
{
  "cline.apiProvider": "anthropic",
  "cline.anthropicBaseUrl": "https://api.project8.app",
  "cline.apiKey": "YOUR_API_KEY"
}
```

### cURL

```bash
curl https://api.project8.app/v1/messages \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-4-6",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
```

### Python (Anthropic SDK)

```python
import anthropic

client = anthropic.Anthropic(
    api_key="YOUR_API_KEY",
    base_url="https://api.project8.app"
)

message = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}]
)
```

---

## Compatible Model IDs

These are IDs your client can send. The gateway routes each one to a compatible third-party model; an ID does not mean the request is served by Anthropic's model of that name. `GET /v1/models` returns the list that is current for your key's server.

- `claude-fable-5-2`
- `claude-fable-5-1`
- `claude-fable-5`
- `claude-opus-5-5`
- `claude-opus-5`
- `claude-sonnet-5-5`
- `claude-sonnet-5`
- `claude-haiku-5-5`
- `claude-opus-4-8`
- `claude-opus-4-7`
- `claude-opus-4-6`
- `claude-sonnet-4-6`
- `claude-opus-4-5`
- `claude-sonnet-4-5-20250929`
- `claude-haiku-4-5-20251001`
- `claude-opus-4-1-20250805`
- `claude-opus-4-20250514`
- `claude-sonnet-4-20250514`

---

## How Token Budgets Work

- A key has a **token budget per 5-hour window**
- The window starts on your first request and resets after 5 hours
- Prompt cache read tokens are not counted
- Check usage in the dashboard or on the `/key-status` page

---

## Authentication

Use either header:

```
x-api-key: YOUR_API_KEY
```

or

```
Authorization: Bearer YOUR_API_KEY
```

---

## Built-in Tools

Where your plan and server provide them, these run server-side with no extra setup:

- **Web search** for up-to-date information
- **Image understanding** (JPEG, PNG, WebP)
