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

# Usage

> Run a minimal local agent loop on top of AI Stats Gateway with the PHP Agent SDK.

## Install

```bash theme={null}
composer require ai-stats/php-sdk ai-stats/agent-sdk-php
```

## Quickstart

```php theme={null}
<?php
require "vendor/autoload.php";

use AIStats\AgentSdk\AgentDefinition;
use AIStats\AgentSdk\AgentSdk;

$agent = AgentSdk::createAgent(new AgentDefinition(
    id: "quickstart-agent",
    model: "openai/gpt-5.4-nano",
    instructions: "Answer concisely and helpfully."
));

$result = $agent->run(
    input: "Give me one fun fact about cURL.",
    client: AgentSdk::createGatewayAgentClient()
);

echo $result->output . PHP_EOL;
```

## What it ships

* `AgentSdk::createAgent(...)`
* `AgentSdk::defineTool(...)`
* `AgentSdk::createGatewayAgentClient(...)`
* a bounded tool loop over the AI Stats `responses` API

## Related

* [Agent SDK overview](../agent-sdk/overview.mdx)
* [TypeScript Agent SDK](../typescript/agent-sdk.mdx)
