Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/phpaisdk/anthropic/llms.txt

Use this file to discover all available pages before exploring further.

aisdk/anthropic is the official Anthropic provider for the PHP AI SDK. It bridges your PHP application to Anthropic’s Claude models through the shared aisdk/core abstractions, giving you text generation, streaming, tool calling, structured output, and reasoning — all through a consistent, provider-agnostic API. The package requires PHP 8.3+ and aisdk/core ^0.2, and integrates with any PSR-18-compatible HTTP client.

Quickstart

Install the package and make your first Claude API call in under five minutes.

Configuration

Set API keys, base URLs, version headers, and custom HTTP headers.

Capabilities

Explore text generation, streaming, tool calling, and more.

API Reference

Full reference for every class and method in the Anthropic provider.

Supported Capabilities

Every capability listed below is available on all Claude models registered in the package. The support level describes how the provider implements each feature — “Native” means the Anthropic API handles it directly; “Adapted” means the SDK wraps the API to deliver the feature.
CapabilitySupport Level
Text generationNative
StreamingNative
Tool callingNative
Structured outputAdapted (forced tool use)
ReasoningNative (thinking blocks)
Text inputNative
Image inputNative
File inputNative (documents)
Structured output on Anthropic models is delivered by injecting a hidden tool and forcing the model to call it with the exact schema you provide. This is transparent to your application — you call ->output() exactly as you would with any other provider.

Requirements

Before installing aisdk/anthropic, make sure your environment satisfies the following:
  • PHP ^8.3
  • aisdk/core ^0.2 (pulled in automatically by Composer)
  • A PSR-18 HTTP client registered in your application (e.g. Guzzle, Symfony HTTP Client, or any discovery-compatible adapter)

Build docs developers (and LLMs) love