API reference

Screwtape.ai

Screwtape.ai returns a pass, fail, or retry verdict on another agent's output, and scores consensus across several agents, including false-consensus risk. It is the agent validation API, not the arXiv paper also named Screwtape. Authenticate with Authorization: Bearer or, for a single call, an x402 PAYMENT-SIGNATURE header. That payment is $0.005 USDC on Base (eip155:8453) to 0x028Bb9A57B8C27c22f6B39dd00e7eFF1FB60344B, verified and settled through a facilitator. The worker does not hold a private key. When a model key is configured, the default model is openai/gpt-oss-120b, with qwen/qwen3.8-27b tried once if the primary model returns 404 or 5xx. Judged content is not stored unless retain is true. The public spec omits operator-only routes.

This page is generated from openapi.json. Base URL: https://screwtape.ai.

/v1/health

GET Health

Liveness. Does not require an API key and does not report secrets.

  • 200 Service is up.

/v1/judge

POST Judge one agent output

Returns a verdict, a confidence score, reasons, and a request id. Free keys include 100 calls per UTC day. Prepaid credits are used after that. With no API key, the response is 402 and describes an x402 payment of $0.005 USDC on Base, which is verified and settled through a facilitator.

{
  "task": "State the crew size and launch site.",
  "agent_output": "The crew size was 4. The mission launched from Cape Canaveral.",
  "evidence": [
    "The mission launched on 2024-03-01 from Cape Canaveral.",
    "The crew size was 4."
  ],
  "criteria": [
    "crew size",
    "Cape Canaveral"
  ]
}
  • 200 Verdict.
  • 400 Invalid request.
  • 401 API key was not recognized.
  • 402 Payment required. PAYMENT-REQUIRED carries the x402 requirements. A valid payment is verified and settled through a facilitator.
  • 429 Daily quota or rate limit exceeded.

/v1/consensus

POST Score consensus across agents

Returns the consensus answer, an agreement score, false-consensus risk, and a request id.

{
  "task": "State the crew size.",
  "answers": [
    {
      "agent_id": "alpha",
      "output": "The crew size was 4."
    },
    {
      "agent_id": "beta",
      "output": "The crew size was 4."
    },
    {
      "agent_id": "gamma",
      "output": "The crew size was 4."
    }
  ]
}
  • 200 Consensus.
  • 400 Invalid request.
  • 401 API key was not recognized.
  • 402 Payment required. A valid payment is verified and settled through a facilitator.
  • 429 Daily quota or rate limit exceeded.

/v1/keys

POST Create a free API key

Returns the secret key once. Only a hash is stored. Limited to three active keys per email.

{
  "email": "dev@example.com",
  "name": "Local dev"
}
  • 201 Key created.
  • 400 Invalid signup.
  • 429 Signup rate limit or email cap.

/v1/keys/me

GET Current key

Usage and credit balance for the Bearer key. The secret is not returned.

  • 200 Key metadata.
  • 401 API key was not recognized.

DELETE Delete the current key and its data

Deletes the key hash, daily counters, payment records, and any opt-in retained judgments.

  • 200 Deleted.
  • 401 API key was not recognized.

/v1/retention

GET List opt-in retained calls

Returns calls this key asked to retain. Rows expire after 24 hours.

  • 200 Retained rows.
  • 401 API key was not recognized.

/v1/retention/{id}

DELETE Delete one retained call

  • id Retention id returned when retain was true.
  • 200 Deleted.
  • 401 API key was not recognized.
  • 404 No such row for this key.

/v1/billing/checkout

POST Start a Stripe test-mode checkout

Starter is $30 for 10,000 calls. Builder is $100 for 50,000 calls. Requires a Bearer key. Live-mode Stripe keys are refused. Credits are applied by the webhook, not by the success page.

{
  "pack": "starter"
}
  • 200 Checkout URL.
  • 401 API key was not recognized.
  • 503 Stripe test checkout is not configured, or a live key was refused.

/mcp

POST MCP Streamable HTTP

JSON-RPC for initialize, tools/list, and tools/call. Tools are judge and consensus. tools/call uses the same auth and quota as the REST API. GET is reserved and returns 405 because this server does not open an SSE stream.

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list"
}
  • 200 JSON-RPC result.
  • 202 Notification accepted.
  • 402 tools/call requires a key or an x402 payment, which is verified and settled through a facilitator.