# Ogat Ogat is a review API for applying reusable, plain-language rules to product inputs such as form fields, prompts, messages, and URLs. It returns per-input checks and a top-level `approve`, `reject`, or `needs_review` decision. ## Canonical documentation - OpenAPI 3.1 (schemas / status codes): https://ogat.ai/openapi.yaml - Agent integration recipe: https://ogat.ai/for-agents.md - Human guide: https://ogat.ai/developers/docs - This map: https://ogat.ai/llms.txt Use OpenAPI for shapes. Use the agent guide for the shortest working integration. Do not infer API behavior from marketing copy. ## Public API - Base URL: https://api.ogat.ai/functions/v1 - Method: `POST` only; `Content-Type: application/json` - Auth: `Authorization: Bearer ogt_…` (app-scoped API key from the console) - Keep the key server-side; never commit it or expose it to a browser - Never send third-party LLM provider keys to Ogat - No official SDK yet; use HTTP Core operations: - `POST /review-submission` — default. Reviews a complete payload; omit `submissionId` to create and review in one call. Returns top-level `decision` and emits webhooks. - `POST /create-submission` — mint a draft submission (optional; no review). - `POST /review-input` — review one draft input (e.g. blur). No `decision`, no webhooks. - `POST /review-inputs` — review several draft inputs without finalizing (e.g. wizard step). No `decision`, no webhooks. Optional request fields: `context` (Only-when / conditional rules), `data` (`$placeholder` values), `externalId` (your reconciliation id). Prefer `inputs` as an object map of non-empty strings. ## Vocabulary and control flow - App: product using Ogat; API keys are scoped to one app - Policy: inputs, rules, and decision settings within an app - Submission: one set of values reviewed against a policy - Check: one rule evaluated against one input - Review: one processing pass Three distinct signals: 1. `checks[].result` / `inputs[].result` — did rule criteria match (`pass` / `fail`; input may be `skipped`) 2. `certainty` — confidence 0–100; independent of result 3. Top-level `decision` — product action (`approve` / `reject` / `needs_review`); only on `review-submission` and webhooks Branch product behavior on `decision`, not check `pass`. HTTP `200` means the review completed (including reject / needs_review). A `pass` with low certainty can correctly yield `needs_review`. ## Credits, errors, webhooks - New checks consume plan credits; unchanged cached results on the same submission do not. Finalizing when everything is already cached costs no extra credits. - Free plan includes 1,000 credits per month. - Non-2xx means the request failed. 429: inspect `code` (`rate_limited` or `credit_quota_exceeded`). 403: policy is not in this app. - Webhooks fire only after `review-submission`. Exact events: `review.completed`, `review.needs_review`. Verify `X-Ogat-Signature` (HMAC-SHA256 hex of the raw body). Retries are not guaranteed.