{
  "name": "dox402",
  "description": "Pay-per-use AI inference gateway using x402 payment protocol. No signup, no API key -- authenticate with your Ethereum wallet (SIWE), pay with USDC on Base Mainnet, and get streamed AI responses from 5 models.",
  "url": "https://inference-gate.iglesias-brandon.workers.dev",
  "provider": {
    "organization": "dox402",
    "url": "https://github.com/iglesiasbrandon/dox402"
  },
  "version": "1.0.0",
  "capabilities": {
    "streaming": true
  },
  "authentication": {
    "schemes": ["bearer"],
    "instructions": "1. GET /auth/nonce?wallet=0xYOUR_ADDRESS to get a one-time nonce. 2. Construct an EIP-4361 (SIWE) message containing the nonce and sign it with personal_sign. 3. POST /auth/login with {message, signature} — response body contains {token, expiresAt}. 4. Use Authorization: Bearer <token> on all subsequent requests. Alternative: pass a SIGN-IN-WITH-X header (base64-encoded SiwxPayload) on POST /infer for single-request stateless auth."
  },
  "defaultInputModes": ["application/json"],
  "defaultOutputModes": ["text/event-stream", "application/json"],
  "skills": [
    {
      "id": "infer",
      "name": "AI Inference",
      "description": "Run AI text generation with conversation memory. Supports Llama 3.1 8B, Llama 3.3 70B, Gemma 3 12B, Mistral 7B, DeepSeek R1 32B. Set Accept: application/json for synchronous JSON response, or text/event-stream for SSE. Costs ~8-13 tokens per request depending on model and length.",
      "inputModes": ["application/json"],
      "outputModes": ["application/json", "text/event-stream"]
    },
    {
      "id": "deposit",
      "name": "Deposit Tokens",
      "description": "Top up inference token balance by submitting an on-chain USDC payment proof. Minimum 0.001 USDC (1,000 tokens).",
      "inputModes": ["application/json"],
      "outputModes": ["application/json"]
    },
    {
      "id": "balance",
      "name": "Check Balance",
      "description": "Query current token balance, total deposited, total spent, and lifetime request count.",
      "inputModes": [],
      "outputModes": ["application/json"]
    },
    {
      "id": "payment-info",
      "name": "Payment Information",
      "description": "Get the USDC payment address, network (Base Mainnet), contract address, and minimum top-up amount. No authentication required.",
      "inputModes": [],
      "outputModes": ["application/json"]
    },
    {
      "id": "rag",
      "name": "Document Knowledge Base (RAG)",
      "description": "Upload documents (.pdf, .docx, .txt, .md, .csv, .json, .html) to create a per-wallet knowledge base. Documents are parsed client-side (pdf.js for PDFs, mammoth.js for DOCX), chunked, embedded, and stored in Vectorize. Enable useRag on inference to inject relevant context. Optional systemPrompt for persistent instructions. Max 50 docs, 100KB each.",
      "inputModes": ["application/json"],
      "outputModes": ["application/json"]
    }
  ],
  "documentationUrl": "/openapi.json",
  "x-payment": {
    "protocol": "x402",
    "network": "base-mainnet",
    "asset": "USDC",
    "usdcContract": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "minimumPayment": "0.001 USDC (1,000 tokens)",
    "paymentInfoEndpoint": "/payment-info"
  }
}
