Agents

Run the agent's prompt, model and knowledge base against a message and return the reply instead of delivering it. Nothing is delivered and no execution is recorded.

Billed like a live reply. On an agent with the zavu provider the run 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. cost on the response is what it charged. Runs are rate limited per project (429).

Tools. By default the model is offered the agent's enabled tools but none is run: if it picks one, the reply stops there and plannedToolCalls says which, with what arguments. Set executeTools to run them — that reaches your real handlers, with whatever they cost and change — and read executedToolCalls.

Test-mode keys are billed the same way, and executeTools with one still reaches your real handlers and writes real memory: a test run is not sandboxed by the key's mode.

post/v1/agents/{agentId}/test

Request

  • Base URL
    https://api.zavu.dev
  • URL
    https://api.zavu.dev/v1/agents/{agentId}/test
  • Auth
    HTTP bearer

Path parameters

agentIdstring required

Agent ID.

Request body

messagestring required

What to say to the agent.

useKnowledgeBaseboolean

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

executeToolsboolean

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.

Example request

{
  "message": "Where is order ORD-12345?"
}

Response

The agent's reply.

successboolean required
textstring nullable required

What the agent would reply.

errorstring nullable required
inputTokensinteger required
outputTokensinteger required
latencyMsinteger required
knowledgeChunksUsedinteger required

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

warningsstring[] 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.
costnumber required

USD charged to your balance for this run. 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.

Changes

    • info

      added the non-success response with the status

    • info

      added the non-success response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the new optional request property

    • info

      added the optional property to the response with the status