Prepare the runtime
The Agent SDK does not yet have a public Go module version. Follow the source installation instructions.
Quickstart
What it ships
CreateAgent(...)
DefineTool(...)
CreateGatewayAgentClient(...)
- a bounded tool loop over the Phaseo
responses API
Advanced runtime
Go supports validators and approvals, HITL and manual tools, progress, recoverable errors, replayable channels, stop helpers, dynamic turns, persisted NextTurnParams, normalized usage/cost, and StateAccessor.
Streaming and cancellation
Agent.Stream(...) and Agent.ContinueStream(...) consume the gateway’s Responses SSE stream. Read Text() or Events() more than once when separate consumers need replay, and call Cancel() to cancel the request context. Completed steps retain request IDs, provider metadata, finish reasons, warnings, usage, and cost.
Last modified on July 26, 2026