{"openapi":"3.1.0","jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","info":{"title":"What would Jevsus Do?","version":"1.1.0","description":"Jesus-grounded alignment decisions for agents. Jevsus is an LLM experiment, not Jesus. Request text is sent to OpenAI for evaluation and stored by WWJD for 30 days to improve WWJD, then deleted. Never send secrets."},"servers":[{"url":"https://staging.findjevsus.com"}],"paths":{"/v1/keys/challenge":{"get":{"operationId":"getChallenge","summary":"Get a signed proof-of-work challenge","description":"Rejects a present Origin that differs from PUBLIC_BASE_URL. No CORS permission is returned. This GET has no body.","responses":{"200":{"description":"Challenge expires after ten minutes.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Challenge"}}}},"400":{"description":"Invalid request.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Foreign Origin.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not allowed.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 8 MB.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After seconds.","headers":{"Retry-After":{"schema":{"type":"string"}},"X-WWJD-Request-Id":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Key registration temporarily unavailable.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/keys":{"post":{"operationId":"createFreeKey","summary":"Register a free key once","description":"Rejects a present Origin that differs from PUBLIC_BASE_URL. Requires Content-Type: application/json. No CORS permission is returned. Hash UTF-8 challenge + colon + decimal nonce with SHA-256; the digest must have difficulty leading zero bits. Do not register another key to evade a 402.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"challenge":{"type":"string"},"nonce":{"type":"string","pattern":"^[0-9]{1,32}$"},"label":{"type":"string","maxLength":64}},"required":["challenge","nonce"]}}}},"responses":{"201":{"description":"The key is shown once. Store it safely.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreated"}}}},"400":{"description":"Invalid request.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Foreign Origin.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not allowed.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 8 MB.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After seconds.","headers":{"Retry-After":{"schema":{"type":"string"}},"X-WWJD-Request-Id":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Free-key registration reached its daily breaker or is temporarily unavailable.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/me":{"get":{"operationId":"getKey","summary":"Inspect the current key and credit balance","security":[{"BearerKey":[]}],"responses":{"200":{"description":"Key details. All timestamps are ISO-8601 strings.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"A valid bearer key is required. The message explains how to register.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is disabled or this plan cannot use the route.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not allowed.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/wwjd":{"post":{"operationId":"decide","summary":"Evaluate a proposed action","security":[{"BearerKey":[]}],"description":"Body limit: 8 MB streamed. Up to 100K estimated caller tokens costs 1 credit; up to 1M costs 5; larger input returns 413. Usage is trued up from Stage B caller tokens. Engine failures are refunded; valid refused decisions are charged. Internal keys have unlimited credits and bypass decision rate limits. Request text is sent to OpenAI for evaluation and stored by WWJD for 30 days to improve WWJD, then deleted. Never send secrets.","parameters":[{"in":"header","name":"X-WWJD-Prompt-Set","schema":{"type":"string"},"description":"Internal keys only. Unknown registered prompt set returns 400. Ignored for other plans."},{"in":"header","name":"X-WWJD-Debug","schema":{"const":"1"},"description":"Internal keys only. Include the engine trace on success and debug.usage on errors."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","minLength":1},"context":{"type":"string"}},"required":["action"]}}}},"responses":{"200":{"description":"A charged alignment decision, including valid refusals.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Decision"}}}},"400":{"description":"Invalid request.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"A valid bearer key is required. The message explains how to register.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Insufficient credits. Free keys receive three human choices; paid keys receive open source and billing management.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentRequired"}}}},"403":{"description":"The key is disabled or this plan cannot use the route.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not allowed.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body exceeds 8 MB, caller estimate exceeds 1M tokens, or upstream context limit was exceeded. No charge remains.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After seconds.","headers":{"Retry-After":{"schema":{"type":"string"}},"X-WWJD-Request-Id":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Upstream failed. Credits are refunded.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Upstream is rate-limited. Credits are refunded; wait for Retry-After.","headers":{"Retry-After":{"schema":{"type":"string"}},"X-WWJD-Request-Id":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"The decision deadline was exceeded. Credits are refunded.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/feedback":{"post":{"operationId":"sendFeedback","summary":"Report feedback on one of this key’s decisions","security":[{"BearerKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision_id":{"type":"string"},"expected_verdict":{"type":"string","enum":["aligned","not_aligned","discernment_required"]},"note":{"type":"string","maxLength":2000}},"required":["decision_id","expected_verdict","note"]}}}},"responses":{"202":{"description":"Feedback accepted. Text is stored in R2 for 30 days.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}},"400":{"description":"Invalid request.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"A valid bearer key is required. The message explains how to register.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is disabled or this plan cannot use the route.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Decision does not exist or belongs to another key.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not allowed.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 8 MB.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After seconds.","headers":{"Retry-After":{"schema":{"type":"string"}},"X-WWJD-Request-Id":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service temporarily unavailable.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/subscribe":{"post":{"operationId":"subscribe","summary":"Join the release list","description":"Rejects a present Origin that differs from PUBLIC_BASE_URL. Requires Content-Type: application/json. No CORS permission is returned. Email is sent to Klaviyo and never stored in WWJD D1 or R2. A nonempty website honeypot silently returns 202. Provider failures do not expose subscription state. Limits: 6/minute and 20/day per network.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","maxLength":254},"website":{"type":"string"}},"required":["email"]}}}},"responses":{"202":{"description":"Request accepted.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true}},"required":["ok"]}}}},"400":{"description":"Invalid request.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Foreign Origin.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not allowed.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 8 MB.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After seconds.","headers":{"Retry-After":{"schema":{"type":"string"}},"X-WWJD-Request-Id":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service temporarily unavailable.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/health":{"get":{"operationId":"health","summary":"Inspect engine and deployment versions","responses":{"200":{"description":"Service fingerprint.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"engine_version":{"type":"string"},"prompt_version":{"type":"string"},"corpus_version":{"type":"string"},"model":{"type":"string"},"environment":{"type":"string"},"version_id":{"type":"string"}},"required":["ok","engine_version","prompt_version","corpus_version","model","environment","version_id"]}}}},"405":{"description":"Method not allowed.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After seconds.","headers":{"Retry-After":{"schema":{"type":"string"}},"X-WWJD-Request-Id":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/checkout":{"post":{"operationId":"checkout","summary":"Create a human checkout session","security":[{"BearerKey":[]}],"description":"Rejects a present Origin that differs from PUBLIC_BASE_URL. Requires Content-Type: application/json. No CORS permission is returned.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"enum":["simple","pro"],"type":"string"}},"required":["plan"]}}}},"responses":{"200":{"description":"Checkout URL.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}}}},"400":{"description":"Invalid request.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"A valid bearer key is required. The message explains how to register.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is disabled or this plan cannot use the route.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not allowed.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"This key already has a live subscription; manage it in the portal.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlreadySubscribed"}}}},"413":{"description":"Request body exceeds 8 MB.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After seconds.","headers":{"Retry-After":{"schema":{"type":"string"}},"X-WWJD-Request-Id":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Payment provider failed.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service temporarily unavailable.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/portal":{"get":{"operationId":"billingPortal","summary":"Get the key’s billing management URL","security":[{"BearerKey":[]}],"responses":{"200":{"description":"Portal URL.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}}}},"401":{"description":"A valid bearer key is required. The message explains how to register.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is disabled or this plan cannot use the route.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not allowed.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"This key has no billing customer.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Payment provider failed.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Paid plans are temporarily unavailable; includes the open-source option.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/buy/{token}":{"parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"},"description":"Signed key ID and expiry; never a bearer key."},{"in":"query","name":"plan","required":true,"schema":{"enum":["simple","pro"],"type":"string"}}],"get":{"operationId":"confirmPurchase","summary":"Show the human a purchase confirmation","responses":{"200":{"description":"Plan, price and key prefix with a confirmation button.","content":{"text/html":{"schema":{"type":"string"}}}},"400":{"description":"Invalid plan or expired payment link.","content":{"text/html":{"schema":{"type":"string"}}}},"403":{"description":"Disabled or internal key.","content":{"text/html":{"schema":{"type":"string"}}}},"404":{"description":"Invalid or missing payment link.","content":{"text/html":{"schema":{"type":"string"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After seconds.","headers":{"Retry-After":{"schema":{"type":"string"}},"X-WWJD-Request-Id":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Paid plans open shortly; includes the open-source link.","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"operationId":"startPurchase","summary":"Create a checkout session after confirmation","responses":{"303":{"description":"Continue at Location.","headers":{"Location":{"schema":{"type":"string","format":"uri"}}}},"400":{"description":"Invalid plan or expired payment link.","content":{"text/html":{"schema":{"type":"string"}}}},"403":{"description":"Disabled or internal key.","content":{"text/html":{"schema":{"type":"string"}}}},"404":{"description":"Invalid or missing payment link.","content":{"text/html":{"schema":{"type":"string"}}}},"409":{"description":"Existing subscription; includes the portal link.","content":{"text/html":{"schema":{"type":"string"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After seconds.","headers":{"Retry-After":{"schema":{"type":"string"}},"X-WWJD-Request-Id":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Payment provider failed.","content":{"text/html":{"schema":{"type":"string"}}}},"503":{"description":"Paid plans open shortly; includes the open-source link.","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/v1/stripe/webhook":{"post":{"operationId":"stripeWebhook","summary":"Process a signed Stripe billing event","description":"Accepts raw snapshot events for the pinned Stripe API version. Timestamp tolerance is 300 seconds. No CORS. Duplicate event IDs have no second effect.","parameters":[{"in":"header","name":"Stripe-Signature","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"api_version":{"type":"string"},"created":{"type":"integer"},"data":{"type":"object","properties":{"object":{"type":"object"}},"required":["object"]}},"required":["id","type","api_version","created","data"]}}}},"responses":{"200":{"description":"Event processed or already handled.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad signature, stale timestamp or malformed event.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not allowed.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 8 MB.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"API version mismatch or transaction failure. Stripe should retry.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Billing is off. Stripe should retry later.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/openapi.json":{"get":{"operationId":"openApi","summary":"Read this OpenAPI 3.1 document","responses":{"200":{"description":"OpenAPI document.","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/llms.txt":{"get":{"operationId":"agentSummary","summary":"Read agent instructions, verdicts, pricing and privacy","responses":{"200":{"description":"Agent summary.","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/v1/admin/stats":{"get":{"operationId":"adminStats","summary":"Counts by day, verdict and plan, plus billing flags","security":[{"AdminToken":[]}],"responses":{"200":{"description":"Aggregate metadata; no request text.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"decisions":{"type":"array","items":{"type":"object"}},"keys":{"type":"array","items":{"type":"object"}},"billing_flags":{"type":"array","items":{"type":"object"}},"flagged_subscriptions":{"type":"integer"},"disputes":{"type":"integer"}},"required":["decisions","keys","billing_flags","flagged_subscriptions","disputes"]}}}},"404":{"description":"Not found, including invalid admin token.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After seconds.","headers":{"Retry-After":{"schema":{"type":"string"}},"X-WWJD-Request-Id":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/keys":{"post":{"operationId":"adminCreateKey","summary":"Create an internal or free key","security":[{"AdminToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"enum":["internal","free"],"type":"string"},"label":{"type":"string","maxLength":64}},"required":["plan"]}}}},"responses":{"201":{"description":"Key shown once.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreated"}}}},"400":{"description":"Invalid request.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found, including invalid admin token.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not allowed.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 8 MB.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After seconds.","headers":{"Retry-After":{"schema":{"type":"string"}},"X-WWJD-Request-Id":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service temporarily unavailable.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/keys/{key_id}/credits":{"parameters":[{"in":"path","name":"key_id","required":true,"schema":{"type":"string"}}],"post":{"operationId":"adminChangeCredits","summary":"Adjust a key’s balance without making it negative","security":[{"AdminToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"delta":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["delta"]}}}},"responses":{"200":{"description":"Updated balance.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"credits_remaining":{"type":"integer"}},"required":["id","credits_remaining"]}}}},"400":{"description":"Invalid request.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Key not found or invalid admin token.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not allowed.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 8 MB.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After seconds.","headers":{"Retry-After":{"schema":{"type":"string"}},"X-WWJD-Request-Id":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service temporarily unavailable.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/keys/{key_id}/status":{"parameters":[{"in":"path","name":"key_id","required":true,"schema":{"type":"string"}}],"post":{"operationId":"adminChangeStatus","summary":"Disable or reactivate a key","security":[{"AdminToken":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["active","disabled"]}},"required":["status"]}}}},"responses":{"200":{"description":"Updated status.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["active","disabled"]}},"required":["id","status"]}}}},"400":{"description":"Invalid request.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Key not found or invalid admin token.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Method not allowed.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request body exceeds 8 MB.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached. Wait for Retry-After seconds.","headers":{"Retry-After":{"schema":{"type":"string"}},"X-WWJD-Request-Id":{"schema":{"type":"string"}},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service temporarily unavailable.","headers":{"X-WWJD-Request-Id":{"schema":{"type":"string"},"description":"Request identifier for support."},"Cache-Control":{"schema":{"const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"BearerKey":{"type":"http","scheme":"bearer","bearerFormat":"wwjd_<43 base62 characters>"},"AdminToken":{"type":"http","scheme":"bearer","description":"Operator-only ADMIN_TOKEN. Invalid or absent tokens receive 404."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_request","unauthorized","payment_required","forbidden","not_found","method_not_allowed","already_subscribed","input_too_large","rate_limited","upstream_error","service_unavailable","upstream_timeout","stripe_version_mismatch"]},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"Challenge":{"type":"object","properties":{"challenge":{"type":"string"},"difficulty":{"type":"integer","minimum":1,"maximum":256},"expires_at":{"type":"string","format":"date-time"}},"required":["challenge","difficulty","expires_at"]},"KeyCreated":{"type":"object","properties":{"key":{"type":"string","pattern":"^wwjd_[A-Za-z0-9]{43}$"},"key_id":{"type":"string"},"plan":{"type":"string","enum":["free","simple","pro","internal"]},"credits":{"type":"integer"},"note":{"type":"string"}},"required":["key","key_id","plan","credits","note"]},"Me":{"type":"object","properties":{"key_id":{"type":"string"},"prefix":{"type":"string"},"plan":{"type":"string","enum":["free","simple","pro","internal"]},"renews_as":{"type":["string","null"],"enum":["simple","pro",null]},"credits_remaining":{"type":"integer"},"period_end":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"decisions_last_30d":{"type":"integer"}},"required":["key_id","prefix","plan","renews_as","credits_remaining","period_end","created_at","decisions_last_30d"]},"Credits":{"type":"object","properties":{"charged":{"type":"integer"},"remaining":{"type":"integer"},"plan":{"type":"string","enum":["free","simple","pro","internal"]}},"required":["charged","remaining","plan"]},"OpenSourceOption":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"license":{"const":"AGPL-3.0"},"note":{"type":"string"}},"required":["url","license","note"]},"PlanOption":{"oneOf":[{"type":"object","properties":{"price_usd_month":{"type":"integer"},"credits_per_month":{"type":"integer"},"checkout_url":{"type":"string","format":"uri"}},"required":["price_usd_month","credits_per_month","checkout_url"],"additionalProperties":false},{"type":"object","properties":{"price_usd_month":{"type":"integer"},"credits_per_month":{"type":"integer"},"available":{"const":false}},"required":["price_usd_month","credits_per_month","available"],"additionalProperties":false}]},"PaymentRequired":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"const":"payment_required"},"message":{"type":"string"},"credits":{"type":"object","properties":{"plan":{"type":"string","enum":["free","simple","pro","internal"]},"remaining":{"type":"integer"},"needed":{"type":"integer","enum":[1,5]},"period_end":{"type":["string","null"],"format":"date-time"}},"required":["plan","remaining","needed"]},"options":{"oneOf":[{"type":"object","properties":{"open_source":{"$ref":"#/components/schemas/OpenSourceOption"},"simple":{"$ref":"#/components/schemas/PlanOption"},"pro":{"$ref":"#/components/schemas/PlanOption"}},"required":["open_source","simple","pro"],"additionalProperties":false},{"type":"object","properties":{"open_source":{"$ref":"#/components/schemas/OpenSourceOption"},"manage":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]}},"required":["open_source","manage"],"additionalProperties":false}]}},"required":["code","message","credits","options"]}},"required":["error"]},"AlreadySubscribed":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"const":"already_subscribed"},"message":{"type":"string"},"portal_url":{"type":"string","format":"uri"}},"required":["code","message","portal_url"]}},"required":["error"]},"Decision":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"wwjd.decision"},"verdict":{"type":"string","enum":["aligned","not_aligned","discernment_required"]},"reason":{"type":"string","enum":["judged","dilemma","guard_override","guard_soft","guard_refused","great_commandment_concern","inconsistent","manipulation_suspected","low_margin","refused"]},"alignment_probability":{"type":["number","null"],"minimum":0,"maximum":1},"confidence":{"type":["number","null"],"minimum":0,"maximum":1},"ask_human":{"type":"boolean"},"refused":{"type":"boolean"},"verdict_probabilities":{"type":"object","properties":{"aligned":{"type":"number","minimum":0,"maximum":1},"not_aligned":{"type":"number","minimum":0,"maximum":1},"discernment_required":{"type":"number","minimum":0,"maximum":1}},"required":["aligned","not_aligned","discernment_required"]},"scores":{"type":"object","properties":{"love_of_god":{"type":["number","null"],"minimum":0,"maximum":1},"love_of_neighbor":{"type":["number","null"],"minimum":0,"maximum":1}},"required":["love_of_god","love_of_neighbor"]},"guards":{"type":"object","properties":{"ten_commandments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"commandment":{"type":"string"},"ref":{"type":"string"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["id","commandment","ref","probability"]}},"triggered":{"type":"array","items":{"type":"string"}},"dilemma":{"type":["number","null"],"minimum":0,"maximum":1},"manipulation":{"type":["number","null"],"minimum":0,"maximum":1},"overridden":{"type":"boolean"},"notes":{"type":"array","items":{"type":"string"}}},"required":["ten_commandments","triggered","dilemma","manipulation","overridden","notes"]},"basis":{"type":"object","properties":{"top_rule":{"type":"string"},"directives":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string"},"text":{"type":"string"}},"required":["ref","text"]}},"topics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["id","label","probability"]}},"teachings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"ref":{"type":"string"},"probability":{"type":"number","minimum":0,"maximum":1}},"required":["id","name","ref","probability"]}},"passages":{"type":"array","items":{"type":"object","properties":{"ref":{"type":"string"},"full_ref":{"type":"string"},"title":{"type":"string"},"kind":{"enum":["jesus_teaching","nt","ot"],"type":"string"},"topic":{"type":"string"},"text":{"type":"string"}},"required":["ref","kind"]}},"routing":{"type":"object","properties":{"fallback":{"type":"boolean"}},"required":["fallback"]},"truncated":{"type":"boolean"}},"required":["top_rule","directives","topics","teachings","passages","routing","truncated"]},"summary":{"type":"string"},"credits":{"$ref":"#/components/schemas/Credits"},"model":{"type":"string"},"engine_version":{"type":"string"},"prompt_version":{"type":"string"},"corpus_version":{"type":"string"},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"decisions_calls":{"type":"integer"},"est_input_tokens":{"type":"integer"},"calls":{"type":"array","items":{"type":"object","properties":{"stage":{"enum":["stage_a","stage_b"],"type":"string"},"input_tokens":{"type":"integer"}},"required":["stage","input_tokens"]}}},"required":["input_tokens","decisions_calls","est_input_tokens","calls"]},"latency_ms":{"type":"number","minimum":0},"retention":{"const":"Request text is sent to OpenAI for evaluation and stored by WWJD for 30 days to improve WWJD, then deleted. Never send secrets."},"disclaimer":{"type":"string"},"debug":{"type":"object","description":"Engine trace, returned only for an internal key with X-WWJD-Debug: 1."}},"required":["id","object","verdict","reason","alignment_probability","confidence","ask_human","refused","verdict_probabilities","scores","guards","basis","summary","credits","model","engine_version","prompt_version","corpus_version","usage","latency_ms","retention","disclaimer"]}}}}