Documentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/core/llms.txt
Use this file to discover all available pages before exploring further.
aisdk/core gives PHP developers a single, expressive API for interacting with any AI provider. One fluent interface covers text generation, streaming, tool calling, structured output, image generation, and reasoning — with full PSR-7/17/18 compatibility and zero framework lock-in.
Installation
Install via Composer and get your first response in minutes
Quickstart
A working end-to-end example to get you up and running fast
Core Concepts
Understand the Generate facade, models, and capability system
API Reference
Full reference for every class, method, and enum
What you can build
Text Generation
Generate text with any provider model using a single fluent call
Streaming
Stream responses token-by-token with chunk, finish, and error hooks
Tool Calling
Define tools inline or as classes; the SDK handles the agentic loop
Structured Output
Extract typed JSON objects using the Schema builder
Image Generation
Generate and save images with portable size and aspect ratio options
Reasoning
Enable thinking mode with effort levels or exact token budgets
Get started in three steps
aisdk/core is provider-agnostic. It ships contracts, value objects, and the fluent API — actual HTTP calls are handled by separate provider packages such as aisdk/openai and aisdk/anthropic.