> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omnia-voice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Gate a deploy on an eval run

> One curl in CI: 200 when every requested check passes, 412 otherwise — `curl -f` does the rest.

Statistical thresholds gate on **confidence-interval lower bounds**, never point estimates: a 62% win rate whose interval reaches down to 51% does not clear a 55% bar. Assertion rates are deterministic and gate exactly. A run that isn't DONE fails closed — poll until you get a verdict.

```bash
curl -f "$BASE/v1/evals/$RUN/gate?min_assertion_pass_rate=1&min_win_rate=0.5" \
  -H "Authorization: Bearer $OMNIA_API_KEY" || exit 1
```



## OpenAPI

````yaml /openapi.json get /v1/evals/{id}/gate
openapi: 3.1.0
info:
  title: Omnia Management API
  description: >-
    The management API behind the improvement loop: capture and setup, request
    logs and datasets, grades (labels), judges (criteria), evals and deploy
    gates, fine-tuning and reinforcement learning, dedicated GPU endpoints, and
    model aliases and versions. Authenticated with a workspace API key
    (sk_sovereign_...). The inference API (chat, embeddings, rerank, responses)
    is OpenAI-compatible and documented separately.


    Responses are snake_case, list endpoints on the loop products use the
    {"object": "list", "data": [...]} envelope, and refusals use the same nested
    error shape the gateway emits: {"error": {"message", "type", "code"}}.
    Request bodies on the loop products (logs, labels, criteria, evals,
    datasets, aliases) are snake_case; the training and infrastructure products
    (fine-tuning, GRPO, environment tools, dedicated, model-version adoption)
    validate camelCase bodies, and each schema below says which it is. Endpoints
    that spend money require a key minted by a workspace owner or admin and
    return 403 otherwise.
  version: 1.0.0
servers:
  - url: https://gateway.omnia-voice.com
    description: Production
  - url: https://platform.omnia-voice.com/api
    description: Production (legacy alias — same API, older base URL)
security:
  - bearerAuth: []
paths:
  /v1/evals/{id}/gate:
    get:
      tags:
        - Evals
      summary: Gate a deploy on an eval run
      description: >-
        One curl in CI: 200 when every requested check passes, 412 otherwise —
        `curl -f` does the rest.


        Statistical thresholds gate on **confidence-interval lower bounds**,
        never point estimates: a 62% win rate whose interval reaches down to 51%
        does not clear a 55% bar. Assertion rates are deterministic and gate
        exactly. A run that isn't DONE fails closed — poll until you get a
        verdict.


        ```bash

        curl -f
        "$BASE/v1/evals/$RUN/gate?min_assertion_pass_rate=1&min_win_rate=0.5" \
          -H "Authorization: Bearer $OMNIA_API_KEY" || exit 1
        ```
      operationId: gateEvalRun
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: min_win_rate
          in: query
          schema:
            type: number
            minimum: 0
            maximum: 1
          description: >-
            Comparison runs: every candidate's win-rate CI lower bound must
            clear this.
        - name: min_pass_rate
          in: query
          schema:
            type: number
            minimum: 0
            maximum: 1
          description: >-
            Criterion runs: every model's corrected pass-rate CI lower bound
            must clear this (falls back to the observed interval when the judge
            was never aligned — the check notes it).
        - name: min_assertion_pass_rate
          in: query
          schema:
            type: number
            minimum: 0
            maximum: 1
          description: Every model's all-assertions pass rate (exact) must clear this.
        - name: model
          in: query
          schema:
            type: string
          description: Restrict the checks to one model.
        - name: noninferiority_margin
          in: query
          required: false
          schema:
            type: number
            minimum: 0
            maximum: 1
          description: >-
            The certified switch test: on a criterion run whose baseline was the
            incumbent's stored production answers, each candidate's corrected
            pass-rate CI lower bound must reach the incumbent arm's corrected
            rate minus this margin (0.05 = provably within 5 points at worst).
            Requires corrected rates on both arms, which only a calibrated judge
            produces; there is no observed-rate fallback, so an uncalibrated
            judge cannot certify a switch.
      responses:
        '200':
          description: Every requested check passed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GateVerdict'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '412':
          description: >-
            At least one check failed (or the run isn't DONE / no thresholds
            were given). The body lists every check with the number it gated on.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GateVerdict'
components:
  schemas:
    GateVerdict:
      type: object
      properties:
        pass:
          type: boolean
        status:
          type: string
          description: The run's status at evaluation time.
        reason:
          type:
            - string
            - 'null'
          description: >-
            Set when the gate could not evaluate (run not DONE, no thresholds
            given).
        checks:
          type: array
          items:
            type: object
            properties:
              check:
                type: string
                enum:
                  - win_rate
                  - pass_rate
                  - assertion_pass_rate
              model:
                type: string
              required:
                type: number
              actual:
                type:
                  - number
                  - 'null'
                description: >-
                  The CI lower bound (statistical checks) or exact rate
                  (assertions) the gate compared.
              pass:
                type: boolean
              note:
                type:
                  - string
                  - 'null'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
              description: >-
                invalid_request_error, insufficient_quota, rate_limit_error, or
                api_error.
            code:
              type: string
              description: >-
                Machine-stable cause, e.g. invalid_api_key, not_found,
                insufficient_permissions, precondition_failed.
          required:
            - message
            - type
            - code
      description: >-
        Every refusal — gateway and management API alike — uses this one
        envelope.
  responses:
    Unauthorized:
      description: Missing, malformed, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Invalid API key
              type: invalid_request_error
              code: invalid_api_key
    NotFound:
      description: The resource does not exist in your workspace.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your workspace API key, e.g. `sk_sovereign_...`, sent as `Authorization:
        Bearer <key>`.

````