{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tiro-ooo/json-schema/tiro-ooo-realtime-transcription-schema.json",
  "title": "RealtimeTranscription",
  "description": "A realtime transcription session. Results are delivered only over the WebSocket at `wsUrl`, not through this resource.\nSee [WebSocket protocol](/en/developers/realtime-transcription/protocol).\n",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tiro-ooo-openapi.yml#/components/schemas/RealtimeTranscription",
  "type": "object",
  "required": [
    "id",
    "workspaceGuid",
    "status",
    "wsUrl",
    "maxDurationMs",
    "audioDurationMs",
    "createdAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Session ID."
    },
    "workspaceGuid": {
      "type": "string",
      "description": "Workspace the session belongs to. Concurrent sessions are counted per workspace."
    },
    "apiKeyId": {
      "type": [
        "string",
        "null"
      ],
      "description": "Public ID of the API key that created the session, matching `apiKeyId` from `GET /v1/external/auth/me`. `null` only when Tiro can no longer find that key."
    },
    "status": {
      "type": "string",
      "enum": [
        "OPEN",
        "ENDED"
      ],
      "description": "- `OPEN`: Tiro accepts audio. You can connect and reconnect. The session holds a concurrent slot\n- `ENDED`: The session is over. You cannot reconnect\n\nNew values can appear. Treat an unknown value as not `ENDED`.\n"
    },
    "endReason": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "CLIENT_REQUESTED",
        "IDLE_TIMEOUT",
        "MAX_DURATION",
        "INTERNAL_ERROR"
      ],
      "description": "Why the session ended. `null` while `OPEN`.\n- `CLIENT_REQUESTED`: WebSocket `session.end` or End Realtime Transcription\n- `IDLE_TIMEOUT`: No audio for 15 minutes, or a slot reclaimed at workspace capacity after a 30-second disconnection grace period\n- `MAX_DURATION`: 3 hours since the first connection\n- `INTERNAL_ERROR`: Tiro could not continue the session\n\nNew values can appear. Treat an unknown value as a normal end.\n"
    },
    "wsUrl": {
      "type": "string",
      "description": "WebSocket URL to connect to. Use it as returned. Do not build or hard-code the host or path."
    },
    "streamToken": {
      "type": "string",
      "description": "Token for the WebSocket `Authorization: Bearer` header. Present only in the Create Realtime Transcription response.\nTreat the entire token as opaque and confidential. Its length varies with session options. Valid for this session while it is `OPEN`.\n"
    },
    "maxDurationMs": {
      "type": "integer",
      "format": "int64",
      "description": "Maximum session length, counted from the first connection. Currently 10,800,000 (3 hours)."
    },
    "audioDurationMs": {
      "type": "integer",
      "format": "int64",
      "description": "Audio length Tiro has received so far, including connections that already closed."
    },
    "transcriptionLocale": {
      "type": [
        "string",
        "null"
      ],
      "description": "Transcription locale applied to the session. `null` means auto detection."
    },
    "translationLocale": {
      "type": [
        "string",
        "null"
      ],
      "description": "One-way translation target. Null for both transcription-only and two-way sessions."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "description": "When the session was created."
    },
    "endedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the session ended. `null` while `OPEN`."
    }
  }
}