> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orqex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install and configure the official PHP SDK.

The PHP SDK wraps the Orchestrate API: typed responses, automatic retries on transient failures,
and idempotency handled for you.

## Requirements

* PHP 8.3 or later
* The `json` extension

## Install

```bash theme={null}
composer require orqex/orchestrate-php
```

## Configure

Pass your secret key. The key decides the environment — see
[Authentication](/authentication).

```php theme={null}
use Orqex\Orchestrate\OrchestrateClient;

$orqex = new OrchestrateClient(getenv('ORCHESTRATE_SECRET_KEY'));
```

For finer control, pass an array instead:

```php theme={null}
$orqex = new OrchestrateClient([
    'api_key'         => getenv('ORCHESTRATE_SECRET_KEY'),
    'base_uri'        => 'https://api.orqex.com/v1',
    'timeout'         => 30,
    'connect_timeout' => 10,
    'max_retries'     => 2,
]);
```

`max_retries` applies to connection errors, `429` and `5xx` responses, with exponential
backoff. The idempotency key is preserved across retries, so a retried write cannot create a
duplicate.

<Note>
  On Laravel, do not construct the client by hand — see
  [Laravel integration](/sdk/php/laravel).
</Note>

## Verify

```php theme={null}
$rates = $orqex->exchangeRates()->latest('USD');
```

A successful call returns a typed object. A failure throws — see
[Usage](/sdk/php/usage#errors).

<Card title="Source and releases" icon="github" href="https://github.com/orqex/orchestrate-php">
  orqex/orchestrate-php
</Card>
