Download the PHP package aisdk/anthropic without Composer
On this page you can find all versions of the php package aisdk/anthropic. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package anthropic
aisdk/anthropic
Official Anthropic provider for the PHP AI SDK.
Installation
Basic Usage
Default model shorthand:
Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
ANTHROPIC_API_KEY |
API key for authentication | Required |
ANTHROPIC_BASE_URL |
Base URL for API requests | https://api.anthropic.com/v1 |
ANTHROPIC_VERSION |
API version header | 2023-06-01 |
Programmatic Configuration
Supported Capabilities
| Capability | Support |
|---|---|
| Text generation | Native |
| Streaming | Native |
| Tool calling | Native |
| Structured output | Adapted (forced tool use) |
| Reasoning | Native (thinking blocks) |
| Text input | Native |
| Image input | Native |
| File input | Native (documents) |
Streaming
Structured Output
Anthropic does not natively support json_schema response format. Structured output is adapted through forced tool use:
Reasoning
Tools
Model IDs and Capabilities
Anthropic model IDs pass through unchanged and do not need to be registered. The package does not ship a model inventory; the Anthropic API remains the authority on whether a particular model accepts a requested feature.
Capabilities describe what the Anthropic adapter can serialize. The Anthropic API returns a normalized SDK exception if the selected model or requested feature is rejected.
Provider-Specific Options
Raw provider options can be passed as an escape hatch:
Testing
Documentation
Community
- Contributing
- Support
- For private security reports, email [email protected].
Stored files (0.10.0 preparation)
Anthropic::files() implements core FileStoreInterface for upload, metadata retrieval, paginated listing, download and deletion. Uploads have no OpenAI-style purpose field. The current Files documentation uses the normal anthropic-version header without a Files beta header.
Use Content::storedFile($stored->reference) for documents or Content::storedFile($stored->reference, image: true) for images. Both map to native source.type=file blocks. Downloads are permitted by Anthropic only for files created by hosted tools; uploaded inputs have downloadable=false. File references are workspace-wide: enforce user ownership in your application before exposing any file operation.
Sources: Files, PDF support, vision. Upload acceptance and model input acceptance are separate; file formats and model compatibility remain provider-owned.