{"openapi":"3.1.0","info":{"title":"Overwing API","version":"0.6.0","summary":"Guardrails for LLM output: typed safety, quality and compliance verdicts.","description":"Send any text and a rule set slug; receive a pass/fail/review verdict per rule and in aggregate, with calibrated confidence, typically in under 500 ms. Authenticate with `Authorization: Bearer ow_live_...`. Every error is `{ \"error\": \"...\" }`. Agents are welcome: see /llms.txt for a plain-text guide, POST /api/v1/signup for one-call onboarding, and the overwing-mcp package for MCP clients. Human-readable reference at /docs."},"servers":[{"url":"https://overwing.ai"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Evaluate","description":"Score text against a rule set"},{"name":"Rule sets","description":"Prebuilt and custom rule sets"},{"name":"Account","description":"Keys, usage, webhooks, identity"},{"name":"Onboarding","description":"Self-serve account creation"},{"name":"Billing","description":"Plans and subscriptions (Stripe)"},{"name":"Meta","description":"Health and discovery"}],"paths":{"/api/v1/evaluate/batch":{"post":{"tags":["Evaluate"],"operationId":"evaluateBatch","summary":"Evaluate up to 50 inputs against one rule set in a single call","description":"Each item counts as one evaluation against the daily quota and the per-minute burst limit; the whole batch is reserved up front (429 if it would not fit). Items succeed or fail independently and are processed with bounded concurrency. Supports Idempotency-Key.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":255,"pattern":"^[A-Za-z0-9_.:-]{1,255}$"},"description":"Optional. Retrying with the same key and body within 24 hours returns the stored response (header Idempotency-Replayed: true) without re-running or re-charging. Same key with a different body returns 422; a still-running original returns 409."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchRequest"},"example":{"rule_set":"content-safety","items":[{"id":"msg-1","input":"Hello there."},{"id":"msg-2","input":"Call me at 555-123-4567.","metadata":{"thread":"t1"}}]}}}},"responses":{"200":{"description":"Per-item results (some items may carry an error)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResponse"}}}},"400":{"description":"Invalid input; the message names the offending item","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Rule set not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency-Key still in progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Idempotency-Key reused with a different body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Batch would exceed the daily quota or the per-minute limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Every item failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResponse"}}}}}}},"/api/v1/evaluate":{"post":{"tags":["Evaluate"],"operationId":"evaluate","summary":"Evaluate text against a rule set","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":255,"pattern":"^[A-Za-z0-9_.:-]{1,255}$"},"description":"Optional. Retrying with the same key and body within 24 hours returns the stored response (header Idempotency-Replayed: true) without re-running or re-charging. Same key with a different body returns 422; a still-running original returns 409."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluateRequest"},"example":{"input":"Hello, this is a test.","rule_set":"content-safety","metadata":{"session":"abc"}}}}},"responses":{"200":{"description":"Verdict","headers":{"X-RateLimit-Limit":{"schema":{"type":"integer"},"description":"Daily evaluation limit"},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"},"description":"Unix seconds at next UTC midnight"},"X-Burst-Limit":{"schema":{"type":"integer"},"description":"Evaluations allowed per minute on this plan"},"X-Burst-Remaining":{"schema":{"type":"integer"}},"X-Burst-Reset":{"schema":{"type":"integer"},"description":"Unix seconds when the current minute window ends"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Evaluation"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Rule set not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Idempotency-Key still in progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Idempotency-Key reused with a different body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Daily quota or per-minute burst limit reached (see Retry-After and the X-RateLimit-* / X-Burst-* headers)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Evaluation engine error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/evaluations":{"delete":{"tags":["Evaluate"],"operationId":"purgeEvaluations","summary":"Bulk delete stored evaluations (all, or those before a date)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["confirm"],"properties":{"confirm":{"type":"string","const":"delete"},"before":{"type":"string","format":"date-time"}}}}}},"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"integer"},"before":{"type":["string","null"]}}}}}},"400":{"description":"Missing confirmation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Evaluate"],"operationId":"listEvaluations","summary":"List evaluations, newest first","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Opaque cursor from next_cursor"},{"name":"verdict","in":"query","schema":{"$ref":"#/components/schemas/Verdict"}},{"name":"rule_set","in":"query","schema":{"type":"string"},"description":"Rule set slug"}],"responses":{"200":{"description":"Page of evaluations","content":{"application/json":{"schema":{"type":"object","required":["evaluations","next_cursor"],"properties":{"evaluations":{"type":"array","items":{"$ref":"#/components/schemas/EvaluationSummary"}},"next_cursor":{"type":["string","null"]}}}}}},"400":{"description":"Invalid query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/evaluations/{id}":{"delete":{"tags":["Evaluate"],"operationId":"deleteEvaluation","summary":"Delete one stored evaluation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Evaluate"],"operationId":"getEvaluation","summary":"Fetch one evaluation with input and per-rule results","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^eval_[A-Za-z0-9_-]{16}$"}}],"responses":{"200":{"description":"Evaluation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationDetail"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/rule-sets":{"get":{"tags":["Rule sets"],"operationId":"listRuleSets","summary":"List rule sets visible to this org","parameters":[{"name":"include_inactive","in":"query","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Rule sets","content":{"application/json":{"schema":{"type":"object","properties":{"rule_sets":{"type":"array","items":{"$ref":"#/components/schemas/RuleSet"}}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Rule sets"],"operationId":"createRuleSet","summary":"Create a custom rule set","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleSetCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleSet"}}}},"400":{"description":"Validation error; the message names the offending field","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Slug already taken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/rule-sets/{slug}":{"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"get":{"tags":["Rule sets"],"operationId":"getRuleSet","summary":"Fetch a rule set with its rules","responses":{"200":{"description":"Rule set","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleSet"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Rule sets"],"operationId":"updateRuleSet","summary":"Update a custom rule set (rules, if given, replace the full list)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleSetUpdate"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleSet"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"System rule sets are read-only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Rule sets"],"operationId":"deleteRuleSet","summary":"Deactivate a custom rule set (soft delete)","responses":{"200":{"description":"Deactivated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"is_active":{"type":"boolean"}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"System rule sets are read-only","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/usage":{"get":{"tags":["Account"],"operationId":"getUsage","summary":"Daily usage and remaining quota","parameters":[{"name":"days","in":"query","schema":{"type":"integer","minimum":1,"maximum":90,"default":30}}],"responses":{"200":{"description":"Usage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Usage"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/me":{"get":{"tags":["Account"],"operationId":"whoAmI","summary":"Identify the org behind the key","responses":{"200":{"description":"Identity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/api-keys":{"get":{"tags":["Account"],"operationId":"listApiKeys","summary":"List API keys (prefixes only)","responses":{"200":{"description":"Keys","content":{"application/json":{"schema":{"type":"object","properties":{"api_keys":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Account"],"operationId":"createApiKey","summary":"Mint a new API key (returned once)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","maxLength":100}}}}}},"responses":{"201":{"description":"Issued key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IssuedApiKey"}}}},"400":{"description":"name is required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Active key limit reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/api-keys/{id}":{"delete":{"tags":["Account"],"operationId":"revokeApiKey","summary":"Revoke an API key","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"is_active":{"type":"boolean","const":false}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhook":{"get":{"tags":["Account"],"operationId":"getWebhook","summary":"Current webhook configuration","responses":{"200":{"description":"Webhook","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Webhook"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Account"],"operationId":"setWebhook","summary":"Set or rotate the webhook; the signing secret is returned once","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri","description":"https URL (http allowed for localhost)"}}}}}},"responses":{"200":{"description":"Configured","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSecret"}}}},"400":{"description":"Invalid URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Account"],"operationId":"clearWebhook","summary":"Remove the webhook","responses":{"200":{"description":"Cleared"},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/signup":{"post":{"tags":["Onboarding"],"operationId":"signup","summary":"Create an account, organization and first API key in one call","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":12,"maxLength":128},"org_name":{"type":"string","maxLength":200}}}}}},"responses":{"201":{"description":"Account created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignupResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Email already registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Signup throttled for this address","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Programmatic signup not enabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/org":{"delete":{"tags":["Account"],"operationId":"deleteOrganization","summary":"Delete the organization and all its data; cancels any subscription first","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["confirm"],"properties":{"confirm":{"type":"string","description":"The exact organization name"}}}}}},"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"},"org_id":{"type":"string"},"subscription_canceled":{"type":"boolean"}}}}}},"400":{"description":"Confirmation mismatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Subscription could not be canceled; nothing deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/audit-log":{"get":{"tags":["Account"],"operationId":"listAuditEvents","summary":"Security-relevant events for this org (keys, webhooks, rule sets, billing, rejected keys)","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"before","in":"query","schema":{"type":"string","format":"date-time"},"description":"Return events created before this timestamp (from next_before)"}],"responses":{"200":{"description":"Events, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/AuditEvent"}},"next_before":{"type":["string","null"]}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/plans":{"get":{"tags":["Billing"],"operationId":"listPlans","summary":"Public plan catalog with limits and prices","security":[],"responses":{"200":{"description":"Plans","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanCatalog"}}}}}}},"/api/v1/billing":{"get":{"tags":["Billing"],"operationId":"getBilling","summary":"Current plan, limit and subscription status","responses":{"200":{"description":"Billing status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingStatus"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Billing"],"operationId":"cancelSubscription","summary":"Cancel at the end of the current period","responses":{"200":{"description":"Scheduled","content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string"},"cancels_at":{"type":["string","null"]},"subscription_status":{"type":"string"}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"No active subscription","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Billing not enabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/billing/checkout":{"post":{"tags":["Billing"],"operationId":"createCheckout","summary":"Hosted Stripe Checkout URL for a person to complete","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["plan"],"properties":{"plan":{"type":"string","enum":["starter","growth","scale"]},"success_url":{"type":"string","format":"uri"},"cancel_url":{"type":"string","format":"uri"}}}}}},"responses":{"201":{"description":"Checkout session","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"plan":{"type":"string"},"expires_in_seconds":{"type":"integer"}}}}}},"400":{"description":"Invalid plan or URLs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Already subscribed; use subscribe or portal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Billing not enabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/billing/subscribe":{"post":{"tags":["Billing"],"operationId":"subscribe","summary":"Subscribe or switch plans with no browser","description":"New subscriptions need a Stripe payment method id (pm_...), created with Stripe.js, a Stripe test token, or an agent payment provider. Switching an existing subscription needs only the plan and is prorated. Returns 202 with payment_url when the bank requires an extra confirmation step.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["plan"],"properties":{"plan":{"type":"string","enum":["starter","growth","scale"]},"payment_method":{"type":"string","pattern":"^pm_[A-Za-z0-9]+$"}}}}}},"responses":{"201":{"description":"Active","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeResponse"}}}},"202":{"description":"Requires action","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeResponse"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Payment method rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Already on that plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Billing not enabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/billing/portal":{"post":{"tags":["Billing"],"operationId":"createPortal","summary":"Stripe customer portal URL (invoices, cards, cancel)","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"return_url":{"type":"string","format":"uri"}}}}}},"responses":{"201":{"description":"Portal session","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri"}}}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"No billing account yet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Billing not enabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/health":{"get":{"tags":["Meta"],"operationId":"health","summary":"Liveness","security":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"service":{"type":"string"},"version":{"type":"string"},"timestamp":{"type":"string","format":"date-time"}}}}}}}}},"/api/v1/openapi.json":{"get":{"tags":["Meta"],"operationId":"openapi","summary":"This document","security":[],"responses":{"200":{"description":"OpenAPI 3.1 document"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"ow_live_<32 hex>","description":"API key from the dashboard, POST /api/v1/api-keys, or POST /api/v1/signup"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Human-readable message"}}},"Verdict":{"type":"string","enum":["pass","fail","review"],"description":"fail: a rule's fail condition matched. review: a rule's confidence was below its review threshold and nothing failed. pass: otherwise."},"QuestionType":{"type":"string","enum":["choice","score","noul"]},"EvaluateRequest":{"type":"object","required":["input","rule_set"],"properties":{"input":{"type":"string","maxLength":100000,"description":"The LLM output (or any text) to evaluate"},"rule_set":{"type":"string","description":"Rule set slug, e.g. content-safety"},"metadata":{"type":"object","additionalProperties":true,"description":"Opaque context echoed back and stored with the evaluation"}}},"RuleResult":{"type":"object","required":["rule","type","answer","probability","confidence","verdict"],"properties":{"rule":{"type":"string"},"type":{"$ref":"#/components/schemas/QuestionType"},"answer":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}],"description":"choice: selected option; score: position on the level scale (may be fractional); noul: boolean"},"probability":{"type":"number","minimum":0,"maximum":1},"confidence":{"type":"number","minimum":0,"maximum":1},"verdict":{"$ref":"#/components/schemas/Verdict"}}},"Evaluation":{"type":"object","required":["id","verdict","aggregate_score","confidence","latency_ms","results"],"properties":{"id":{"type":"string","example":"eval_aBcDeFgHiJkLmNoP"},"verdict":{"$ref":"#/components/schemas/Verdict"},"aggregate_score":{"type":"number","minimum":0,"maximum":1,"description":"Weighted score: pass=1, review=0.5, fail=0 per rule, weighted by rule weight"},"confidence":{"type":"number","description":"Minimum confidence across rules"},"latency_ms":{"type":"integer"},"results":{"type":"array","items":{"$ref":"#/components/schemas/RuleResult"}}}},"BatchRequest":{"type":"object","required":["rule_set","items"],"properties":{"rule_set":{"type":"string"},"items":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","required":["input"],"properties":{"id":{"type":"string","maxLength":128,"description":"Your own identifier, echoed back; must be unique within the batch"},"input":{"type":"string","maxLength":100000},"metadata":{"type":"object","additionalProperties":true}}}}}},"BatchResponse":{"type":"object","properties":{"summary":{"type":"object","properties":{"total":{"type":"integer"},"pass":{"type":"integer"},"fail":{"type":"integer"},"review":{"type":"integer"},"errors":{"type":"integer"}}},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":["string","null"]},"index":{"type":"integer"},"evaluation":{"oneOf":[{"$ref":"#/components/schemas/Evaluation"},{"type":"null"}]},"error":{"type":["string","null"]}}}}}},"EvaluationSummary":{"type":"object","properties":{"id":{"type":"string"},"verdict":{"$ref":"#/components/schemas/Verdict"},"aggregate_score":{"type":["number","null"]},"confidence":{"type":["number","null"]},"latency_ms":{"type":["integer","null"]},"rule_set":{"type":"string"},"metadata":{"type":["object","null"]},"created_at":{"type":"string","format":"date-time"}}},"EvaluationDetail":{"allOf":[{"$ref":"#/components/schemas/EvaluationSummary"},{"type":"object","properties":{"input":{"type":"string"},"input_token_count":{"type":["integer","null"]},"results":{"type":"array","items":{"$ref":"#/components/schemas/RuleResult"}}}}]},"Rule":{"type":"object","required":["name","question_type","question_config","fail_condition"],"properties":{"id":{"type":"string","format":"uuid","readOnly":true},"name":{"type":"string","maxLength":100},"description":{"type":["string","null"]},"question_type":{"$ref":"#/components/schemas/QuestionType"},"question_config":{"oneOf":[{"type":"object","title":"choice","required":["options","instructions"],"properties":{"options":{"type":"array","items":{"type":"string"},"minItems":2,"maxItems":255},"instructions":{"type":"string"}}},{"type":"object","title":"score","required":["levels","instructions"],"properties":{"levels":{"type":"array","items":{"type":"string"},"minItems":2,"maxItems":10,"description":"Ordered from lowest to highest"},"instructions":{"type":"string"}}},{"type":"object","title":"noul","required":["question"],"properties":{"question":{"type":"string","description":"A yes/no question"}}}]},"fail_condition":{"oneOf":[{"type":"object","title":"choice","required":["failOn"],"properties":{"failOn":{"type":"array","items":{"type":"string"},"description":"Options that fail"}}},{"type":"object","title":"noul","required":["failOn"],"properties":{"failOn":{"type":"boolean"}}},{"type":"object","title":"score","required":["failAbove"],"properties":{"failAbove":{"type":"number","description":"Fail when the score is at or above this level index"}}}]},"review_condition":{"type":["object","null"],"properties":{"confidenceBelow":{"type":"number","exclusiveMinimum":0,"maximum":1}}},"weight":{"type":"number","exclusiveMinimum":0,"maximum":100,"default":1},"sort_order":{"type":"integer","readOnly":true},"is_active":{"type":"boolean","readOnly":true}}},"RuleSet":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":["string","null"]},"is_system_prebuilt":{"type":"boolean"},"is_active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/Rule"}}}},"RuleSetCreate":{"type":"object","required":["name","slug","rules"],"properties":{"name":{"type":"string","maxLength":100},"slug":{"type":"string","pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$","maxLength":100},"description":{"type":["string","null"]},"rules":{"type":"array","minItems":1,"maxItems":25,"items":{"$ref":"#/components/schemas/Rule"}}}},"RuleSetUpdate":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":["string","null"]},"is_active":{"type":"boolean"},"rules":{"type":"array","minItems":1,"maxItems":25,"items":{"$ref":"#/components/schemas/Rule"}}}},"Usage":{"type":"object","properties":{"org":{"type":"string"},"plan":{"type":"string"},"daily_limit":{"type":"integer"},"today":{"type":"object","properties":{"date":{"type":"string"},"eval_count":{"type":"integer"},"remaining":{"type":"integer"}}},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"eval_count":{"type":"integer"},"pass_count":{"type":"integer"},"fail_count":{"type":"integer"},"review_count":{"type":"integer"},"avg_latency_ms":{"type":["number","null"]},"total_input_tokens":{"type":"integer"}}}}}},"Me":{"type":"object","properties":{"org_id":{"type":"string"},"org":{"type":"string"},"plan":{"type":"string"},"daily_limit":{"type":"integer"},"webhook_configured":{"type":"boolean"},"docs":{"type":"object"}}},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"key_prefix":{"type":"string"},"is_active":{"type":"boolean"},"last_used_at":{"type":["string","null"]},"created_at":{"type":"string"}}},"IssuedApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"key":{"type":"string","description":"Full key. Shown once."},"key_prefix":{"type":"string"},"created_at":{"type":"string"},"notice":{"type":"string"}}},"Webhook":{"type":"object","properties":{"url":{"type":["string","null"]},"configured":{"type":"boolean"},"secret_prefix":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"delivers_on":{"type":"array","items":{"type":"string"}}}},"WebhookSecret":{"type":"object","properties":{"url":{"type":"string"},"secret":{"type":"string","description":"HMAC-SHA256 signing secret. Shown once."},"signature_header":{"type":"string"},"signature_format":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"delivers_on":{"type":"array","items":{"type":"string"}}}},"AuditEvent":{"type":"object","properties":{"id":{"type":"string"},"event":{"type":"string","example":"api_key.created"},"actor":{"type":"string","description":"key:<prefix>, user:<id>, stripe, or system"},"ip":{"type":["string","null"]},"details":{"type":["object","null"]},"created_at":{"type":"string","format":"date-time"}}},"PlanCatalog":{"type":"object","properties":{"currency":{"type":"string"},"billing_enabled":{"type":"boolean"},"plans":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"price_monthly_usd":{"type":"number"},"daily_eval_limit":{"type":"integer"},"per_minute_limit":{"type":"integer"},"description":{"type":"string"},"purchasable":{"type":"boolean"}}}},"how_to_upgrade":{"type":"object"}}},"BillingStatus":{"type":"object","properties":{"plan":{"type":"string"},"plan_name":{"type":"string"},"price_monthly_usd":{"type":"number"},"daily_limit":{"type":"integer"},"subscription_status":{"type":"string","enum":["none","trialing","active","past_due","canceled","incomplete","unpaid"]},"current_period_end":{"type":["string","null"],"format":"date-time"},"has_payment_customer":{"type":"boolean"},"billing_enabled":{"type":"boolean"}}},"SubscribeResponse":{"type":"object","properties":{"plan":{"type":"string"},"daily_limit":{"type":"integer"},"subscription_status":{"type":"string"},"current_period_end":{"type":["string","null"]},"requires_action":{"type":"boolean"},"payment_url":{"type":["string","null"]},"notice":{"type":"string"}}},"SignupResponse":{"type":"object","properties":{"org_id":{"type":"string"},"org":{"type":"string"},"plan":{"type":"string"},"daily_limit":{"type":"integer"},"api_key":{"type":"string"},"key_prefix":{"type":"string"},"notice":{"type":"string"},"next_steps":{"type":"object"}}}}}}