# Claude Opus 4.8 API (reAPI)

## Overview

- What it does: Claude Opus 4.8 — Anthropic's most capable model for complex reasoning and agentic coding. OpenAI-compatible /api/v1/chat/completions on reapi.ai with 1M context, 128K max output, vision input, and prompt caching.
- Vendor: Anthropic
- Category: chat
- Wire model id: `claude-opus-4-8`
- Endpoint: `POST https://reapi.ai/api/v1/chat/completions` (Bearer auth; synchronous, OpenAI-compatible — no task polling)
- Landing page: https://reapi.ai/models/claude-opus-4-8
- API key: create one at https://reapi.ai/settings/apikeys and send it as `Authorization: Bearer rk_live_...`

## Pricing

Current reAPI prices from the same quote as the model page, in USD. 1 credit = $0.001. Successful delivered requests are settled from actual usage/cost; no per-request whole-credit rounding is applied to token prices. No task polling or automatic retry is required.
- reAPI price quote fetched at: 2026-10-14T09:23:23.423Z (UTC).
- Price refresh interval: 300 seconds. Fetch this URL again after the cache expires to obtain updated prices and discounts.

### Official price comparison

Official reference: [Anthropic pricing](https://platform.claude.com/docs/en/about-claude/pricing), checked 2026-10-09. Standard input and output tokens, USD per 1 million tokens; not Batch, Priority, cache, or long-context pricing.

| Token type | Official price / 1M | Current reAPI price / 1M | Discount vs official |
| --- | ---: | ---: | ---: |
| Input | $5 | $2.8 | 44% |
| Output | $25 | $14 | 44% |

Claude Opus 4.8 is currently 44% off official pricing for standard input and output tokens. Formula: (1 - current reAPI rate / official rate) × 100. This discount is already included in the reAPI prices; do not apply it again.

Cache reads, cache writes and any long-context tiers have their own published rates below. Do not assume the input/output discount applies to them. Official reference prices have a separate verification date; current reAPI prices refresh at the interval above.

- tokens / input: $2.8 per 1M tokens
- tokens / output: $14 per 1M tokens

## Calling this model

Synchronous and OpenAI-compatible: point any OpenAI SDK at the base URL below and use the wire model id. Responses return in the same HTTP call — there is no task id and nothing to poll.

- Base URL: `https://reapi.ai/api/v1`

## Input schema

Kept 1:1 with the live request validator; constraints are enforced server-side too. All media inputs are public HTTP(S) URLs — base64 and `data:` URIs are rejected platform-wide.

- `messages` (string, required) — OpenAI-style chat message array
- `stream` (boolean, optional, default false) — Stream the response as server-sent events
- `temperature` (string, optional, default "1")
- `top_p` (string, optional, default "1")
- `max_tokens` (string, optional, default "4096") — Upper bound on generated tokens

## Example request

```json
{
  "model": "claude-opus-4-8",
  "messages": [
    {
      "role": "user",
      "content": "Hello"
    }
  ],
  "stream": true,
  "max_tokens": 4096,
  "temperature": 0.7
}
```

## Usage examples

### cURL

```bash
curl https://reapi.ai/api/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-opus-4-8",
    "messages": [
      { "role": "user", "content": "Hello" }
    ],
    "stream": true,
    "max_tokens": 4096,
    "temperature": 0.7
  }'
```

### Python (OpenAI SDK)

```python
from openai import OpenAI

client = OpenAI(base_url="https://reapi.ai/api/v1", api_key="YOUR_API_KEY")
response = client.chat.completions.create(
    model="claude-opus-4-8",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
```

### JavaScript (OpenAI SDK)

```javascript
import OpenAI from 'openai';

const client = new OpenAI({ baseURL: 'https://reapi.ai/api/v1', apiKey: 'YOUR_API_KEY' });
const response = await client.chat.completions.create({
  model: 'claude-opus-4-8',
  messages: [{ role: 'user', content: 'Hello!' }],
});
console.log(response.choices[0].message.content);
```

## Other agent-readable surfaces

This file covers one model. To find anything else:

- Full API reference (markdown, incl. task-type constraints and error semantics): https://reapi.ai/docs/claude-opus-4-8.md
- Platform index: https://reapi.ai/llms.txt
- Machine-readable API spec (OpenAPI): https://reapi.ai/openapi.json · agent skills index: https://reapi.ai/.well-known/agent-skills/index.json
- Authentication guide: https://reapi.ai/auth.md
- Full documentation and blog as one file: https://reapi.ai/llms-full.txt
- Any other model: `https://reapi.ai/models/<slug>/llms.txt` — every model page serves this same agent-readable form.
