{
  "openapi": "3.1.0",
  "info": {
    "title": "OpenWorker services",
    "version": "0.1.0",
    "description": "Machine-callable verified services, paid per call via x402."
  },
  "servers": [
    {
      "url": "https://openworker.etips.me"
    }
  ],
  "paths": {
    "/api/services": {
      "get": {
        "summary": "List services for sale",
        "description": "Catalog of paid services with prices and schemas.",
        "responses": {
          "200": {
            "description": "catalog"
          }
        }
      }
    },
    "/api/services/agent_readiness_audit": {
      "post": {
        "summary": "Agent Readiness Audit ($0.1 via x402)",
        "description": "Audit an agent-facing service for machine usability. Actually calls the endpoints: MCP (Streamable HTTP initialize + tools/list, schema checks), A2A agent card, x402 payment challenge, llms.txt, OpenAPI, robots/agents metadata and endpoint health. Returns a scored report with raw evidence and sha256 hashes of every observation.\n\nPay-per-call: the first request answers HTTP 402 with x402 payment requirements (USDC on Base). Retry with the PAYMENT-SIGNATURE header. You are charged only if the result passes verification.",
        "operationId": "agent_readiness_audit",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "title": "Agent Readiness Audit — input",
                "type": "object",
                "required": [
                  "url"
                ],
                "additionalProperties": false,
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Base URL of the service (https://example.com) or a direct MCP endpoint URL."
                  },
                  "mcp_url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Optional explicit MCP Streamable HTTP endpoint."
                  },
                  "checks": {
                    "type": "array",
                    "items": {
                      "enum": [
                        "health",
                        "mcp",
                        "a2a",
                        "x402",
                        "llms_txt",
                        "openapi",
                        "robots",
                        "agents_json"
                      ]
                    },
                    "description": "Subset of checks to run (default: all)."
                  }
                },
                "examples": [
                  {
                    "url": "https://gigs.sh"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verified result",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "title": "Agent Readiness Audit — result",
                  "type": "object",
                  "required": [
                    "target",
                    "score",
                    "grade",
                    "checks",
                    "evidence",
                    "audited_at"
                  ],
                  "properties": {
                    "target": {
                      "type": "string"
                    },
                    "score": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 100
                    },
                    "grade": {
                      "enum": [
                        "A",
                        "B",
                        "C",
                        "D",
                        "F"
                      ]
                    },
                    "checks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "status",
                          "summary"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "status": {
                            "enum": [
                              "pass",
                              "warn",
                              "fail",
                              "skip"
                            ]
                          },
                          "summary": {
                            "type": "string"
                          },
                          "details": {},
                          "evidence_ids": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    },
                    "recommendations": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "evidence": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "content",
                          "content_sha256"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "content": {
                            "type": "string"
                          },
                          "content_sha256": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "audited_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (not charged)"
          },
          "402": {
            "description": "Payment required (x402)"
          }
        }
      }
    },
    "/api/services/mcp_interop_probe": {
      "post": {
        "summary": "MCP Interop Probe ($0.03 via x402)",
        "description": "Speak raw Streamable HTTP JSON-RPC to one MCP server: initialize, tools/list and (optionally) one safe read-only tools/call. Returns worker-result-1.0 JSON with timestamped steps and hashed evidence. An evidenced failure (unreachable, auth-walled, broken handshake) is a valid result.\n\nPay-per-call: the first request answers HTTP 402 with x402 payment requirements (USDC on Base). Retry with the PAYMENT-SIGNATURE header. You are charged only if the result passes verification.",
        "operationId": "mcp_interop_probe",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "title": "MCP Interop Probe — input",
                "type": "object",
                "required": [
                  "endpoint"
                ],
                "additionalProperties": false,
                "properties": {
                  "endpoint": {
                    "type": "string",
                    "format": "uri",
                    "description": "MCP Streamable HTTP endpoint."
                  },
                  "assignment_id": {
                    "type": "string"
                  },
                  "scope_hash": {
                    "type": "string"
                  },
                  "allow_tool_call": {
                    "type": "boolean",
                    "default": true,
                    "description": "Make at most one clearly read-only tools/call."
                  }
                },
                "examples": [
                  {
                    "endpoint": "https://api.basedagents.ai/mcp"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verified result",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "title": "MCP Interop Probe — result",
                  "description": "BasedAgents worker-result v1.0 (https://api.basedagents.ai/v1/testing/schemas/worker-result-1.0.json).",
                  "$ref": "https://api.basedagents.ai/v1/testing/schemas/worker-result-1.0.json"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (not charged)"
          },
          "402": {
            "description": "Payment required (x402)"
          }
        }
      }
    },
    "/api/services/evidence_research": {
      "post": {
        "summary": "Evidence Research ($0.2 via x402)",
        "description": "Research a question using current sources and return a structured answer with evidence, confidence, contradictions and citations.\n\nPay-per-call: the first request answers HTTP 402 with x402 payment requirements (USDC on Base). Retry with the PAYMENT-SIGNATURE header. You are charged only if the result passes verification.",
        "operationId": "evidence_research",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "title": "Evidence Research — input",
                "type": "object",
                "required": [
                  "question"
                ],
                "properties": {
                  "question": {
                    "type": "string",
                    "minLength": 5,
                    "maxLength": 2000
                  },
                  "max_sources": {
                    "type": "integer",
                    "minimum": 2,
                    "maximum": 10,
                    "default": 6
                  },
                  "recency_days": {
                    "type": "integer",
                    "minimum": 1
                  }
                },
                "examples": [
                  {
                    "question": "What is the x402 payment protocol and which networks does it support?",
                    "max_sources": 5
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verified result",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "title": "Evidence Research — result",
                  "type": "object",
                  "required": [
                    "answer",
                    "confidence",
                    "evidence",
                    "citations"
                  ],
                  "properties": {
                    "answer": {
                      "type": "string"
                    },
                    "confidence": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "evidence": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "claim": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "quote": {
                            "type": "string"
                          },
                          "published": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "contradictions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "citations": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "format": "uri"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (not charged)"
          },
          "402": {
            "description": "Payment required (x402)"
          }
        }
      }
    },
    "/api/services/annotated_walkthrough_writer": {
      "post": {
        "summary": "Annotated Walkthrough Writer ($0.9 via x402)",
        "description": "Turns a URL or topic into a field-by-field annotated walkthrough: it fetches the target (a receipt, an API flow, a board of criteria), identifies every element, and explains what each one is, who authored it, what it binds, and — wherever possible — performs the actual verification (recompute hashes, check sequences, compare timestamps, trace sources) rather than asserting it. Output is strict JSON: an ordered list of annotated blocks, each with the quoted element, its location/reference, a plain-language explanation, and a verification record with method, computed-vs-claimed values, result, and the source URL used. Built for hands-on guides, receipts made legible, and acceptance-criteria teardowns that a reader can check.\n\nPay-per-call: the first request answers HTTP 402 with x402 payment requirements (USDC on Base). Retry with the PAYMENT-SIGNATURE header. You are charged only if the result passes verification.",
        "operationId": "annotated_walkthrough_writer",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$schema": "https://json-schema.org/draft/2020-12/schema",
                "type": "object",
                "properties": {
                  "target": {
                    "type": "string",
                    "description": "URL or topic to annotate"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "receipt",
                      "api-flow",
                      "board-criteria",
                      "topic"
                    ],
                    "default": "auto"
                  },
                  "depth": {
                    "type": "string",
                    "enum": [
                      "field-by-field",
                      "summary"
                    ],
                    "default": "field-by-field"
                  },
                  "audience": {
                    "type": "string",
                    "default": "technical reader"
                  },
                  "max_blocks": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 60,
                    "default": 25
                  }
                },
                "required": [
                  "target"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verified result",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "https://json-schema.org/draft/2020-12/schema",
                  "type": "object",
                  "properties": {
                    "target": {
                      "type": "string"
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "receipt",
                        "api-flow",
                        "board-criteria",
                        "topic"
                      ]
                    },
                    "summary": {
                      "type": "string"
                    },
                    "unsupported_claims": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "blocks": {
                      "type": "array",
                      "minItems": 1,
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "quoted_value": {
                            "type": "string"
                          },
                          "location": {
                            "type": "string"
                          },
                          "what_it_is": {
                            "type": "string"
                          },
                          "who_wrote_it": {
                            "type": "string"
                          },
                          "what_it_binds": {
                            "type": "string"
                          },
                          "verification": {
                            "type": "object",
                            "properties": {
                              "method": {
                                "type": "string"
                              },
                              "computed": {
                                "type": "string"
                              },
                              "claimed": {
                                "type": "string"
                              },
                              "result": {
                                "type": "string",
                                "enum": [
                                  "verified",
                                  "mismatch",
                                  "unverifiable"
                                ]
                              },
                              "reference": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "method",
                              "result"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "field",
                          "what_it_is",
                          "verification"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "target",
                    "mode",
                    "summary",
                    "blocks",
                    "sources",
                    "unsupported_claims"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (not charged)"
          },
          "402": {
            "description": "Payment required (x402)"
          }
        }
      }
    }
  }
}