← Back to daily report

api/beta-headers.md

Changed on 2026-02-05 12:43:36 EST

+6 lines added
-6 lines removed
Visual Diff
# Beta headers¶

Documentation for using beta headers with the Claude API¶

---¶

Beta headers allow you to access experimental features and new model capabilities before they become part of the standard API. ¶

These features are subject to change and may be modified or removed in future releases.¶

<Info>¶
Beta headers are often used in conjunction with the [beta namespace in the client SDKs](/docs/en/api/client-sdks#beta-namespace-in-client-sdks)¶
</Info>¶

## How to use beta headers¶

To access beta features, include the `anthropic-beta` header in your API requests:¶

```http¶
POST /v1/messages¶
Content-Type: application/json¶
X-API-Key: YOUR_API_KEY¶
anthropic-beta: BETA_FEATURE_NAME¶
```¶

When using the SDK, you can specify beta headers in the request options:¶

<CodeGroup>¶

```python Python¶
from anthropic import Anthropic¶

client = Anthropic()¶

response = client.beta.messages.create(¶
model="claude-
sonnetopus-4-56",¶
max_tokens=1024,¶
messages=[¶
{"role": "user", "content": "Hello, Claude"}¶
],¶
betas=["
beta-feature-namecode-execution-2025-08-25"]¶
)¶
```¶

```typescript TypeScript¶
import Anthropic from '@anthropic-ai/sdk';¶

const anthropic = new Anthropic();¶

const msg = await anthropic.beta.messages.create({¶
model: 'claude-
sonnetopus-4-56',¶
max_tokens: 1024,¶
messages: [¶
{ role: 'user', content: 'Hello, Claude' }¶
],¶
betas: ['
beta-feature-namecode-execution-2025-08-25']¶
});¶
```¶

```bash cURL¶
curl https://api.anthropic.com/v1/messages \¶
-H "x-api-key: $ANTHROPIC_API_KEY" \¶
-H "anthropic-version: 2023-06-01" \¶
-H "anthropic-beta:
beta-feature-namecode-execution-2025-08-25" \¶
-H "content-type: application/json" \¶
-d '{¶
"model": "claude-
sonnetopus-4-56",¶
"max_tokens": 1024,¶
"messages": [¶
{"role": "user", "content": "Hello, Claude"}¶
]¶
}'¶
```¶

</CodeGroup>¶

<Warning>¶
Beta features are experimental and may:¶
- Have breaking changes without notice¶
- Be deprecated or removed¶
- Have different rate limits or pricing¶
- Not be available in all regions¶
</Warning>¶

### Multiple beta features¶

To use multiple beta features in a single request, include all feature names in the header separated by commas:¶

```http¶
anthropic-beta: feature1,feature2,feature3¶
```¶

### Version naming conventions¶

Beta feature names typically follow the pattern: `feature-name-YYYY-MM-DD`, where the date indicates when the beta version was released. Always use the exact beta feature name as documented.¶

## Error handling¶

If you use an invalid or unavailable beta header, you'll receive an error response:¶

```json¶
{¶
"type": "error",¶
"error": {¶
"type": "invalid_request_error",¶
"message": "Unsupported beta header: invalid-beta-name"¶
}¶
}¶
```¶

## Getting help¶

For questions about beta features:¶

1. Check the documentation for the specific feature¶
2. Review the [API changelog](/docs/en/api/versioning) for updates¶
3. Contact support for assistance with production usage¶

Remember that beta features are provided "as-is" and may not have the same SLA guarantees as stable API features.

Unified Diff

--- a/api/beta-headers.md
+++ b/api/beta-headers.md
@@ -33,12 +33,12 @@
 client = Anthropic()
 
 response = client.beta.messages.create(
-    model="claude-sonnet-4-5",
+    model="claude-opus-4-6",
     max_tokens=1024,
     messages=[
         {"role": "user", "content": "Hello, Claude"}
     ],
-    betas=["beta-feature-name"]
+    betas=["code-execution-2025-08-25"]
 )
 ```
 
@@ -48,12 +48,12 @@
 const anthropic = new Anthropic();
 
 const msg = await anthropic.beta.messages.create({
-  model: 'claude-sonnet-4-5',
+  model: 'claude-opus-4-6',
   max_tokens: 1024,
   messages: [
     { role: 'user', content: 'Hello, Claude' }
   ],
-  betas: ['beta-feature-name']
+  betas: ['code-execution-2025-08-25']
 });
 ```
 
@@ -61,10 +61,10 @@
 curl https://api.anthropic.com/v1/messages \
   -H "x-api-key: $ANTHROPIC_API_KEY" \
   -H "anthropic-version: 2023-06-01" \
-  -H "anthropic-beta: beta-feature-name" \
+  -H "anthropic-beta: code-execution-2025-08-25" \
   -H "content-type: application/json" \
   -d '{
-    "model": "claude-sonnet-4-5",
+    "model": "claude-opus-4-6",
     "max_tokens": 1024,
     "messages": [
       {"role": "user", "content": "Hello, Claude"}