{"openapi":"3.0.3","info":{"title":"A2A Paid Gateway","version":"1.1.0","description":"Metered gateway in front of the IntelliCore engines. Get a free 25-credit trial key at POST /api/onboard/trial, then call skills over plain HTTP, A2A JSON-RPC or MCP. Paid credits come from prepaid packs; the gateway never charges a card itself."},"servers":[{"url":"https://a2a.intelliliving.kr"}],"tags":[{"name":"onboarding","description":"Self-service keys: trial, claim, payment webhook"},{"name":"call","description":"Metered skill calls"},{"name":"mcp","description":"Model Context Protocol surface"},{"name":"discovery","description":"Public documents for agents"}],"paths":{"/api/onboard/trial":{"post":{"tags":["onboarding"],"summary":"Issue a free sandbox key (25 credits, 7 days)","description":"No authentication and no card. The key is derived from the caller network and the UTC day, so repeat calls return the same 25 credits. Rate limit 6 requests / 10 minutes / IP.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"agent":{"type":"string","description":"Optional agent name for the trial key label."}}}}}},"responses":{"201":{"description":"Trial key issued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuedKey"}}}},"429":{"description":"rate limited"},"503":{"description":"trial unavailable (signing key not configured)"}}}},"/api/onboard/claim":{"post":{"tags":["onboarding"],"summary":"Turn a purchase access code into an agent key","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string","description":"Access code from the store purchase."}}}}}},"responses":{"201":{"description":"Key issued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuedKey"}}}},"400":{"description":"invalid code"},"429":{"description":"rate limited"}}}},"/api/onboard/paid":{"post":{"tags":["onboarding"],"summary":"Payment webhook: confirm a purchase and return the buyer key","description":"Server-to-server. Header x-il-billing-signature: sha256=<hex HMAC-SHA256 of the raw body> (or t=<unix>,v1=<hex>). A retried event for the same event_id returns the same key.","parameters":[{"name":"x-il-billing-signature","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event_id"],"properties":{"event_id":{"type":"string"},"plan_id":{"type":"string","enum":["pack_500","pack_2500","pack_10000"]},"credits":{"type":"integer"},"order_id":{"type":"string"}}}}}},"responses":{"201":{"description":"Key issued for the payment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuedKey"}}}},"400":{"description":"unknown plan or bad body"},"401":{"description":"bad signature"},"503":{"description":"webhook disabled (no signing secret configured)"}}}},"/api/keys":{"post":{"tags":["onboarding"],"summary":"Issue an agent key from an unlock token (two-step path)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string"},"name":{"type":"string"}}}}}},"responses":{"201":{"description":"Key issued"},"402":{"description":"token required: redeem an access code first"}}}},"/api/unlock":{"post":{"tags":["onboarding"],"summary":"Redeem an access code for an unlock token","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}}}}},"responses":{"200":{"description":"Unlock token"},"400":{"description":"invalid code"}}}},"/v1/call":{"post":{"tags":["call"],"summary":"Call a skill","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["skill"],"properties":{"skill":{"type":"string","enum":["disclosure.inspect","pg.scan","localizer.render"]},"input":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"Skill result with credits_charged and remaining"},"400":{"description":"unknown skill or bad body"},"401":{"description":"missing or invalid agent key"},"402":{"description":"not enough credits: buy a pack, no charge executed"},"429":{"description":"rate limited"},"502":{"description":"upstream engine failed (not charged)"}}}},"/a2a":{"post":{"tags":["call"],"summary":"A2A JSON-RPC message/send","security":[{"bearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{},"method":{"type":"string","enum":["message/send"]},"params":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"JSON-RPC task or error"},"401":{"description":"authentication required"}}}},"/mcp":{"post":{"tags":["mcp"],"summary":"MCP Streamable HTTP (2025-06-18)","security":[{"bearer":[]}],"description":"JSON-RPC 2.0 methods: initialize, ping, tools/list, tools/call. tools/call needs a bearer key; it answers isError:true with a 402 body when credits are short.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jsonrpc":{"type":"string","enum":["2.0"]},"id":{},"method":{"type":"string","enum":["initialize","ping","tools/list","tools/call"]},"params":{"type":"object","additionalProperties":true}}}}}},"responses":{"200":{"description":"JSON-RPC result or error"},"202":{"description":"notification accepted"},"401":{"description":"authentication required"}}}},"/v1/usage":{"get":{"tags":["call"],"summary":"Credit balance and plan quota","security":[{"bearer":[]}],"responses":{"200":{"description":"plan, credits, used, remaining"},"401":{"description":"invalid key"}}}},"/v1/catalog":{"get":{"tags":["discovery"],"summary":"Skills, packs and trial terms","responses":{"200":{"description":"OK"}}}},"/.well-known/agent-card.json":{"get":{"tags":["discovery"],"summary":"A2A 0.3.0 agent card","responses":{"200":{"description":"OK"}}}},"/agent-manifest.json":{"get":{"tags":["discovery"],"summary":"Protocol/endpoint/pricing manifest","responses":{"200":{"description":"OK"}}}},"/mcp.json":{"get":{"tags":["discovery"],"summary":"MCP server card","responses":{"200":{"description":"OK"}}}},"/llms.txt":{"get":{"tags":["discovery"],"summary":"Plain-text brief for LLM agents","responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"ek_<payload>.<signature>"}},"schemas":{"IssuedKey":{"type":"object","properties":{"ok":{"type":"boolean"},"key":{"type":"string"},"plan":{"type":"string"},"credits":{"type":"integer"},"expires_at":{"type":"string","format":"date-time"},"endpoints":{"type":"object"},"mcp":{"type":"object"},"first_call":{"type":"object"},"skills":{"type":"array","items":{"type":"object"}}}}}}}