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

# API reference

> Reference the main Go Agent SDK types and methods.

| API                             | Purpose                              |
| ------------------------------- | ------------------------------------ |
| `CreateAgent(...)`              | Define an agent                      |
| `DefineTool(...)`               | Define a local or manual tool        |
| `CreateGatewayAgentClient(...)` | Connect model turns to Phaseo        |
| `Agent.Run(...)`                | Run to a terminal or paused state    |
| `Agent.Stream(...)`             | Run with replayable stream consumers |
| `Agent.Continue(...)`           | Continue saved or paused state       |
| `StreamResult.Result()`         | Read the completed run               |
| `StreamResult.Text()`           | Read text deltas                     |
| `StreamResult.Events()`         | Read all events                      |
| `StreamResult.Cancel()`         | Cancel the active run                |

Important types include `AgentDefinition`, `RunOptions`, `RunResult`, `RunRecord`, `RunStep`, `Tool`, `ToolDecision`, `ToolOutput`, `RuntimeContext`, `StateAccessor`, `ModelRetryConfig`, and `ToolExecutionConfig`.

## Related

* [Build your first agent](./agent-sdk)
* [Observability and DevTools](./agent-sdk-observability)
