Skip to main content

Install

composer require phaseo/php-sdk phaseo/agent-sdk-php

Quickstart

<?php
require "vendor/autoload.php";

use Phaseo\AgentSdk\AgentDefinition;
use Phaseo\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 Phaseo responses API
Last modified on July 9, 2026