Skip to main content
POST
Test an agent

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

agentId
string
required

Agent ID.

Body

application/json

Run the agent and return what it would say. Nothing is delivered to anyone and no execution is recorded.

A run is billed like a live reply: on an agent with the zavu provider it is charged to your balance at the same price per token, and refused with 402 insufficient_balance at a balance of zero. On a bring-your-own-key agent it costs your provider, not Zavu. cost on the response is what this run charged.

message
string
required

What to say to the agent.

Example:

"Where is order ORD-12345?"

history
object[]

Prior turns, oldest first, to exercise multi-turn behaviour without persisting a thread. Trimmed to the agent's context window.

useKnowledgeBase
boolean
default:true

Set false to skip retrieval and isolate prompt behaviour from the knowledge base.

executeTools
boolean
default:false

Run the tools the agent calls instead of reporting the choice and stopping.

Off by default because a tool handler talks to the outside world: a rehearsal that charges a card is not a rehearsal. Turn it on to exercise the loop that actually matters — the model picks a tool, the handler answers, the model replies with the result — without sending a message to anyone. What ran comes back in executedToolCalls.

Response

The agent's reply. Nothing was delivered.

success
boolean
required
text
string | null
required

What the agent would reply.

error
string | null
required
inputTokens
integer
required
outputTokens
integer
required
latencyMs
integer
required
knowledgeChunksUsed
integer
required

Knowledge-base chunks retrieved for this message. Zero means the answer was not grounded in your documents.

warnings
string[]
required

Things that are true of this agent but that a dry run cannot prove. Surfaced so a passing dry run is never mistaken for proof that the agent works live.

  • The agent being disabled.
  • Enabled tools that were offered to the model but not run: if the agent picks one, the reply stops at that choice (see plannedToolCalls). Pass executeTools to run them.
  • Tools that ran for real, when executeTools was set, and any that failed.
  • An agent whose sender has none of the channels it triggers on, which answers every dry run and no real message.
  • Contact metadata that exists on a real conversation but not here, and memory tools (remember, recall, save_record), which have no contact to write about on a test run.
cost
number
required

USD charged to your balance for this run, rounded to 6 decimals. 0 on a bring-your-own-key agent. When the balance covers only part of a run, that part is charged and the next run is refused with 402.

plannedToolCalls
object[]
required

Tools the model chose to call, with the arguments it chose, on a run without executeTools. Nothing was executed: the reply stops at the choice. Empty when it answered without reaching for a tool, and on a run that executed tools (see executedToolCalls).

executedToolCalls
object[]

Tools that actually ran, in order, when the request set executeTools. Empty on a normal dry run, where nothing is executed. An entry with ok: false means the agent saw an error and answered around it, which is what a customer would have received.