{"openapi":"3.1.0","info":{"title":"Business Factory Micropayment Kernel","version":"0.1.0","description":"Bizkernel micropayment kernel. Prepaid credits (Paystack + Flutterwave webhooks) and x402 USDC on Base. 1 credit = $0.01 = 10000 USDC atomic. No custody, no lending, no swaps."},"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"X-Api-Key"},"bearerAuth":{"type":"http","scheme":"bearer"},"serviceToken":{"type":"apiKey","in":"header","name":"X-Bizkernel-Service-Token"},"paymentSignature":{"type":"apiKey","in":"header","name":"PAYMENT-SIGNATURE"}},"schemas":{}},"paths":{"/":{"get":{"summary":"Minimal operator health page","tags":["meta"],"responses":{"200":{"description":"Default Response"}}}},"/health":{"get":{"summary":"Liveness probe","tags":["meta"],"responses":{"200":{"description":"Default Response"}}}},"/ready":{"get":{"summary":"Readiness probe (database + circuit breakers)","tags":["meta"],"responses":{"200":{"description":"Default Response"}}}},"/metrics":{"get":{"summary":"In-process counters (JSON by default, Prometheus text via Accept or ?format=prom)","tags":["meta"],"responses":{"200":{"description":"Default Response"}}}},"/v1/keys":{"post":{"summary":"Create an API key (plaintext shown once)","tags":["admin"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"dailySpendCeiling":{"type":"integer"},"rpmLimit":{"type":"integer"},"burstLimit":{"type":"integer"}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/keys/{id}":{"get":{"summary":"Get API key metadata and credit balance","tags":["admin"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/keys/{id}/revoke":{"post":{"summary":"Revoke an API key","tags":["admin"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/keys/{id}/jwt":{"post":{"summary":"Mint a short-lived service-account JWT for this key","tags":["admin"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/credits/topup/success":{"get":{"summary":"Public Paystack/Flutterwave return URL (no auth). Credits land via webhook.","tags":["credits"],"responses":{"200":{"description":"Default Response"}}}},"/v1/credits/balance":{"get":{"summary":"Prepaid credit balance (1 credit = $0.01 = 10000 USDC atomic)","tags":["credits"],"security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/credits/authorize":{"post":{"summary":"Hold prepaid credits (authorize). Capture or release later.","tags":["credits"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"requestId":{"type":"string"},"skill":{"type":"string"},"path":{"type":"string"},"amountCredits":{"type":"number"},"amountUsdcAtomic":{"type":"integer"}}}}}},"security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/credits/capture":{"post":{"summary":"Capture a previously authorized credit hold","tags":["credits"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"authorizationId":{"type":"string"},"requestId":{"type":"string"}}}}}},"security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/credits/release":{"post":{"summary":"Release (void) a credit hold back to prepaid balance","tags":["credits"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"authorizationId":{"type":"string"},"requestId":{"type":"string"}}}}}},"security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/credits/refund":{"post":{"summary":"Refund a settled credit-rail usage event back to prepaid balance","tags":["credits"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["requestId"],"properties":{"requestId":{"type":"string"},"note":{"type":"string"}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/credits/topup/initialize":{"post":{"summary":"Start a prepaid top-up (Paystack or Flutterwave). Both rails are live when operator secrets are in env.","tags":["credits"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["apiKeyId","amountUsd"],"properties":{"apiKeyId":{"type":"string"},"amountUsd":{"type":"number"},"provider":{"type":"string","enum":["paystack","flutterwave"]},"email":{"type":"string"},"callbackUrl":{"type":"string"}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/sandbox/topup":{"post":{"summary":"Admin credit grant (sandbox). Bypasses MIN_PREPAID_BUNDLE. Disabled when SANDBOX=false.","tags":["sandbox"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["apiKeyId","amount"],"properties":{"apiKeyId":{"type":"string"},"amount":{"type":"number"},"provider":{"type":"string","enum":["paystack","flutterwave","sandbox","admin"]}}}}}},"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/ledger":{"get":{"summary":"Recent usage ledger rows","tags":["admin"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"apiKeyId","required":false},{"schema":{"type":"integer"},"in":"query","name":"limit","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/prices":{"get":{"summary":"Versioned price table (USDC atomic + credits at global peg)","tags":["meta"],"responses":{"200":{"description":"Default Response"}}}},"/v1/sandbox/fixtures":{"get":{"summary":"Example Paystack and Flutterwave webhook payloads","tags":["sandbox"],"responses":{"200":{"description":"Default Response"}}}},"/v1/webhooks/paystack":{"post":{"summary":"Paystack charge.success → credit ledger","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"Default Response"}}}},"/v1/webhooks/flutterwave":{"post":{"summary":"Flutterwave charge.completed → credit ledger","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"Default Response"}}}},"/webhooks/paystack":{"post":{"summary":"Legacy alias for /v1/webhooks/paystack","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"Default Response"}}}},"/webhooks/flutterwave":{"post":{"summary":"Legacy alias for /v1/webhooks/flutterwave","tags":["webhooks"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"Default Response"}}}},"/v1/x402/challenge":{"post":{"summary":"Issue an x402 PAYMENT-REQUIRED challenge (USDC to SETTLEMENT_ADDRESS)","tags":["x402"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"skill":{"type":"string"},"path":{"type":"string"},"requestId":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response"}}}},"/v1/x402/settle":{"post":{"summary":"Verify inbound USDC transfer to SETTLEMENT_ADDRESS and record settlement","tags":["x402"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"skill":{"type":"string"},"path":{"type":"string"},"requestId":{"type":"string"},"paymentSignature":{"type":"string"}}}}}},"responses":{"200":{"description":"Default Response"}}}},"/v1/admin/products/{product_id}":{"put":{"summary":"Register or replace a product spec (JSON or YAML)","tags":["admin"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"parameters":[{"schema":{"type":"string"},"in":"path","name":"product_id","required":true}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/admin/products":{"get":{"summary":"List registered products","tags":["admin"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response"}}}},"/v1/products":{"get":{"summary":"Discover products product-agents can call","tags":["products"],"responses":{"200":{"description":"Default Response"}}}},"/v1/products/{product_id}":{"get":{"summary":"Get one product spec","tags":["products"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"product_id","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/p/{productId}/{*}":{"get":{"summary":"Call a registered product skill (x402 or API key). Path after product id matches the spec.","tags":["products"],"security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"productId","required":true},{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Call a registered product skill (x402 or API key). Path after product id matches the spec.","tags":["products"],"security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"productId","required":true},{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Call a registered product skill (x402 or API key). Path after product id matches the spec.","tags":["products"],"security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"productId","required":true},{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Call a registered product skill (x402 or API key). Path after product id matches the spec.","tags":["products"],"security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"productId","required":true},{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Call a registered product skill (x402 or API key). Path after product id matches the spec.","tags":["products"],"security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"productId","required":true},{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/{productKey}/{*}":{"get":{"summary":"Call a product by base_path mount (/v1/{product_id}/*). Honors metered:false.","tags":["products"],"security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"productKey","required":true},{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"Call a product by base_path mount (/v1/{product_id}/*). Honors metered:false.","tags":["products"],"security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"productKey","required":true},{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"Call a product by base_path mount (/v1/{product_id}/*). Honors metered:false.","tags":["products"],"security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"productKey","required":true},{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"Call a product by base_path mount (/v1/{product_id}/*). Honors metered:false.","tags":["products"],"security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"productKey","required":true},{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"Call a product by base_path mount (/v1/{product_id}/*). Honors metered:false.","tags":["products"],"security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"productKey","required":true},{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/agentutils":{"get":{"summary":"AgentUtils gateway mount (unmetered catalog). Skills live under /v1/agentutils/{path}.","tags":["products"],"responses":{"200":{"description":"Default Response"}}}},"/v1/agentutils/{*}":{"get":{"summary":"AgentUtils proxy. Unmetered GET /health /pricing; metered POST /extract /screenshot /pdf/extract /schema. Forwards to AGENTUTILS_UPSTREAM (strip/preserve per spec.path_rewrite).","tags":["products"],"security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}},"post":{"summary":"AgentUtils proxy. Unmetered GET /health /pricing; metered POST /extract /screenshot /pdf/extract /schema. Forwards to AGENTUTILS_UPSTREAM (strip/preserve per spec.path_rewrite).","tags":["products"],"security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}},"put":{"summary":"AgentUtils proxy. Unmetered GET /health /pricing; metered POST /extract /screenshot /pdf/extract /schema. Forwards to AGENTUTILS_UPSTREAM (strip/preserve per spec.path_rewrite).","tags":["products"],"security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}},"patch":{"summary":"AgentUtils proxy. Unmetered GET /health /pricing; metered POST /extract /screenshot /pdf/extract /schema. Forwards to AGENTUTILS_UPSTREAM (strip/preserve per spec.path_rewrite).","tags":["products"],"security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}},"delete":{"summary":"AgentUtils proxy. Unmetered GET /health /pricing; metered POST /extract /screenshot /pdf/extract /schema. Forwards to AGENTUTILS_UPSTREAM (strip/preserve per spec.path_rewrite).","tags":["products"],"security":[{"apiKey":[]},{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"in":"path","name":"*","required":true}],"responses":{"200":{"description":"Default Response"}}}},"/v1/paid/echo":{"post":{"summary":"Echo a JSON payload (10_000 USDC atomic / $0.01)","tags":["paid"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"additionalProperties":true}}}},"parameters":[{"schema":{"type":"string"},"in":"header","name":"x-api-key","required":false},{"schema":{"type":"string"},"in":"header","name":"x-request-id","required":false},{"schema":{"type":"string"},"in":"header","name":"idempotency-key","required":false},{"schema":{"type":"string"},"in":"header","name":"payment-signature","required":false}],"security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/v1/paid/hash":{"post":{"summary":"SHA-256 a string (20_000 USDC atomic / $0.02)","tags":["paid"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"input":{"type":"string"}},"required":["input"]}}}},"parameters":[{"schema":{"type":"string"},"in":"header","name":"x-api-key","required":false},{"schema":{"type":"string"},"in":"header","name":"x-request-id","required":false},{"schema":{"type":"string"},"in":"header","name":"idempotency-key","required":false},{"schema":{"type":"string"},"in":"header","name":"payment-signature","required":false}],"security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/v1/paid/health":{"get":{"summary":"Paid health ping (10_000 USDC atomic / $0.01)","tags":["paid"],"parameters":[{"schema":{"type":"string"},"in":"header","name":"x-api-key","required":false},{"schema":{"type":"string"},"in":"header","name":"x-request-id","required":false},{"schema":{"type":"string"},"in":"header","name":"idempotency-key","required":false},{"schema":{"type":"string"},"in":"header","name":"payment-signature","required":false}],"security":[{"apiKey":[]},{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"402":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"403":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"503":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/openapi.json":{"get":{"summary":"OpenAPI 3 document","tags":["meta"],"responses":{"200":{"description":"Default Response"}}}}},"servers":[{"url":"https://api.callmeter.dev","description":"this instance"}],"tags":[{"name":"paid","description":"Metered skills"},{"name":"credits","description":"Prepaid balances, authorize/capture/release/refund"},{"name":"x402","description":"USDC challenge and settle"},{"name":"admin","description":"Key and ledger administration"},{"name":"webhooks","description":"Paystack and Flutterwave REST callbacks"},{"name":"sandbox","description":"Local fixtures"},{"name":"products","description":"Registered products (AgentUtils first)"},{"name":"meta","description":"Health and docs"}]}