{"openapi":"3.1.0","info":{"title":"outputgate API","version":"1.0.0","description":"Headless tool API. Every call is metered and billed in credits. Prices are published at GET /gate/v1/tools."},"servers":[{"url":"https://api.counselordesk.app"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key"}}},"paths":{"/gate/v1/tools/check_product_copy":{"post":{"operationId":"outputgate_check_product_copy","summary":"Check a product draft against approved facts","description":"Checks an ecommerce or marketing draft against structured product facts supplied by the caller. Returns findings plus an explicit source boundary and evidence basis. It does not browse, retrieve specifications, or establish independent truth.","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Retry-safe key. Guarantees the call is billed at most once."},{"name":"X-Max-Credits","in":"header","required":false,"schema":{"type":"integer","minimum":1,"maximum":2147483647},"description":"Maximum credits approved for this call. Rejects a larger hold and caps the final charge."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"draft":{"type":"string","minLength":40,"maxLength":30000,"description":"The product description, email, or social draft to review."},"product_facts":{"type":"array","minItems":1,"maxItems":12,"description":"Approved product fields and values. These are the only ground truth used for claim verdicts.","items":{"type":"object","additionalProperties":false,"required":["field","value"],"properties":{"field":{"type":"string","minLength":1,"maxLength":80},"value":{"type":"string","minLength":1,"maxLength":200}}}},"deterministic_only":{"type":"boolean","default":false,"description":"Run pattern scans only. Claim verdicts require the model judge."}},"required":["draft","product_facts"],"additionalProperties":false}}}},"responses":{"200":{"description":"Tool output","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"tool":{"type":"string"},"output":{"type":"object","properties":{"text":{"type":"string","description":"check: two-sentence readiness summary. fix: the rewritten text."},"meta":{"type":"object"},"report":{"type":"object","description":"The machine-readable verdict. check: pass, status, scans, claims, structural tells, names. fix: scan_cleared, cleared, claim_review, residual findings."}},"required":["text","report"]},"billing":{"type":"object","properties":{"status":{"type":"string","enum":["settled","pending"]},"credits_charged":{"type":["integer","null"]},"credits_remaining":{"type":["integer","null"]}}}}}}}},"402":{"description":"Insufficient credits or approved spending limit exceeded. Inspect error.code."},"429":{"description":"Rate limited. Retry after the Retry-After header."}}}},"/gate/v1/tools/check_product_copy/quote":{"post":{"operationId":"outputgate_check_product_copy_quote","summary":"Quote a Check a product draft against approved facts call (free)","description":"Free pre-flight. Validates the input and returns the exact credit hold a real call would take at this account's price, without billing anything. An invalid input is still a 200: the body carries valid:false and the validation errors.","x-billing":"free","security":[{"bearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"draft":{"type":"string","minLength":40,"maxLength":30000,"description":"The product description, email, or social draft to review."},"product_facts":{"type":"array","minItems":1,"maxItems":12,"description":"Approved product fields and values. These are the only ground truth used for claim verdicts.","items":{"type":"object","additionalProperties":false,"required":["field","value"],"properties":{"field":{"type":"string","minLength":1,"maxLength":80},"value":{"type":"string","minLength":1,"maxLength":200}}}},"deterministic_only":{"type":"boolean","default":false,"description":"Run pattern scans only. Claim verdicts require the model judge."}},"required":["draft","product_facts"],"additionalProperties":false}}}},"responses":{"200":{"description":"Quote","content":{"application/json":{"schema":{"type":"object","properties":{"tool":{"type":"string"},"valid":{"type":"boolean"},"validation_errors":{"type":"array"},"estimated_credits":{"type":"integer"},"estimated_usd":{"type":"number"},"max_credits_held":{"type":"integer"},"max_credits_supported":{"type":"boolean"},"credit_balance":{"type":"integer"},"sufficient":{"type":"boolean"},"price_multiplier":{"type":"number"}}}}}}}}},"/gate/v1/tools/check_output":{"post":{"operationId":"outputgate_check_output","summary":"Check generated text before a human sees it","description":"Reviews generated text before a human sees it. Returns a review status plus banned vocabulary, structural tells, PII-shaped patterns, and claim comparisons against caller-supplied source_facts. A pattern-only check cannot approve claims. The compatibility label \"verified\" means supported by supplied facts only. It is not independent verification.","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Retry-safe key. Guarantees the call is billed at most once."},{"name":"X-Max-Credits","in":"header","required":false,"schema":{"type":"integer","minimum":1,"maximum":2147483647},"description":"Maximum credits approved for this call. Rejects a larger hold and caps the final charge."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":40,"maxLength":30000,"description":"The generated text to check."},"source_facts":{"type":"string","maxLength":4000,"description":"Facts supplied by the caller for comparison: figures, dates, names, and capabilities, one per line. The legacy \"verified\" label means supported by these supplied facts only, never independently researched or established as true. Omit facts and every claim is at best \"unverified\"."},"deterministic_only":{"type":"boolean","default":false,"description":"Skip the model judge; regex layers only. Cheaper, catches listed vocabulary, em-dashes, and PII patterns, but no claim verdicts."}},"required":["text"],"additionalProperties":false}}}},"responses":{"200":{"description":"Tool output","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"tool":{"type":"string"},"output":{"type":"object","properties":{"text":{"type":"string","description":"check: two-sentence readiness summary. fix: the rewritten text."},"meta":{"type":"object"},"report":{"type":"object","description":"The machine-readable verdict. check: pass, status, scans, claims, structural tells, names. fix: scan_cleared, cleared, claim_review, residual findings."}},"required":["text","report"]},"billing":{"type":"object","properties":{"status":{"type":"string","enum":["settled","pending"]},"credits_charged":{"type":["integer","null"]},"credits_remaining":{"type":["integer","null"]}}}}}}}},"402":{"description":"Insufficient credits or approved spending limit exceeded. Inspect error.code."},"429":{"description":"Rate limited. Retry after the Retry-After header."}}}},"/gate/v1/tools/check_output/quote":{"post":{"operationId":"outputgate_check_output_quote","summary":"Quote a Check generated text before a human sees it call (free)","description":"Free pre-flight. Validates the input and returns the exact credit hold a real call would take at this account's price, without billing anything. An invalid input is still a 200: the body carries valid:false and the validation errors.","x-billing":"free","security":[{"bearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":40,"maxLength":30000,"description":"The generated text to check."},"source_facts":{"type":"string","maxLength":4000,"description":"Facts supplied by the caller for comparison: figures, dates, names, and capabilities, one per line. The legacy \"verified\" label means supported by these supplied facts only, never independently researched or established as true. Omit facts and every claim is at best \"unverified\"."},"deterministic_only":{"type":"boolean","default":false,"description":"Skip the model judge; regex layers only. Cheaper, catches listed vocabulary, em-dashes, and PII patterns, but no claim verdicts."}},"required":["text"],"additionalProperties":false}}}},"responses":{"200":{"description":"Quote","content":{"application/json":{"schema":{"type":"object","properties":{"tool":{"type":"string"},"valid":{"type":"boolean"},"validation_errors":{"type":"array"},"estimated_credits":{"type":"integer"},"estimated_usd":{"type":"number"},"max_credits_held":{"type":"integer"},"max_credits_supported":{"type":"boolean"},"credit_balance":{"type":"integer"},"sufficient":{"type":"boolean"},"price_multiplier":{"type":"number"}}}}}}}}},"/gate/v1/tools/fix_output":{"post":{"operationId":"outputgate_fix_output","summary":"Rewrite text to clear the gate","description":"Rewrites text to address check_output findings, then re-scans deterministic patterns. Reports the pattern result separately and marks the rewrite for human review because claim review is not rerun.","security":[{"bearerAuth":[]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128},"description":"Retry-safe key. Guarantees the call is billed at most once."},{"name":"X-Max-Credits","in":"header","required":false,"schema":{"type":"integer","minimum":1,"maximum":2147483647},"description":"Maximum credits approved for this call. Rejects a larger hold and caps the final charge."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":40,"maxLength":30000,"description":"The text to rewrite."},"source_facts":{"type":"string","maxLength":4000,"description":"Facts supplied by the caller for comparison: figures, dates, names, and capabilities, one per line. The legacy \"verified\" label means supported by these supplied facts only, never independently researched or established as true. Omit facts and every claim is at best \"unverified\"."},"instructions":{"type":"string","maxLength":1000,"description":"Optional extra constraints for the rewrite (tone, length, things to keep verbatim)."}},"required":["text"],"additionalProperties":false}}}},"responses":{"200":{"description":"Tool output","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"tool":{"type":"string"},"output":{"type":"object","properties":{"text":{"type":"string","description":"check: two-sentence readiness summary. fix: the rewritten text."},"meta":{"type":"object"},"report":{"type":"object","description":"The machine-readable verdict. check: pass, status, scans, claims, structural tells, names. fix: scan_cleared, cleared, claim_review, residual findings."}},"required":["text","report"]},"billing":{"type":"object","properties":{"status":{"type":"string","enum":["settled","pending"]},"credits_charged":{"type":["integer","null"]},"credits_remaining":{"type":["integer","null"]}}}}}}}},"402":{"description":"Insufficient credits or approved spending limit exceeded. Inspect error.code."},"429":{"description":"Rate limited. Retry after the Retry-After header."}}}},"/gate/v1/tools/fix_output/quote":{"post":{"operationId":"outputgate_fix_output_quote","summary":"Quote a Rewrite text to clear the gate call (free)","description":"Free pre-flight. Validates the input and returns the exact credit hold a real call would take at this account's price, without billing anything. An invalid input is still a 200: the body carries valid:false and the validation errors.","x-billing":"free","security":[{"bearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":40,"maxLength":30000,"description":"The text to rewrite."},"source_facts":{"type":"string","maxLength":4000,"description":"Facts supplied by the caller for comparison: figures, dates, names, and capabilities, one per line. The legacy \"verified\" label means supported by these supplied facts only, never independently researched or established as true. Omit facts and every claim is at best \"unverified\"."},"instructions":{"type":"string","maxLength":1000,"description":"Optional extra constraints for the rewrite (tone, length, things to keep verbatim)."}},"required":["text"],"additionalProperties":false}}}},"responses":{"200":{"description":"Quote","content":{"application/json":{"schema":{"type":"object","properties":{"tool":{"type":"string"},"valid":{"type":"boolean"},"validation_errors":{"type":"array"},"estimated_credits":{"type":"integer"},"estimated_usd":{"type":"number"},"max_credits_held":{"type":"integer"},"max_credits_supported":{"type":"boolean"},"credit_balance":{"type":"integer"},"sufficient":{"type":"boolean"},"price_multiplier":{"type":"number"}}}}}}}}}}}