{
  "name": "Kodiak API",
  "version": "0.1.0",
  "base_url": "https://azurecarbon.com",
  "description": "Epistemic cartography engine. Paste a claim, get a truth certificate.",
  "authentication": {
    "type": "Bearer token",
    "header": "Authorization: Bearer kdk_YOUR_API_KEY",
    "note": "Get a key at azurecarbon.com/account"
  },
  "endpoints": {
    "POST /api/check": {
      "description": "Analyze a claim and return a truth certificate",
      "body": {
        "claim": {
          "type": "string",
          "required": true,
          "min_length": 5,
          "max_length": 2000
        },
        "depth": {
          "type": "integer",
          "default": 3,
          "range": "1-5",
          "note": "1=quick ($0.05), 2=standard ($0.08), 3=thorough ($0.15), 4=rigorous ($0.21), 5=forensic ($0.45)"
        },
        "verbose": {
          "type": "boolean",
          "default": false,
          "note": "Include internals: model, classification, decision_trace, processing_time"
        }
      },
      "response": {
        "certificate_id": "KDK-xxx",
        "claim": "original claim",
        "verdict": "supported | disputed | mixed | insufficient",
        "confidence": "0-100",
        "summary": "human-readable summary",
        "citations": "[{url, title, snippet}]",
        "chain_hash": "SHA-256 chain hash",
        "prompt_audit": "{ prompt_fingerprint, prompt_versions, prompt_count }",
        "charged_cents": "cost of this check",
        "credits_remaining": "remaining balance"
      }
    },
    "GET /api/credits": {
      "description": "Check credit balance and pricing",
      "response": {
        "balance_cents": 0,
        "balance_dollars": "0.00",
        "pricing": {
          "1": 5,
          "2": 8,
          "3": 15,
          "4": 21,
          "5": 45
        }
      }
    },
    "GET /api/certificates": {
      "description": "List your certificate history (paginated)",
      "params": {
        "limit": {
          "default": 20,
          "max": 100
        },
        "offset": {
          "default": 0
        }
      }
    },
    "GET /api/transactions": {
      "description": "Full credit ledger — deposits and charges (API key or session)",
      "params": {
        "limit": {
          "default": 100,
          "max": 500
        },
        "offset": {
          "default": 0
        }
      },
      "note": "paid_cents = actual money paid (deposits); amount_cents = credit movement"
    },
    "GET /api/pricing": {
      "description": "Public pricing info"
    },
    "GET /verify/:certId": {
      "description": "Verify a certificate (public, no auth required)",
      "note": "Returns chain integrity, Bitcoin anchoring status, and indicia watermark"
    }
  },
  "credits": {
    "purchase": "POST /billing/add-credits with { amount: cents } ($5-$100)",
    "volume_bonus": {
      "$10+": "10%",
      "$20+": "20%",
      "$50+": "30%"
    },
    "note": "No expiration. Work on web and API."
  },
  "integrity": {
    "chain": "Each certificate hash includes prior certificate ID",
    "buoy": "Anchored to Dustforge Buoy ledger",
    "bitcoin": "Anchored to Bitcoin via OpenTimestamps",
    "prompts": "Every LLM prompt version is hashed and stored per certificate"
  }
}