What's Changed
- Response Object: Added
getLastResponse()returning aResponseobject with->status(),->ok(),->headers(),->header($name),->body(), and->json()for easy inspection without manualjson_decode(). - Exception Handling: Added
setThrowOnError(true)andOpenAiExceptionfor throwing on HTTP 4xx/5xx responses with status code, error type, and error code. - Automatic Retries: Added
setRetries(maxRetries, baseDelayMs)with exponential backoff, jitter, andRetry-Afterheader support for rate limits (429) and transient server errors (5xx on idempotent methods). - Static Analysis & Types: Added PHPStan (level 5) and typed PHPDoc shape annotations on core methods while strictly preserving PHP 7.4+ compatibility with zero runtime dependencies.
- Decisions Usage: Added
getDecisionsUsage()reporting endpoint. - Pure Tests: Removed mock echo-server tests in favor of pure in-memory unit tests and real API tests.
Full Changelog: 6.2.0...6.3.0