{"openapi":"3.1.0","info":{"title":"Gonka Cost Optimizer A2A Agent","description":"Register users, analyze LLM costs, 7000x+ savings vs OpenAI","version":"1.3.0"},"paths":{"/agent/call":{"post":{"summary":"Agent Call","description":"Main A2A endpoint: Register user, test inference, analyze costs\n\nInput:\n{\n  \"agent_id\": \"caller-uuid\",\n  \"user_context\": {\n    \"monthly_spend_usd\": 500,\n    \"current_provider\": \"openai\",\n    \"language\": \"en\"\n  },\n  \"user_query\": \"Show me savings\",\n  \"callback_url\": \"https://...\"\n}","operationId":"agent_call_agent_call_post","parameters":[{"name":"db","in":"query","required":false,"schema":{"title":"Db"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Agent Call Agent Call Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/messages":{"post":{"summary":"A2A Messages Endpoint","description":"A2A Protocol endpoint — POST /messages.\n\nAccepts three request shapes:\n1. JSON-RPC 2.0 (A2A spec): {\"jsonrpc\":\"2.0\",\"id\":...,\"method\":\"message/send\",\"params\":{\"message\":{...}}}\n   → response is wrapped in {\"jsonrpc\":\"2.0\",\"id\":...,\"result\":{...}}\n2. Plain JSON (legacy):     {\"message\":{...}, \"configuration\":{...}}\n3. text/plain body          → treated as the user message text","operationId":"a2a_messages_endpoint_messages_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/agent/trial":{"post":{"summary":"Agent Trial","description":"Issue a free trial API key (gc-) to an agent.\nOne key per agent_id, valid 24h, limit ~100K tokens.\n\nInput:\n{\n  \"agent_id\": \"my-agent-uuid\",      // required, used for idempotency\n  \"callback_url\": \"https://...\"     // optional: A2A push URL to receive key when slot frees up\n}","operationId":"agent_trial_agent_trial_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Agent Trial Agent Trial Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tasks/{task_id}":{"get":{"summary":"Get Task","description":"A2A Protocol: GET /tasks/{taskId}\nReturns task status. Since we process synchronously, tasks are always completed.","operationId":"get_task_tasks__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Task Tasks  Task Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/status":{"get":{"summary":"Agent Status","description":"Health check endpoint for monitors (Chiark.ai, wmcp.sh)","operationId":"agent_status_agent_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Agent Status Agent Status Get"}}}}}}},"/agent/capability-card":{"get":{"summary":"Capability Card","description":"Return A2A capability card for registry discovery","operationId":"capability_card_agent_capability_card_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Capability Card Agent Capability Card Get"}}}}}}},"/badge/table":{"get":{"summary":"Badge Table","description":"SVG pricing comparison table badge for GitHub README","operationId":"badge_table_badge_table_get","responses":{"200":{"description":"Successful Response"}}}},"/.well-known/agent.json":{"get":{"summary":"Well Known Agent Card","description":"A2A Agent Card at legacy discovery path (pre-v0.3)","operationId":"well_known_agent_card__well_known_agent_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Well Known Agent Card  Well Known Agent Json Get"}}}}}}},"/.well-known/agent-card.json":{"get":{"summary":"Well Known Agent Card V03","description":"A2A Agent Card at standard discovery path (A2A v0.3+)","operationId":"well_known_agent_card_v03__well_known_agent_card_json_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Well Known Agent Card V03  Well Known Agent Card Json Get"}}}}}}},"/":{"get":{"summary":"Landing Page","description":"Public landing page for humans and agents","operationId":"landing_page__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"summary":"Root Post","description":"Fallback for A2A clients that POST to the base URL instead of /messages.\nDelegates to the /messages handler (incl. JSON-RPC and text/plain support).","operationId":"root_post__post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/dashboard":{"get":{"summary":"Dashboard Page","description":"Internal monitoring dashboard","operationId":"dashboard_page_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/favicon.ico":{"get":{"summary":"Favicon","description":"Favicon endpoint for browser requests","operationId":"favicon_favicon_ico_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health","description":"Simple health check","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Health Health Get"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}