API ReferencePublisher Tests

Test the current draft

POST
/v1/publisher/agents/{agent_id}/test-runs

Runs the current draft without releasing it. Send the ETag from the latest draft response so the test uses the expected revision.

Authorization

bearerAuth
AuthorizationBearer <token>

Send a SimpleServe API key as Authorization: Bearer <key>.

In: header

Path Parameters

agent_id*string

Publisher-owned agent ID.

Match^agent_[A-Za-z0-9]+$

Header Parameters

If-Match*string

ETag from the latest draft response.

Match^"draft-[1-9][0-9]*"$
Idempotency-Key?string

Prevents duplicate work and charges when a request is retried. Reusing a key with a different request returns 409 idempotency_conflict.

Length8 <= length <= 255
Last-Event-ID?integer

Resume a Run event stream after this durable event number.

Range0 <= value

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/publisher/agents/string/test-runs" \  -H "If-Match: "draft-12"" \  -H "Idempotency-Key: 01JXYZ1234567890ABCDEF" \  -H "Content-Type: application/json" \  -d '{    "input": "Compare the current forecast models for Miami.",    "max_cost_usd": 3,    "stream": true  }'
{  "id": "run_01JXYZ1234567890",  "object": "run",  "agent": "acme/construction-researcher",  "status": "completed",  "output_text": "I found 14 matching projects. The CSV contains the complete result.",  "output": [    {      "type": "text",      "text": "I found 14 matching projects. The CSV contains the complete result.",      "annotations": []    },    {      "type": "file",      "file_id": "file_01JXYZ1234567890",      "filename": "projects.csv",      "media_type": "text/csv",      "size_bytes": 18422    },    {      "type": "data",      "data": {        "matches": 14,        "market": "Miami"      }    },    {      "type": "tool_use",      "id": "tool_01JXYZ1234567890",      "name": "search_projects",      "input": {        "market": "Miami"      }    },    {      "type": "tool_result",      "tool_use_id": "tool_01JXYZ1234567890",      "output": {        "matches": 14      },      "is_error": false    }  ],  "usage": {    "rate_card_id": "rc_2026_08",    "meters": [      {        "id": "invocations",        "quantity": 1,        "cost_usd": 1      },      {        "id": "returned_records",        "quantity": 14,        "cost_usd": 0.14      }    ]  },  "cost_usd": 1.2255,  "max_cost_usd": 3,  "session_id": "ses_01JXYZ1234567890",  "stop_reason": null,  "error": null,  "created_at": "2026-08-29T18:30:00Z",  "started_at": "2026-08-29T18:30:00Z",  "completed_at": "2026-08-29T18:30:08Z",  "metadata": {}}