OpenAI’s o-series models (o1, o3, o4-mini, and others) support aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/phpaisdk/openai/llms.txt
Use this file to discover all available pages before exploring further.
reasoning_effort parameter that controls how much compute the model spends on internal chain-of-thought reasoning before producing a response. More effort generally yields higher-quality answers at the cost of latency and tokens. The PHP AI SDK exposes this through the portable Reasoning::effort() helper, which maps cleanly onto OpenAI’s native reasoning_effort field.
Setting Reasoning Effort
Pass aReasoning::effort() instance to the ->reasoning() method on your generation request. The SDK writes the value directly to reasoning_effort in the Chat Completions request body.
Effort Levels
OpenAI accepts three named effort levels. Choose based on your latency and quality requirements.| Level | Description |
|---|---|
low | Faster, less thorough — best for simple tasks where speed matters |
medium | Balanced — a sensible default for most reasoning workloads |
high | Slower, most thorough — best for complex multi-step problems |
Token Budget Limitation
The following code will throw an exception:Accessing Reasoning Tokens
After a successful call, the number of tokens consumed by the model’s internal reasoning is available on the usage object. The SDK reads this fromcompletion_tokens_details.reasoning_tokens in the API response.
$result->usage->reasoningTokens is an integer when the field is present in the API response, or null when the model does not report it.
Compatible Models
The following model patterns registered in the OpenAI provider carry thereasoning capability. Any model whose ID matches one of these patterns supports Reasoning::effort().
| Model Pattern | Notes |
|---|---|
o* | All o-series models — o1, o3, o4-mini, and future variants |
gpt-5* | GPT-5 family and all its variants |
Reasoning streaming is supported —
ReasoningDeltaPart chunks are emitted during a stream and contain the model’s internal reasoning text. Use ->stream() on your generation request to receive them incrementally.