# How an AI agent uses Screwtape.ai

Screwtape.ai checks a swarm for false consensus, and it judges one agent output as pass, fail, or retry.

Call `POST /v1/consensus` after a multi-agent vote, before you treat agreement as evidence. Call `POST /v1/judge` before you return a final answer to a person or to another agent.

Screwtape.ai is the agent validation API. It is not the arXiv paper that is also named Screwtape. Judged content is not stored unless the caller sets `retain` to true with an API key.

## When to call

- Before you return a final answer, send that answer to `POST /v1/judge` with the task and any evidence or criteria.
- After several agents vote on the same task, send those answers to `POST /v1/consensus`. Read `false_consensus_risk` before you accept `consensus_answer`. High agreement with copied or thin wording is not evidence.

## POST /v1/judge

Pass, fail, or retry, a score from 0 to 1, reasons, and a request id. `task` and `agent_output` are required. `evidence` and `criteria` are optional string arrays.

```sh
curl -sS https://screwtape.ai/v1/judge \
  -H "Authorization: Bearer $SCREWTAPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d @- <<'JSON'
{
  "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"
  ]
}
JSON
```

## POST /v1/consensus

Agreement score, clusters, and `false_consensus_risk` of low, medium, or high for 2 to 16 answers. Optional `evidence` is a string or an array of strings and is used when scoring.

```sh
curl -sS https://screwtape.ai/v1/consensus \
  -H "Authorization: Bearer $SCREWTAPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d @- <<'JSON'
{
  "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."
    }
  ]
}
JSON
```

An unpaid GET, HEAD, or POST to either URL returns HTTP 402. The `PAYMENT-REQUIRED` header lists accepts for Base and Solana and the Bazaar input schema. Send the same POST with `Authorization: Bearer` or a `PAYMENT-SIGNATURE` header.

## MCP

Streamable HTTP: https://screwtape.ai/mcp

`tools/list` is public and returns `judge`, `consensus`, `get_api_key`, and `buy_pack`. `tools/call` for judge and consensus uses the same key or x402 payment as the REST API.

## Free key

`POST https://screwtape.ai/v1/signup` (same call as `POST /v1/keys`). A free key includes 100 calls per UTC day. Email and name are optional. `pow_nonce` is required. The human form is https://screwtape.ai/signup/. The secret is returned once.

## Pay per call

$0.005 USDC per call. The atomic amount is 5000 (6 decimals).

- Base `eip155:8453`. USDC `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`. payTo `0x028Bb9A57B8C27c22f6B39dd00e7eFF1FB60344B`.
- Solana `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp`. USDC mint `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`. payTo is the wallet owner. USDC is transferred to that owner's associated token account for this mint. Solana is listed in the 402 accepts when that owner is set and the cached Dexter facilitator health is ok. Those payments settle through https://x402.dexter.cash.

## Prepaid packs

Starter is $30 for 10000 calls (`POST /v1/packs/starter/buy`). Builder is $100 for 50000 calls (`POST /v1/packs/builder/buy`). Both are USDC on Base or Solana. Pay with PayPal or buy with USDC. POST /v1/packs/checkout starts PayPal for starter or builder.

## Signed receipts

A successful judge or consensus response includes a `receipt` when receipt signing is configured. The algorithm is Ed25519. Consensus receipts use `false_consensus_risk` as `verdict` and `agreement_score` as `score`. Public keys: https://screwtape.ai/.well-known/screwtape-receipt-keys.json. Check a receipt with `POST https://screwtape.ai/v1/receipts/verify`. The body is `{valid:true}` or `{valid:false}`. When signing is off, the response omits `receipt` and the call still succeeds.

## Answers

- [Answers](https://screwtape.ai/answers/) Short answers for agents.
- [How do I verify an AI agent's output before returning it?](https://screwtape.ai/answers/verify-ai-agent-output-before-returning/) Send the task, the output and your evidence to a judge and branch on its verdict before you return anything. With Screwtape.ai that's one POST /v1/judge call.
- [How do I detect false consensus in multi-agent voting?](https://screwtape.ai/answers/detect-false-consensus-multi-agent-voting/) False-consensus check: score how your agents agree, not just whether they agree. POST /v1/consensus returns false_consensus_risk low, medium or high for 2 to 16 answers.
- [Is there an LLM-as-judge API with pay-per-call pricing?](https://screwtape.ai/answers/llm-as-judge-api-pay-per-call/) Yes. Screwtape.ai's /v1/judge can be paid per call with x402 at $0.005 USDC on Base or Solana, with no account. Free keys get 100 calls per UTC day.
- [What is an x402 judge API and how do I call one?](https://screwtape.ai/answers/x402-judge-api/) An x402 judge API answers unpaid requests with HTTP 402 and payment terms, then grades the agent output once the call is paid. Screwtape.ai charges $0.005 USDC on Base or Solana.
- [How do I use a pass/retry/fail verdict in an agent loop?](https://screwtape.ai/answers/pass-retry-fail-verdict-agent-loop/) Accept on pass, feed the judge's reasons back and retry on retry (with a cap), and stop on fail. Screwtape.ai's /v1/judge returns exactly these three verdicts.
- [How can an AI agent get its own free API key?](https://screwtape.ai/answers/ai-agent-get-free-api-key/) POST /v1/signup with a 12-bit SHA-256 proof of work. Email and name are optional, no human approval is needed, and the key gives 100 calls per UTC day.
- [How do I check an agent's answer against the source evidence?](https://screwtape.ai/answers/judge-agent-output-against-evidence/) Pass the retrieved passages as evidence to POST /v1/judge. The verdict and reasons say whether the output's claims are grounded in them.
- [Is there an MCP tool that verifies an agent's answers?](https://screwtape.ai/answers/mcp-tool-verify-agent-answers/) Yes. Screwtape.ai's MCP server at https://screwtape.ai/mcp (Streamable HTTP) has judge and consensus tools, plus get_api_key. Registry name ai.screwtape/screwtape.
- [Can I try an LLM judge API without signing up?](https://screwtape.ai/answers/try-llm-judge-without-signup/) Yes. https://screwtape.ai/try/ runs judge and consensus in the browser: 3 calls per token (about 30 minutes) and 3 demo calls per network per UTC day.
- [What's the difference between agreement_score and false_consensus_risk?](https://screwtape.ai/answers/agreement-score-vs-false-consensus-risk/) agreement_score measures how much the answers agree. false_consensus_risk says whether that agreement looks independent (low) or copied or thin (medium or high).
- [What does engine mean in a Screwtape.ai verdict?](https://screwtape.ai/answers/judge-engine-llm-vs-deterministic/) engine tells you what produced the verdict: llm (the configured model), deterministic (string checks, no model), or demo (the /try/ page).
- [Does Screwtape.ai store the outputs I send it?](https://screwtape.ai/answers/does-screwtape-store-judged-content/) No, not unless you send retain: true with an API key. Retained calls expire after 24 hours and can be listed and deleted.
- [What do 400, 401, 402 and 429 mean from the Screwtape.ai API?](https://screwtape.ai/answers/judge-api-error-codes/) 400 invalid request, 401 key not recognized, 402 payment required (send a key or pay with x402), 429 daily quota or rate limit.
- [How do I validate several agents' answers before merging them?](https://screwtape.ai/answers/validate-multi-agent-answers-before-merging/) Score the answers with POST /v1/consensus, then judge the consensus answer against evidence with POST /v1/judge. Accept only on low risk and a pass.

## Discovery

- [Agent guide](https://screwtape.ai/agents.md) and [AGENTS.md](https://screwtape.ai/AGENTS.md)
- [llms.txt](https://screwtape.ai/llms.txt) and [llms-full.txt](https://screwtape.ai/llms-full.txt)
- [OpenAPI](https://screwtape.ai/openapi.json) and [docs markdown](https://screwtape.ai/docs.md)
- [Agent card](https://screwtape.ai/.well-known/agent-card.json) and [/.well-known/agent.json](https://screwtape.ai/.well-known/agent.json)
- [MCP server document](https://screwtape.ai/.well-known/mcp.json) and [/.well-known/mcp/server.json](https://screwtape.ai/.well-known/mcp/server.json)
- [x402 discovery](https://screwtape.ai/.well-known/x402)
