Beta capabilities, streaming and webhooks
The generated client covers every operation in the Claude API specification, including the beta surface: Managed Agents (agents, environments, sessions, threads, deployments, vaults, memory stores), Skills, Files, Message Batches, the Admin API, analytics, RBAC, spend limits, tunnels and webhook endpoints. This guide covers the parts that need more than a generated method call.
Beta flags
Every beta capability is gated on the anthropic-beta header. Pass the flags you need to any
Beta* method; the values are a typed enum, so the wire value cannot drift:
1 2 3 4 5 6 7 8 9 10 11 | |
AnthropicBetaEnum carries the full published set — fast mode, task budgets, compaction, context
management, cache diagnosis, message threads, server-side fallbacks, thinking display updates,
mid-conversation output config, Managed Agents, webhooks and the rest. Several flags can be sent at
once; they are joined with commas.
Streaming
| Method | Endpoint | Use for |
|---|---|---|
CreateMessageAsStreamAsync |
POST /v1/messages |
Ordinary streaming |
CreateBetaMessageAsStreamAsync |
POST /v1/messages (beta) |
Streaming plus any beta flag |
StreamSessionEventsAsStreamAsync |
GET /v1/sessions/{id}/events/stream |
A Managed Agents session's event log |
StreamSessionThreadEventsAsStreamAsync |
GET /v1/sessions/{id}/threads/{id}/stream |
One session thread |
The specification describes these responses as plain JSON, so the generated methods cannot expose them as streams — these four hand-written overloads consume them as the server-sent event streams they are.
1 2 3 4 5 6 7 8 9 10 11 | |
Managed Agents sessions stream their whole lifecycle — agent messages and thinking, tool use and tool results, span and workflow events, session status changes:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
The managed-agents-2026-04-01 flag is sent by default on both session stream methods.
Webhooks
Deliveries carry webhook-id, webhook-timestamp and webhook-signature; the signed content is
{id}.{timestamp}.{body}, HMAC-SHA256 under the endpoint's whsec_ signing secret, and anything
older than five minutes is rejected.
1 2 3 4 5 6 7 8 9 10 11 | |
Verify the body exactly as it arrived — re-serializing the JSON changes the bytes and invalidates
the signature. Payloads are thin on purpose: they carry the event type and resource ids, so fetch
the resource to read its current state. AnthropicWebhooks.CreateVerifier returns the verifier on
its own when you want to verify without parsing.