ClaudeMap

Anthropic SDK for PHP

Official Anthropic PHP SDK for the Claude API.

SDKs & Toolingofficialsdkphpclaude-api

PHP client for the Claude Messages API and Batch API. Targets PHP 8.1+ with strict typing and PSR-18 transport abstraction so you can plug in Guzzle, Symfony HttpClient, or any PSR-18 client.

What it does

  • Official Anthropic SDK for PHP, installed as anthropic-ai/sdk via Composer (README pins ^0.57.0)
  • Streaming responses over Server-Sent Events (SSE) out of the box
  • MessageAccumulator folds streamed events into the message they build up to — text concatenated, tool inputs assembled from their JSON chunks, usage totals merged
  • Value objects for API payloads rather than bare arrays

When to use it

For PHP 8.1+ services that need Claude with proper streaming — the accumulator handles the SSE reassembly so your handler only sees the assembled message.

Getting started

composer require "anthropic-ai/sdk:^0.57.0"

# the README also shows the HTTP layer dependency:
composer require guzzlehttp/guzzle

Things to know

Guzzle appears as a separate require in the README's install steps — bring your own PSR-18 client if you are not on Guzzle.

Repository

anthropics/anthropic-sdk-php

Charted

Related on the map

  • Harness Bridge

    SDK / Tool

    A local launcher that points Claude Code and seven other coding harnesses at any OpenAI-, Anthropic- or Responses-compatible endpoint — without editing a single config file.

    • launcher
    • local-models
    • cli
    • menu-bar
  • Claude for Siri

    SDK / Tool

    Answers macOS Spotlight and Siri prompts with your signed-in Claude Code account — an experimental macOS 27 model-delegation provider.

    • macos
    • siri
    • spotlight
    • model-delegation
  • Extract your own local chat history from ten AI coding assistants into one normalized JSONL — for fine-tuning, analytics, or backing up years of conversations. Standard library only.

    • cli
    • data-export
    • jsonl
    • backup