{
  "openapi": "3.1.0",
  "info": {
    "title": "Atom.com Machine Payments API",
    "version": "1.0.0",
    "description": "Agent-payable endpoint for Atom.com — a curated premium domain marketplace and accredited registrar. Payment challenges are quoted per action via Atom's MCP server (https://mcp.atom.com/mcp) using the get_domain_purchase_pay_link, get_domain_register_pay_link, and get_ai_tokens_pay_link tools; each returns a single-use pay_url served by this API. Amounts are quoted server-side per challenge — the signed 402 response is the authoritative source of payment terms.",
    "contact": { "email": "support@atom.com", "url": "https://atom.com" }
  },
  "servers": [{ "url": "https://mcp.atom.com" }],
  "x-service-info": {
    "categories": ["domains", "marketplace", "commerce", "ai"],
    "docs": {
      "homepage": "https://atom.com",
      "apiReference": "https://mcp.atom.com/docs",
      "llms": "https://www.atom.com/llms.txt"
    }
  },
  "paths": {
    "/api/mpp-pay": {
      "post": {
        "operationId": "payChallenge",
        "summary": "Pay a quoted Atom action (domain purchase, domain registration, or AI token top-up) via MPP",
        "description": "Requires a challenge_id obtained from Atom's MCP server while OAuth-authenticated (tools: get_domain_purchase_pay_link, get_domain_register_pay_link, get_ai_tokens_pay_link). The first request returns a signed HTTP 402 challenge for the quoted amount; presenting a valid Stripe payment credential completes the charge and fulfills the bound action (marketplace domain purchase, fresh domain registration, or AI token credit). Challenges are single-use and bound server-side to the buyer's Atom account.",
        "parameters": [
          {
            "name": "challenge_id",
            "in": "query",
            "required": true,
            "schema": { "type": "string" },
            "description": "Single-use challenge id from a 'get pay link' MCP tool. The challenge binds the action, amount, and buyer identity server-side."
          }
        ],
        "x-payment-info": {
          "offers": [
            {
              "amount": "50",
              "currency": "usd",
              "description": "Dynamic — amount is quoted per challenge_id (domain price or token pack price). '50' ($0.50) is the minimum; the signed 402 challenge is authoritative.",
              "intent": "charge",
              "method": "stripe"
            }
          ]
        },
        "responses": {
          "402": { "description": "Signed MPP payment challenge for the quoted amount (WWW-Authenticate: Payment)." },
          "200": { "description": "Payment settled; the bound action (purchase / registration / token credit) was executed. Body includes success, callback_action, amount_charged." },
          "400": { "description": "Missing challenge_id, invalid amount, or payment credential failed verification." },
          "404": { "description": "Unknown challenge_id." },
          "409": { "description": "Challenge already used (single-use)." }
        }
      }
    }
  }
}
