{
  "openapi": "3.1.0",
  "info": {
    "title": "ВТекст 38 Speech-to-Text API",
    "version": "1.0.0",
    "summary": "Deepgram- and OpenAI-compatible Russian speech-to-text",
    "description": "ВТекст 38 is a Russian speech-to-text API for customers who need a Deepgram-compatible\n(and OpenAI Audio-compatible) surface that is lawful under 152-FZ, billed in roubles,\nand tuned for Russian. Servers stay on Russian soil.\n\nBase URL for Deepgram SDKs: `https://vtext38.ru/api`.\nBase URL for OpenAI SDKs: `https://vtext38.ru/api/v1` (the SDK appends `/audio/transcriptions`).\n\nHuman docs: `https://vtext38.ru/api`. Agent index: `https://vtext38.ru/llms.txt`."
  },
  "servers": [
    {
      "url": "https://vtext38.ru/api",
      "description": "Production API root (Deepgram SDK `url` / `baseUrl`)"
    }
  ],
  "tags": [
    {
      "name": "deepgram",
      "description": "Deepgram-compatible dialect"
    },
    {
      "name": "openai",
      "description": "OpenAI Audio-compatible dialect"
    }
  ],
  "paths": {
    "/v1/listen": {
      "post": {
        "tags": [
          "deepgram"
        ],
        "operationId": "deepgramListen",
        "summary": "Transcribe audio (Deepgram dialect)",
        "description": "Accepts raw audio in the body. Authorization must use the Token scheme, not Bearer. Any `model` value is accepted and ignored. Russian only.",
        "security": [
          {
            "deepgramToken": []
          }
        ],
        "parameters": [
          {
            "name": "punctuate",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Punctuation and capitalisation."
          },
          {
            "name": "smart_format",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Readable formatting. Numbers stay spelled out; ITN is not enabled."
          },
          {
            "name": "diarize",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Speaker separation for mono recordings."
          },
          {
            "name": "multichannel",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Per-channel separation for stereo. Takes precedence over diarize when both are set."
          },
          {
            "name": "utterances",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Split into utterances by pauses and speaker change."
          },
          {
            "name": "paragraphs",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "description": "Further split into sentences/paragraphs."
          },
          {
            "name": "language",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "ru"
              ]
            },
            "description": "Russian only. Other values return a clear 400."
          },
          {
            "name": "model",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Accepted and ignored. Foreign names such as nova-3 are fine."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              },
              "description": "Raw audio bytes. Format is detected from content."
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deepgram-shaped JSON transcript",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeepgramResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request (unsupported body form, language, options)"
          },
          "401": {
            "description": "Missing, malformed, unknown or revoked key"
          },
          "403": {
            "description": "Account suspended"
          },
          "413": {
            "description": "Body or audio over the limit"
          },
          "429": {
            "description": "Rate limited; may include Retry-After"
          },
          "502": {
            "description": "Engine failure"
          },
          "504": {
            "description": "Processing exceeded ten minutes (Deepgram-shaped error body)"
          }
        }
      }
    },
    "/v1/audio/transcriptions": {
      "post": {
        "tags": [
          "openai"
        ],
        "operationId": "openaiTranscriptions",
        "summary": "Transcribe audio (OpenAI Audio dialect)",
        "description": "multipart/form-data. Prefer Authorization: Bearer; Token is also accepted. Any `model` value is accepted and ignored. Russian only.",
        "security": [
          {
            "openaiBearer": []
          },
          {
            "deepgramToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "Audio file. Format judged by content, not filename."
                  },
                  "model": {
                    "type": "string",
                    "description": "Accepted and ignored. whisper-1 is fine."
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "ru"
                    ],
                    "description": "Russian only."
                  },
                  "response_format": {
                    "type": "string",
                    "enum": [
                      "json",
                      "verbose_json",
                      "text"
                    ],
                    "description": "Unknown values fall back to json."
                  },
                  "diarize": {
                    "type": "string",
                    "description": "Product extension: true enables speaker separation. Not an OpenAI field."
                  },
                  "prompt": {
                    "type": "string",
                    "description": "Ignored; documented rather than rejected."
                  },
                  "temperature": {
                    "type": "string",
                    "description": "Ignored; documented rather than rejected."
                  },
                  "timestamp_granularities": {
                    "type": "string",
                    "description": "Ignored; documented rather than rejected."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OpenAI-shaped transcript (json, verbose_json, or text/plain)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAIJsonResponse"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Missing file, unreadable audio, unsupported language"
          },
          "401": {
            "description": "Missing, malformed, unknown or revoked key"
          },
          "403": {
            "description": "Account suspended"
          },
          "413": {
            "description": "Body or audio over the limit"
          },
          "429": {
            "description": "Rate limited; may include Retry-After"
          },
          "502": {
            "description": "Engine failure"
          },
          "504": {
            "description": "Processing exceeded ten minutes"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "deepgramToken": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Value must be `Token <api_key>` (not Bearer). Deepgram SDK default."
      },
      "openaiBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "OpenAI SDK default. Token scheme is also accepted on this route."
      }
    },
    "schemas": {
      "DeepgramResponse": {
        "type": "object",
        "required": [
          "metadata",
          "results"
        ],
        "properties": {
          "metadata": {
            "type": "object",
            "properties": {
              "request_id": {
                "type": "string"
              },
              "duration": {
                "type": "number"
              },
              "channels": {
                "type": "integer"
              },
              "models": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "model_info": {
                "type": "object"
              }
            }
          },
          "results": {
            "type": "object",
            "properties": {
              "channels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "alternatives": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "transcript": {
                            "type": "string"
                          },
                          "confidence": {
                            "type": "number"
                          },
                          "words": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "word": {
                                  "type": "string"
                                },
                                "start": {
                                  "type": "number"
                                },
                                "end": {
                                  "type": "number"
                                },
                                "confidence": {
                                  "type": "number"
                                },
                                "punctuated_word": {
                                  "type": "string"
                                },
                                "speaker": {
                                  "type": "integer"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              },
              "utterances": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          }
        },
        "description": "speaker_confidence is never present. Numbers stay spelled out even with smart_format."
      },
      "OpenAIJsonResponse": {
        "type": "object",
        "required": [
          "text"
        ],
        "properties": {
          "text": {
            "type": "string"
          },
          "task": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "duration": {
            "type": "number"
          },
          "segments": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      }
    }
  }
}
