Skip to main content
POST /api/hermesco/agent
Runs one turn of the agent. Hermes 4 405B reasons over the message and history, drives tools through <tool_call>, and the server loops until the task is done or a spend is awaiting approval.

Request body

message
string
required
The directive for the agent.
workspaceId
string
default:"demo"
The workspace to operate in. Isolates Treasury, proposals, and the agent body.
history
ChatMessage[]
Prior conversation turns, each { role: "user" | "assistant", content: string }. Lets Hermes keep context across directives.

Response

Returns an AgentTurnResult.
events
AgentEvent[]
The ordered trace of the turn: thoughts, tool calls, tool results, proposals, awaiting-approval, and errors.
assistant
string
Hermes’s final message to the operator.
awaitingApproval
boolean
True when a spend is held for a human decision.
state
TreasuryState
The live Treasury state after the turn.

Example

curl -s https://hermesco.ai/api/hermesco/agent \
  -H "content-type: application/json" \
  -d '{
    "workspaceId": "g_demo",
    "message": "Propose a $120/mo GPU server. Route it through the Treasury first."
  }' | jq
A 120spendisoverthe120 spend is over the 50 per-action cap, so the response will show a propose_spend tool call, a blocked safety verdict, and a Treasury state with the balance unchanged at $0.

Errors

StatusCondition
400message is missing, or the body is not valid JSON.
500An unexpected error during the turn (the message is returned in error).