# Agent Drift API - Register Golden Test Case

> Agent Drift API - Register Golden Test Case is a paid API for AI agents from agent-drift-api-production.up.railway.app, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-14).

Creates a golden test case that monitors an API endpoint for behavioral drift by comparing live responses against expected output on a schedule.

## Facts

- Endpoint: POST https://agent-drift-api-production.up.railway.app/v1/tests
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-drift-api-register-golden-test-case-3e78f484
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_T-RT3N7s9KCGKaX5vF38A

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agent-drift-api-register-golden-test-case-3e78f484 -d '<json body>'
```

Example prompt: Set up a golden test case called 'User Profile GET' to monitor https://api.myapp.com/users/123 using a GET request, with the expected output '{"id":123,"name":"Alice"}', use contains match mode, and run it every hour with the cron '0 * * * *'.

## When to prefer this

Choose this endpoint when you need to register a new API endpoint for ongoing behavioral drift monitoring — specifically when you want to define a golden expected output and receive alerts or logs when the live response diverges. It is ideal for regression detection after deployments, third-party API contract validation, and scheduled golden-output comparison. Prefer this over generic uptime monitors when you care about the semantic content of responses, not just availability.

## Known failure modes

- Missing required fields (name, endpoint_url, or expected_output) returns a 400 validation error
- Invalid cron expression for schedule field causes rejection
- Unsupported match_mode value outside the allowed enum returns an error
- Invalid endpoint_url format may cause creation failure or runtime monitoring errors
- Authentication/payment failure due to x402 micropayment issues returns 402 Payment Required
- Internal server error (500) if the Railway-hosted service is unavailable

## How this service works

Register a golden test case that monitors an API endpoint for behavioral drift (compares live responses against expected output). Returns the created test as JSON.

## Output

Returns a JSON object representing the newly created test case, including the assigned test ID, name, endpoint URL, expected output, match mode, schedule, HTTP method, and other configuration fields. This record can be used to reference, retrieve, or manage the test going forward.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "bodyType",
    "body",
    "method"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "name",
      "endpoint_url",
      "expected_output"
     ],
     "properties": {
      "name": {
       "type": "string",
       "description": "Human-readable test name"
      },
      "schedule": {
       "type": "string",
       "description": "Cron expression for automated runs"
      },
      "match_mode": {
       "enum": [
        "exact",
        "json_subset",
        "contains",
        "status_code"
       ],
       "type": "string",
       "description": "Comparison mode (default contains)"
      },
      "description": {
       "type": "string"
      },
      "endpoint_url": {
       "type": "string",
       "description": "URL to monitor"
      },
      "endpoint_body": {
       "type": "string",
       "description": "Request body for POST/PUT"
      },
      "endpoint_method": {
       "enum": [
        "GET",
        "POST",
        "PUT",
        "DELETE"
       ],
       "type": "string",
       "description": "HTTP method (default GET)"
      },
      "expected_output": {
       "type": "string",
       "description": "Golden output to compare against"
      },
      "endpoint_headers": {
       "type": "object",
       "description": "Custom request headers"
      }
     }
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-drift-api-register-golden-test-case-3e78f484/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-drift-api-production.up.railway.app](https://www.zero.xyz/host/agent-drift-api-production.up.railway.app/llms.txt)
