{"openapi":"3.1.0","info":{"title":"agent-billing","description":"Prepaid API credits so humans can fund agents and agents can fetch the live web for 3 cents per call. PHI-free. Hybrid payments.","version":"0.2.0"},"paths":{"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/ready":{"get":{"summary":"Ready","operationId":"ready_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/robots.txt":{"get":{"summary":"Robots","operationId":"robots_robots_txt_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/sitemap.xml":{"get":{"summary":"Sitemap","operationId":"sitemap_sitemap_xml_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/llms.txt":{"get":{"summary":"Llms Txt","operationId":"llms_txt_llms_txt_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/":{"get":{"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/signup":{"get":{"summary":"Signup Page","operationId":"signup_page_signup_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/agents":{"get":{"summary":"Agents Page","operationId":"agents_page_agents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/organizations":{"post":{"tags":["organizations"],"summary":"Create Organization","operationId":"create_organization_v1_organizations_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/organizations/{org_id}/api-keys":{"post":{"tags":["organizations"],"summary":"Create Api Key","operationId":"create_api_key_v1_organizations__org_id__api_keys_post","parameters":[{"name":"org_id","in":"path","required":true,"schema":{"type":"string","title":"Org Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/events":{"post":{"tags":["events"],"summary":"Ingest Event","operationId":"ingest_event_v1_events_post","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeterEventCreate"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeterEventResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/balance":{"get":{"tags":["balances"],"summary":"Get Balance","operationId":"get_balance_v1_balance_get","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/balance/checkout":{"post":{"tags":["balances"],"summary":"Create Checkout","operationId":"create_checkout_v1_balance_checkout_post","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/balance/topup":{"post":{"tags":["balances"],"summary":"Topup Credits","operationId":"topup_credits_v1_balance_topup_post","parameters":[{"name":"amount_cents","in":"query","required":true,"schema":{"type":"integer","title":"Amount Cents"}},{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/pricing-rules":{"post":{"tags":["Pricing"],"summary":"Create Pricing Rule","operationId":"create_pricing_rule_v1_pricing_rules_post","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricingRuleCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricingRuleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Pricing"],"summary":"List Pricing Rules","operationId":"list_pricing_rules_v1_pricing_rules_get","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PricingRuleResponse"},"title":"Response List Pricing Rules V1 Pricing Rules Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/mcp/tools":{"get":{"tags":["MCP"],"summary":"List Mcp Tools","operationId":"list_mcp_tools_v1_mcp_tools_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Mcp Tools V1 Mcp Tools Get"}}}}}}},"/v1/x402/settle":{"post":{"tags":["x402"],"summary":"Settle X402","description":"Stub settlement endpoint.\nIn production this would verify the on-chain payment.\nFor now it simply credits the wallet so the full agent loop can be tested.","operationId":"settle_x402_v1_x402_settle_post","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402SettleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/stripe/webhook":{"post":{"tags":["stripe"],"summary":"Stripe Webhook","operationId":"stripe_webhook_v1_stripe_webhook_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/tools/charge":{"post":{"tags":["tools"],"summary":"Charge Api Call","operationId":"charge_api_call_v1_tools_charge_post","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/tools/fetch":{"post":{"tags":["tools"],"summary":"Fetch Url","operationId":"fetch_url_v1_tools_fetch_post","parameters":[{"name":"X-API-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FetchBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ApiKeyCreate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes","default":["usage:write","balance:read"]}},"type":"object","title":"ApiKeyCreate"},"ApiKeyResponse":{"properties":{"id":{"type":"string","title":"Id"},"prefix":{"type":"string","title":"Prefix"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"key":{"type":"string","title":"Key"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","prefix","name","key","scopes","created_at"],"title":"ApiKeyResponse"},"BalanceResponse":{"properties":{"organization_id":{"type":"string","title":"Organization Id"},"currency":{"type":"string","title":"Currency"},"balance_cents":{"type":"integer","title":"Balance Cents"},"balance":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Balance"}},"type":"object","required":["organization_id","currency","balance_cents","balance"],"title":"BalanceResponse"},"FetchBody":{"properties":{"url":{"type":"string","maxLength":2048,"minLength":8,"title":"Url"}},"type":"object","required":["url"],"title":"FetchBody"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MeterEventCreate":{"properties":{"event_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Id","description":"Client-provided idempotency key"},"meter":{"type":"string","title":"Meter","description":"Meter name/slug"},"quantity":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Quantity"},"timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Timestamp"},"properties":{"additionalProperties":true,"type":"object","title":"Properties","description":"Non-PHI metadata only"}},"type":"object","required":["meter","quantity"],"title":"MeterEventCreate"},"MeterEventResponse":{"properties":{"id":{"type":"string","title":"Id"},"event_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Id"},"meter":{"type":"string","title":"Meter"},"quantity":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Quantity"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"rating_status":{"type":"string","title":"Rating Status"},"cost_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cost Cents"}},"type":"object","required":["id","event_id","meter","quantity","timestamp","rating_status"],"title":"MeterEventResponse"},"OrganizationCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"OrganizationCreate"},"OrganizationResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","created_at"],"title":"OrganizationResponse"},"PricingRuleCreate":{"properties":{"meter":{"type":"string","title":"Meter","description":"Meter name/slug, e.g. api_call"},"price_per_unit_cents":{"type":"integer","exclusiveMinimum":0.0,"title":"Price Per Unit Cents","description":"Price in cents per unit"},"currency":{"type":"string","title":"Currency","default":"USD"},"model":{"type":"string","title":"Model","default":"per_unit"}},"type":"object","required":["meter","price_per_unit_cents"],"title":"PricingRuleCreate"},"PricingRuleResponse":{"properties":{"id":{"type":"string","title":"Id"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"},"meter_name":{"type":"string","title":"Meter Name"},"price_per_unit_cents":{"type":"integer","title":"Price Per Unit Cents"},"currency":{"type":"string","title":"Currency"},"model":{"type":"string","title":"Model"},"active":{"type":"boolean","title":"Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","organization_id","meter_name","price_per_unit_cents","currency","model","active","created_at"],"title":"PricingRuleResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"X402SettleRequest":{"properties":{"amount_cents":{"type":"integer","exclusiveMinimum":0.0,"title":"Amount Cents"},"tx_hash":{"type":"string","title":"Tx Hash","description":"Transaction hash or payment proof (stub for now)"},"network":{"type":"string","title":"Network","default":"base"},"asset":{"type":"string","title":"Asset","default":"USDC"}},"type":"object","required":["amount_cents","tx_hash"],"title":"X402SettleRequest"}}}}