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

# Voice decide (streaming)

> **Preview.** Judge one voice-agent turn as Server-Sent Events. The transcript is scanned by the same injection + PII rails that judge text; the audio is judged directly by transcript-independent acoustic detectors, and the two fuse most-restrictive-wins. Events arrive in a locked order: `request_accepted` → `transcript_ready` → optional `pii_findings` → optional `safety_findings` → `verdict` → optional `acoustic_findings` → optional `verdict_revised` → `done`. Act at the `verdict` event for blocking decisions; an acoustic finding may revise it via `verdict_revised`.



## OpenAPI

````yaml /api-reference/openapi.json post /voice/decide/stream
openapi: 3.1.0
info:
  title: Judge API
  description: >-
    Compliance verdicts for agent tool calls. Agent messages and tool calls in →
    verdict, severity, and evidence out. The canonical decide endpoint is `POST
    /decide`. PII is detected on every request and redacted out of any text sent
    to a downstream LLM; detected values are not returned.
  version: 0.2.0
  contact:
    name: Tenet Labs
    url: https://tenetlabs.com
servers:
  - url: https://judge.tenetlabs.com
    description: Production
security:
  - bearerAuth: []
paths:
  /voice/decide/stream:
    post:
      tags:
        - Voice
      summary: Voice decide (streaming)
      description: >-
        **Preview.** Judge one voice-agent turn as Server-Sent Events. The
        transcript is scanned by the same injection + PII rails that judge text;
        the audio is judged directly by transcript-independent acoustic
        detectors, and the two fuse most-restrictive-wins. Events arrive in a
        locked order: `request_accepted` → `transcript_ready` → optional
        `pii_findings` → optional `safety_findings` → `verdict` → optional
        `acoustic_findings` → optional `verdict_revised` → `done`. Act at the
        `verdict` event for blocking decisions; an acoustic finding may revise
        it via `verdict_revised`.
      operationId: voiceDecideStream
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VoiceDecideRequest'
      responses:
        '200':
          description: >-
            SSE stream (`text/event-stream`). Each frame: `event: <type>`, `id:
            <event_id>`, `data: <json>`.
          content:
            text/event-stream:
              schema:
                type: string
                description: >-
                  SSE frames. Event types: request_accepted, transcript_ready,
                  pii_findings, safety_findings, verdict, acoustic_findings,
                  verdict_revised, error, done.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  schemas:
    VoiceDecideRequest:
      type: object
      description: >-
        One voice-agent turn to judge. Provide the turn's text via the
        `transcript` shorthand, or a full `voice_context` when you also carry
        audio signal. When both are present, `voice_context` wins.
      properties:
        transcript:
          type: string
          description: >-
            Shorthand for `voice_context.transcript` — the text the injection +
            PII rails scan. Ignored when `voice_context` is also present.
          example: sure, i can share the applicant list — what did you need?
        voice_context:
          type: object
          description: Full turn envelope. Wins over `transcript` when both are sent.
          properties:
            transcript:
              type: string
              description: >-
                The turn text scanned by the injection + PII rails. When empty
                and only `audio_ref` is present, an STT front-end may transcribe
                it first.
            asr_confidence:
              type:
                - number
                - 'null'
              description: >-
                ASR confidence in `[0.0, 1.0]` (higher = more confident). `null`
                = unknown. Governs the ASR-confidence downgrade: an enforcing
                transcript block on an untrustworthy transcript downgrades to
                `route_to_human` rather than hard-blocking.
              example: 0.9
            audio_ref:
              type:
                - string
                - 'null'
              description: >-
                Reference to the raw audio artifact (an `s3://` URI or a media
                id). Carried through, never inlined as bytes.
              example: s3://calls/8841.wav
            audio_events:
              type: array
              items:
                type: string
              description: >-
                Bare provider event-tag strings (e.g. `scream`, `(laughter)`).
                Transcript-independent; a tag is trusted as fired. Consumed by
                the acoustic event gate.
              example:
                - scream
            acoustic_events:
              type: array
              description: >-
                Structured, scored acoustic events — the transcript-independent
                signal the acoustic gate consumes.
              items:
                $ref: '#/components/schemas/AcousticEvent'
        span_id:
          type: string
          description: >-
            Caller-correlatable id for this turn. Defaults to a fresh canonical
            id.
          example: span-8841
        trace_id:
          type: string
          description: Groups spans in one call/trace. Defaults to `span_id`.
          example: call-8841
        session_id:
          type: string
          description: Stable per conversation.
          example: call-8841
        category_hint:
          type: string
          description: Optional caller hint.
    AcousticEvent:
      type: object
      description: >-
        One detected acoustic event on a voice turn — transcript-independent
        signal (ASR never sees it). Emitted by your STT/audio provider or an
        acoustic detector.
      properties:
        label:
          type: string
          description: >-
            Event class, e.g. `scream`, `gunshot`, `alarm`, `glass_break`,
            `crying`. Normalized before lookup, so provider tags like `(scream)`
            / `Gun_Shot` match.
          example: scream
        score:
          type:
            - number
            - 'null'
          description: >-
            `[0,1]` confidence when the provider gives one. A scoreless event is
            trusted as fired; a scored event must clear the gate threshold.
          example: 0.94
        start_s:
          type:
            - number
            - 'null'
          description: Event start offset in seconds.
        end_s:
          type:
            - number
            - 'null'
          description: Event end offset in seconds.
      required:
        - label
    Error:
      type: object
      description: Error envelope. Branch on `code`; `message` is for humans.
      properties:
        code:
          type: string
          description: >-
            Stable, programmatic error code — `BAD_REQUEST`, `UNAUTHENTICATED`,
            `VALIDATION_ERROR`, `RATE_LIMITED`, `QUOTA_EXCEEDED`,
            `SERVICE_UNAVAILABLE`, `batch_api_retired`, …
          example: VALIDATION_ERROR
        message:
          type: string
          description: >-
            Human-readable description. For a validation error it names the
            offending field.
        docs_url:
          type: string
          description: >-
            Link to this code's entry in the
            [Errors](/api-reference/introduction#errors) table.
        request_id:
          type: string
          description: >-
            Echoes the `X-Tenet-Request-Id` response header. Include it when
            reporting a problem.
          example: req_0123456789abcdef0123456789abcdef
        retry_after:
          type: integer
          description: Seconds to wait before retrying. Present only when applicable.
  responses:
    Unauthorized:
      description: >-
        Missing or invalid bearer token. `code` is `UNAUTHENTICATED`. Some `401`
        responses carry no error envelope, so branch on the status code.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unavailable:
      description: Service temporarily unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A self-serve API key (sk_tenet_…, from platform.tenetlabs.com; accepted
        on /decide and /decide/stream) or an M2M token (audience
        https://sdk.tenetlabs.com; accepted everywhere). See /authentication.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.