Yasminaai PHP Library
Table of Contents
Requirements
This SDK requires PHP ^8.1.Installation
Usage
Instantiate and use the client with the following:Environments
This SDK allows you to configure different environments for API requests.Environments::SandboxEnvironments::Production
Advanced
Custom Client
This SDK is built to work with any HTTP client that implements the PSR-18ClientInterface.
By default, if no client is provided, the SDK will use php-http/discovery to find an installed HTTP client.
However, you can pass your own client that adheres to ClientInterface:
Retries
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long as the request is deemed retryable and the number of retry attempts has not grown larger than the configured retry limit (default: 2). A request is deemed retryable when any of the following HTTP status codes is returned: TheretryStatusCodes configuration controls which 5XX status codes are retried:
legacy(default): Retries408,429, and all>= 500recommended: Retries408,429,502,503,504only (excludes500 Internal Server Errorto avoid retrying non-idempotent failures)
maxRetries request option to configure this behavior.
Timeouts
The SDK defaults to a 30 second timeout. Use thetimeout option to configure this behavior.

