# Claude Sonnet 4.6 API

> Claude Sonnet 4.6 — frontier reasoning and generation through one API.

- **Provider**: Anthropic
- **Model id**: `claude-sonnet-4-6`
- **Modality**: text
- **Price**: 153.67–770.2 credits

## Overview

Claude Sonnet 4.6 is called in two steps: create a generation task, then poll the task until the result is ready.

## Authentication

All requests require a Bearer Token in the request header:

```
Authorization: Bearer YOUR_API_KEY
```

## Create Task

`POST https://you.bot/api/v1/generate`

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| modelId | string | Yes | Model id: `claude-sonnet-4-6` |
| input | object | Yes | Input parameters object (see below) |
| callbackUrl | string | No | https URL to receive a signed webhook on completion |

### input object parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| prompt | string | Yes | Text value (default: Write a punchy, memorable product tagline for a solar-powered hiking backpack, then explain your reasoning in one crisp line.) |
| memory | boolean | No | Automatically append previous messages to maintain multi-turn context. May increase token usage. (true/false) (default: false) |
| function_calling | boolean | No | Lets you define functions that Gemini can call (true/false) (default: false) |
| thinking | boolean | No | Include the model's thinking process in the response (true/false) (default: true) |
| max_tokens | number | No | Optional Claude output token limit. Leave empty to use the default of 4096. (range 1-128000) |
| stream | boolean | No | Turn off to get a single non-streaming response. (true/false) (default: true) |
| system | string | No | System instruction for the model. Defaults to "You are Claude Sonnet 4.6, developed by Anthropic." when omitted. |

### Request example

```json
{
  "modelId": "claude-sonnet-4-6",
  "input": {
    "prompt": "Explain how diffusion models generate images, in two short sentences.",
    "memory": false,
    "function_calling": false,
    "thinking": true,
    "max_tokens": 1,
    "stream": true
  }
}
```

### Response example

```json
{
  "taskId": "281e5b0…f39b9",
  "creditsCharged": 24
}
```

## Query Task

`GET https://you.bot/api/v1/task/{taskId}?model=claude-sonnet-4-6`

When `state` is `success`, the output is in `resultUrls`: `{ "text": "…" }`. (Text models return inline in the create response.)

## Error Codes

| Code | Description |
|------|-------------|
| 200 | Request successful |
| 400 | Invalid request parameters |
| 401 | Authentication failed, check API Key |
| 402 | Insufficient account balance |
| 422 | Parameter validation failed |
| 429 | Request rate limit exceeded |
| 500 | Internal server error |
