anth-core-workflow-b

Featured

Build Claude streaming and Message Batches API workflows. Use when implementing real-time streaming responses, SSE event handling, or processing bulk requests with the 50% cheaper Batches API. Trigger with phrases like "claude streaming", "anthropic batch", "message batches api", "SSE events anthropic", "stream claude response".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Anthropic Core Workflow B — Streaming & Batches ## Overview Two complementary patterns: real-time streaming for interactive UIs (SSE events via `POST /v1/messages` with `stream: true`) and the Message Batches API (`POST /v1/messages/batches`) for processing up to 100,000 requests asynchronously at 50% cost reduction. ## Prerequisites - Completed `anth-install-auth` setup - Familiarity with `anth-core-workflow-a` (Messages API basics) - For batches: understanding of async/polling patterns ## Instructions ### Streaming — Python SDK ```python import anthropic client = anthropic.Anthropic() # Method 1: High-level streaming (recommended) with client.messages.stream( model="claude-sonnet-4-20250514", max_tokens=2048, messages=[{"role": "user", "content": "Write a short story about a robot."}] ) as stream: for text in stream.text_stream: print(text, end="", flush=True) # After stream completes, access full message final_message = stream.get_final_message() print(f"\nUsage: {final_message.usage.input_tokens}+{final_message.usage.output_tokens}") # Method 2: Event-level streaming (for custom event handling) with client.messages.stream( model="claude-sonnet-4-20250514", max_tokens=2048, messages=[{"role": "user", "content": "Explain REST APIs."}] ) as stream: for event in stream: if event.type == "content_block_delta": if event.delta.type == "text_delta": print(event.delta.text, end="")...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

anth-webhooks-events

Implement event-driven patterns with Claude API: streaming SSE events, Message Batches callbacks, and async processing architectures. Use when building real-time Claude integrations or processing batch results. Trigger with phrases like "anthropic events", "claude streaming events", "anthropic async processing", "claude batch callbacks".

2,266 Updated today
jeremylongshore
AI & Automation Featured

clade-webhooks-events

Use Anthropic Message Batches for async bulk processing and event handling. Use when working with webhooks-events patterns. Trigger with "anthropic batches", "claude batch api", "anthropic async", "bulk claude processing", "anthropic webhook".

2,266 Updated today
jeremylongshore
AI & Automation Solid

claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

199,464 Updated today
affaan-m
AI & Automation Solid

clade-core-workflow-a

Redirect to claude-model-inference for Messages API streaming, vision, and structured output patterns. Use when looking for the primary Anthropic workflow. Trigger with "anthropic workflow", "claude main workflow".

2,266 Updated today
jeremylongshore
AI & Automation Listed

claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

0 Updated today
CodeWithBehnam