🤖 AI Summary
Claude PHP SDK is a new, framework-agnostic, PSR-compliant client for the Anthropic Claude API that delivers full API parity (Messages, Files, Batches, Models) and comprehensive documentation parity with 29 example files (6,675+ lines) covering 27 Claude docs pages. It’s production-ready: PSR-12 code style, PSR-11 DI patterns, Laravel/Symfony integration guides, tests, linting, and Docker support. Install with composer require claude-php/claude-php-sdk.
Technically rich, the SDK supports Claude Sonnet 4.5, Haiku 4.5, and Opus 4.1, plus advanced capabilities such as streaming SSE, tool use and tool runners, vision/multimodal inputs, embeddings, extended-thinking contexts (1K–32K tokens), batch processing (claimed ~50% cost savings), token counting, and structured outputs with live streaming validation. It’s async-ready (Amphp), exposes helper value objects for parsed message content and SSE events, and maps a comprehensive exception hierarchy (RateLimitError, AuthenticationError, APIConnectionError, APIStatusError) consistent with the Python SDK. Beta features are supported via a beta() namespace and the anthropic-beta header, enabling prompt-caching, structured-outputs, and other experimental patterns. For PHP teams building agents, RAG systems, or production integrations, this SDK significantly lowers friction by offering full-featured tooling, tested examples, and idiomatic PHP patterns for robust error handling and async workflows.
Loading comments...
login to comment
loading comments...
no comments yet