openapi: 3.1.0 info: title: AI Bounties API version: 0.6.0 description: > Phase 6 API for BSV AI Bounties. Live document is also served at GET /openapi.json. Acceptance kinds: manual, http (JSON APIs), schema, hash, command (alias of hash), llm-judge. Auth: real Yours/EC keys BSM-sign challenge `message` (compact base64); demo sha256 only for non-EC keys when AUTH_MODE=demo|both. servers: - url: http://localhost:8787 components: securitySchemes: bearerAuth: type: http scheme: bearer description: > Session token from POST /v1/auth/login. Challenge demoHint explains BSM vs demo sha256 for the controller key. paths: /health: get: operationId: health summary: Health check responses: '200': description: OK /v1/bounties: get: operationId: listBounties summary: List bounties parameters: - name: status in: query schema: type: string enum: [open, claimed, submitted, paid, refunded, cancelled] - name: category in: query schema: type: string - name: limit in: query schema: type: integer default: 50 responses: '200': description: Bounty list post: operationId: createBounty summary: Create / index a bounty (Bearer session required) security: - bearerAuth: [] responses: '201': description: Created '401': description: Unauthorized — login required /v1/bounties/{id}/checkout: post: operationId: createBountyCheckout summary: Hosted Stripe Checkout Session (USD card). Bearer poster session (same as POST /v1/bounties). security: - bearerAuth: [] responses: '200': description: Checkout URL '401': description: Unauthorized — login required /v1/stripe/webhook: post: operationId: stripeWebhook summary: Stripe webhook. Verifies Stripe-Signature. checkout.session.completed marks funded (idempotent on session id). responses: '200': description: Received '400': description: Missing or invalid signature /v1/funding/config: get: operationId: fundingConfig summary: USD card fee % and sat payout fee responses: '200': description: Fee config /v1/llm/draft-bounty: post: operationId: draftBounty summary: LLM-assisted bounty draft (Grok by default) responses: '200': description: Draft