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
responsesAPI
Advanced runtime
Go supports validators and approvals, HITL and manual tools, progress, recoverable errors, replayable channels, stop helpers, dynamic turns, persistedNextTurnParams, 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.