# Test the current draft
Source: https://docs.simpleserve.ai/docs/api-reference/publisher-tests/post-publisher-agents-agent_id-test-runs

Method: POST /v1/publisher/agents/{agent_id}/test-runs
Base URL: https://api.simpleserve.ai

```json
{
  "path": "/v1/publisher/agents/{agent_id}/test-runs",
  "method": "POST",
  "tags": [
    "Publisher Tests"
  ],
  "operationId": "createAgentTestRun",
  "summary": "Test the current draft",
  "description": "Runs the current draft without releasing it. Send the ETag from the\nlatest draft response so the test uses the expected revision.\n",
  "parameters": [
    {
      "$ref": "#/components/parameters/PublisherAgentId"
    },
    {
      "$ref": "#/components/parameters/IfMatchDraft"
    },
    {
      "$ref": "#/components/parameters/IdempotencyKey"
    },
    {
      "$ref": "#/components/parameters/LastEventId"
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/CreateAgentTestRunRequest"
        },
        "examples": {
          "default": {
            "value": {
              "input": "Compare the current forecast models for Miami.",
              "max_cost_usd": 3,
              "stream": true
            }
          }
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "A terminal Run, or an event stream when `stream` is true.",
      "headers": {
        "x-request-id": {
          "$ref": "#/components/headers/RequestId"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Run"
          },
          "examples": {
            "completed": {
              "$ref": "#/components/examples/CompletedRunExample"
            }
          }
        },
        "text/event-stream": {
          "schema": {
            "$ref": "#/components/schemas/RunStreamEvent"
          }
        }
      }
    },
    "202": {
      "description": "The test Run was accepted and continues in the background.",
      "headers": {
        "location": {
          "description": "URL for retrieving the Run.",
          "schema": {
            "type": "string",
            "format": "uri-reference"
          }
        },
        "retry-after": {
          "description": "Suggested polling delay in seconds.",
          "schema": {
            "type": "integer",
            "minimum": 1
          }
        },
        "x-request-id": {
          "$ref": "#/components/headers/RequestId"
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Run"
          },
          "examples": {
            "accepted": {
              "$ref": "#/components/examples/AcceptedRunExample"
            }
          }
        }
      }
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "402": {
      "$ref": "#/components/responses/PaymentRequired"
    },
    "403": {
      "$ref": "#/components/responses/PublisherForbidden"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "409": {
      "$ref": "#/components/responses/RevisionConflict"
    },
    "413": {
      "$ref": "#/components/responses/PayloadTooLarge"
    },
    "422": {
      "$ref": "#/components/responses/DraftInvalid"
    },
    "429": {
      "$ref": "#/components/responses/RateLimited"
    },
    "500": {
      "$ref": "#/components/responses/InternalError"
    },
    "503": {
      "$ref": "#/components/responses/ProviderUnavailable"
    },
    "504": {
      "$ref": "#/components/responses/ProviderTimeout"
    }
  }
}
```