{
  "openapi": "3.0.3",
  "info": {
    "title": "KWIKmotion AI Live Captions API",
    "description": "Real-time speech-to-text transcription and multi-language translation via WebSocket API. Perfect for live streaming and broadcast applications.\n\n**Note:** This is a WebSocket API. The endpoints shown here are for reference documentation purposes. Actual implementation uses WebSocket protocol at `wss://livecc01.kwikmotion.com`",
    "version": "1.1.0",
    "contact": {
      "name": "White Peaks Solutions SAS",
      "email": "support@whitepeaks.fr",
      "url": "https://www.whitepeaks.fr"
    }
  },
  "servers": [
    {
      "url": "wss://livecc01.kwikmotion.com",
      "description": "WebSocket Server for Live Captions"
    }
  ],
  "tags": [
    {
      "name": "Connection",
      "description": "WebSocket connection management and session control"
    },
    {
      "name": "Transcription",
      "description": "Real-time speech-to-text transcription"
    },
    {
      "name": "Translation",
      "description": "Multi-language translation of transcripts"
    },
    {
      "name": "Audio",
      "description": "Audio data transmission and format specifications"
    }
  ],
  "paths": {
    "/websocket": {
      "post": {
        "tags": [
          "Connection"
        ],
        "summary": "WebSocket Connection",
        "description": "Establish WebSocket connection for real-time transcription and translation.",
        "responses": {
          "101": {
            "description": "Switching Protocols - WebSocket connection established"
          }
        }
      }
    },
    "/message/StartRecognition": {
      "post": {
        "tags": [
          "Connection",
          "Transcription"
        ],
        "summary": "StartRecognition - Initialize Session",
        "description": "Initialize a new transcription session. Send this message immediately after WebSocket connection.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartRecognition"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Recognition started"
          }
        }
      }
    },
    "/message/AudioData": {
      "post": {
        "tags": [
          "Audio"
        ],
        "summary": "Send Audio Data (Binary)",
        "description": "Send binary audio chunks. Format: PCM 16kHz mono 16-bit. Recommended: 6-second chunks (192,000 bytes).",
        "requestBody": {
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Audio received"
          }
        }
      }
    },
    "/message/EndOfStream": {
      "post": {
        "tags": [
          "Connection"
        ],
        "summary": "EndOfStream - Signal Completion",
        "description": "Signal end of audio stream when finished sending all chunks.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EndOfStream"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "End acknowledged"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "StartRecognition": {
        "type": "object",
        "required": [
          "message",
          "audio_format",
          "transcription_config"
        ],
        "properties": {
          "message": {
            "type": "string",
            "enum": [
              "StartRecognition"
            ]
          },
          "audio_format": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "raw",
                  "file"
                ]
              },
              "encoding": {
                "type": "string",
                "enum": [
                  "pcm_s16le",
                  "pcm_f32le",
                  "mulaw"
                ]
              },
              "sample_rate": {
                "type": "integer",
                "example": 16000
              }
            }
          },
          "transcription_config": {
            "type": "object",
            "properties": {
              "language": {
                "type": "string",
                "example": "en"
              }
            }
          },
          "translation_config": {
            "type": "object",
            "properties": {
              "target_languages": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "example": [
                  "fr",
                  "es"
                ]
              }
            }
          }
        }
      },
      "EndOfStream": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "enum": [
              "EndOfStream"
            ]
          },
          "last_seq_no": {
            "type": "integer",
            "example": 10
          }
        }
      },
      "RecognitionStarted": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "enum": [
              "RecognitionStarted"
            ]
          },
          "session_id": {
            "type": "string",
            "example": "session_1761130389621"
          }
        }
      },
      "AddTranscript": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "enum": [
              "AddTranscript"
            ]
          },
          "metadata": {
            "type": "object",
            "properties": {
              "transcript": {
                "type": "string"
              },
              "start_time": {
                "type": "number"
              },
              "end_time": {
                "type": "number"
              },
              "language": {
                "type": "string"
              },
              "chunk_index": {
                "type": "integer"
              },
              "word_count": {
                "type": "integer"
              }
            }
          }
        }
      },
      "AddTranslation": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "enum": [
              "AddTranslation"
            ]
          },
          "metadata": {
            "type": "object",
            "properties": {
              "translation": {
                "type": "string"
              },
              "target_language": {
                "type": "string"
              },
              "start_time": {
                "type": "number"
              },
              "end_time": {
                "type": "number"
              }
            }
          }
        }
      }
    }
  }
}