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

# Transcribe audio into text

> OpenAI-compatible speech-to-text endpoint. An official OpenAI SDK
pointed at the gateway calls it unchanged
(`client.audio.transcriptions.create(...)`): set the SDK base URL to
`https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1` and pass a
user access token as the API key. This is the endpoint behind chat
dictation.

The audio is sent as a multipart `file` part. It is processed in
memory and never stored: it is not written to storage, to the
activity feed, or to logs.

**Model resolution.** When `model` is omitted, the gateway uses the
organization's default transcription model, then the platform default
transcription model. A model not declared on any provider is answered
with `400`.

**Response formats.** `json` (default) and `verbose_json` return JSON,
`text` returns `text/plain`. `srt` and `vtt` are refused with
`400 UNSUPPORTED_RESPONSE_FORMAT`.

**Permission.** Requires `llm-gateway:models:audio-transcriptions`,
granted by default to the system Member role.

**Governance.** The organization's allowed models apply: a model
outside the allowlist is refused with `403 MODEL_NOT_ALLOWED`, or,
under a `soft_downgrade` quota policy, replaced by the default
transcription model.

**Analytics.** Each successful call emits an
`analytics.llm.transcription` event, so usage appears in analytics.




## OpenAPI

````yaml /api-reference/llm-gateway/swagger.yml post /v1/audio/transcriptions
openapi: 3.0.3
info:
  version: 1.0.0
  title: LLM Gateway API
  description: |
    Public REST API for the Prisme.ai LLM Gateway - OpenAI-compatible
    chat completions and embeddings, plus a managed model catalogue
    with governance overrides per organization.

    The gateway abstracts multi-provider LLM access (OpenAI, Azure OpenAI,
    Anthropic, Google Vertex, AWS Bedrock, OpenAI-compatible providers) behind
    an OpenAI-compatible request/response shape. It enforces per-tenant
    governance (allowed models, default models, quotas) and emits analytics
    events (`analytics.llm.completion`) usable for cost and carbon reporting.

    This spec documents only the public REST surface (endpoints exposed via
    Prisme.ai workspace webhooks). Internal helpers (private automations
    prefixed with `_`) and load-test mocks are not part of the public contract.
  contact:
    name: Prisme.ai
    url: https://prisme.ai
servers:
  - url: https://{host}/v2/workspaces/slug:llm-gateway/webhooks
    description: Prisme.ai workspace webhooks
    variables:
      host:
        default: api.studio.prisme.ai
        description: API host (override for self-hosted or sandbox)
security:
  - BearerAuth: []
  - OrgApiKeyAuth: []
tags:
  - name: Completions
    description: OpenAI-compatible chat completions (with optional SSE streaming).
  - name: Embeddings
    description: OpenAI-compatible text embeddings.
  - name: Rerank
    description: >-
      Rerank documents by relevance to a query (standard rerank contract,
      LLM-as-reranker backend).
  - name: Audio
    description: OpenAI-compatible speech-to-text (audio transcriptions).
  - name: Models
    description: Model catalogue (CRUD + bulk replace + governance-aware listing).
  - name: Defaults
    description: >-
      Resolved default models for completions / embeddings / image generation /
      transcription / file parsing.
  - name: Test
    description: Smoke-test reachability of a model through the gateway.
paths:
  /v1/audio/transcriptions:
    post:
      tags:
        - Audio
      summary: Transcribe audio into text
      description: |
        OpenAI-compatible speech-to-text endpoint. An official OpenAI SDK
        pointed at the gateway calls it unchanged
        (`client.audio.transcriptions.create(...)`): set the SDK base URL to
        `https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1` and pass a
        user access token as the API key. This is the endpoint behind chat
        dictation.

        The audio is sent as a multipart `file` part. It is processed in
        memory and never stored: it is not written to storage, to the
        activity feed, or to logs.

        **Model resolution.** When `model` is omitted, the gateway uses the
        organization's default transcription model, then the platform default
        transcription model. A model not declared on any provider is answered
        with `400`.

        **Response formats.** `json` (default) and `verbose_json` return JSON,
        `text` returns `text/plain`. `srt` and `vtt` are refused with
        `400 UNSUPPORTED_RESPONSE_FORMAT`.

        **Permission.** Requires `llm-gateway:models:audio-transcriptions`,
        granted by default to the system Member role.

        **Governance.** The organization's allowed models apply: a model
        outside the allowlist is refused with `403 MODEL_NOT_ALLOWED`, or,
        under a `soft_downgrade` quota policy, replaced by the default
        transcription model.

        **Analytics.** Each successful call emits an
        `analytics.llm.transcription` event, so usage appears in analytics.
      operationId: createTranscription
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: >
                    Audio file to transcribe, 25 MB maximum by default.
                    Supported

                    formats: `flac`, `m4a`, `mp3`, `mp4`, `mpeg`, `mpga`, `oga`,

                    `ogg`, `wav`, `webm`.
                model:
                  type: string
                  maxLength: 256
                  description: |
                    Transcription model id, for example `gpt-4o-transcribe`.
                    Defaults to the organization's default transcription
                    model, then to the platform default.
                language:
                  type: string
                  description: |
                    ISO-639-1 language of the audio, for example `fr`. Improves
                    accuracy on short recordings. Detected by the model when
                    omitted.
                prompt:
                  type: string
                  description: >-
                    Text that guides the transcription, such as expected
                    vocabulary or the previous segment.
                temperature:
                  type: number
                  description: Sampling temperature, passed to the provider.
                response_format:
                  type: string
                  enum:
                    - json
                    - text
                    - verbose_json
                  default: json
                  description: '`srt` and `vtt` are not supported.'
      responses:
        '200':
          description: |
            Transcribed text. `application/json` for `json` and
            `verbose_json`, `text/plain` for `text`.
          content:
            application/json:
              schema:
                type: object
                required:
                  - text
                properties:
                  text:
                    type: string
                    description: Transcribed text.
                  usage:
                    type: object
                    description: Provider usage, when the provider reports it.
                    additionalProperties: true
            text/plain:
              schema:
                type: string
        '400':
          description: |
            Invalid request: no `file` part (`FILE_REQUIRED`), `srt` or `vtt`
            requested (`UNSUPPORTED_RESPONSE_FORMAT`), no transcription model
            configured for the organization or the platform
            (`NO_TRANSCRIPTION_MODEL`), or a `model` declared on no provider.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid authentication.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: |
            Missing `llm-gateway:models:audio-transcriptions` permission, or
            model not allowed for this caller by the organization's governance
            (`MODEL_NOT_ALLOWED`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: >-
            Audio file larger than the size limit, 25 MB by default
            (`FILE_TOO_LARGE`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '502':
          description: The transcription provider returned an error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      x-codeSamples:
        - lang: bash
          label: curl
          source: >
            curl
            https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1/audio/transcriptions
            \
              -H "Authorization: Bearer $PRISME_TOKEN" \
              -F file=@meeting-notes.m4a \
              -F language=fr
        - lang: python
          label: Python (OpenAI SDK)
          source: |
            from openai import OpenAI

            client = OpenAI(
                base_url="https://{host}/v2/workspaces/slug:llm-gateway/webhooks/v1",
                api_key="<your user access token>",
            )

            with open("meeting-notes.m4a", "rb") as audio:
                transcript = client.audio.transcriptions.create(
                    model="gpt-4o-transcribe",
                    file=audio,
                    language="fr",
                )

            print(transcript.text)
components:
  schemas:
    Error:
      type: object
      required:
        - error
      description: |
        Standard error envelope. `error` carries either a stable PascalCase
        identifier or a free-text label (legacy endpoints) - `code` is the
        canonical machine-readable identifier going forward.
      properties:
        error:
          type: string
          description: Stable PascalCase identifier or short error label.
        message:
          type: string
          description: Human-readable error message.
        code:
          type: string
          description: |
            Machine-readable error code. Observed values include
            `RATE_LIMITED`, `MODEL_NOT_ALLOWED`, `HEADER_POLICY_VIOLATION`,
            `MODEL_NOT_FOUND`,
            `MODEL_EXISTS`, `MISSING_MODEL_ID`, `MISSING_TYPE`, `INVALID_BODY`,
            `INVALID_ITEMS`, `INVALID_DIMENSIONS`, `PAYLOAD_TOO_LARGE`,
            `METHOD_NOT_ALLOWED`, `PROVIDER_ERROR`, `PROVIDER_NO_RESPONSE`.
        details:
          description: Optional structured context (e.g. list of invalid items).
          additionalProperties: true
        status:
          type: integer
          description: HTTP status mirror, when present.
        retryAfter:
          type: integer
          description: Seconds to wait before retrying (rate-limit responses).
        provider:
          type: string
          description: Upstream provider name (provider-error responses).
        model:
          type: string
          description: Model id involved in the error (provider-error responses).
        provider_error_type:
          type: string
          description: Upstream provider's own error class name.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        User-bound credential carrying an identity: either a session JWT
        or a user access token (`at:*`) generated from the user settings UI.
        Send as `Authorization: Bearer <token>`.
        Org API keys (`iak_*`) are **not** accepted here - they carry
        no user identity. Use the `x-prismeai-api-key` header instead
        (see `OrgApiKeyAuth`).
    OrgApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key
      description: |
        Organization API key (`iak_{orgSlug}_{uuid}`). Unlike
        `Authorization: Bearer`, this credential is **not** tied to a user
        identity - it is bound to the org and its effective access is
        defined by the scopes / permission rules attached to it (it can
        be restricted to a single project, or kept broader).
        Send as `x-prismeai-api-key: iak_...`.

````

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