openapi: 3.1.0
info:
  title: AllModels API
  version: 0.1.0
  summary: Text-to-speech and speech-to-text across multiple providers.
  description: |-
    AllModels provides one API for text-to-speech and speech-to-text across
    multiple providers. Use the official ElevenLabs or OpenAI SDK, call the HTTP
    endpoints directly, or connect with WebSockets for realtime audio.

    The SDK-compatible surfaces implement only the `/el` and `/oai` endpoints
    listed in this document; any other path under them returns `501` with code
    `not_implemented` in that SDK's own error envelope.

    Available providers: deepgram, elevenlabs, soniox, assemblyai, fish, groq, grok, minimax, cartesia, together, openai, gemini, fal, cloudflare, qwen.

    ## Authentication
    Authenticated endpoints accept an AllModels API key as
    `Authorization: Bearer <key>`. The public account signup endpoints and
    `GET /health` do not require a key. The `xi-api-key` header is documented
    only for the ElevenLabs-compatible endpoints under `/el`.

    ## Models and providers
    Use names such as `deepgram/nova-3` or `elevenlabs/eleven-turbo-v2-5` to
    select a model. Use provider preferences to restrict or prioritize the providers
    that can serve it. Automatic retries with another provider are not currently
    supported.

    ## WebSockets
    WebSocket endpoints use an HTTP upgrade to establish the connection. Each
    endpoint documents the messages you can send and receive after connecting.
  license:
    name: UNLICENSED
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.allmodels.io
    description: AllModels API
tags:
  - name: Health
    description: Liveness probe.
  - name: Account
    description: Create or access an AllModels account, receive an API key, and add prepaid balance.
  - name: Models
    description: Served model discovery.
  - name: Providers
    description: Provider defaults and supported models.
  - name: Voices
    description: Provider-aware TTS voice discovery.
  - name: Native TTS/STT
    description: Native-protocol WebSocket streaming routes.
  - name: Realtime
    description: Direct voice sessions that combine streaming STT, your application, and streaming TTS.
  - name: ElevenLabs SDK
    description: ElevenLabs-SDK-compatible routes.
  - name: OpenAI SDK
    description: OpenAI JavaScript/Python SDK-compatible audio and realtime routes under `/oai`.
security:
  - BearerAuth: []
components:
  securitySchemes:
    XiApiKey:
      type: apiKey
      in: header
      name: xi-api-key
      description: Tenant key (ElevenLabs SDK convention).
    BearerAuth:
      type: http
      scheme: bearer
      description: Tenant key supplied as the Authorization Bearer token.
    RealtimeClientSecret:
      type: apiKey
      in: query
      name: client_secret
      description: Single-use client secret returned by POST /v1/realtime/client-secrets.
  schemas:
    TtsProviderId:
      type: string
      enum:
        - deepgram
        - elevenlabs
        - soniox
        - fish
        - groq
        - grok
        - minimax
        - cartesia
        - together
        - openai
        - gemini
        - fal
        - cloudflare
      description: Provider that supports text-to-speech.
    SttProviderId:
      type: string
      enum:
        - deepgram
        - elevenlabs
        - soniox
        - assemblyai
        - fish
        - groq
        - grok
        - cartesia
        - together
        - openai
        - gemini
        - fal
        - cloudflare
        - qwen
      description: Provider that supports speech-to-text.
    ProviderPreferences:
      type: object
      properties:
        order:
          type: array
          items:
            type: string
          description: Provider IDs to try first.
        only:
          type: array
          items:
            type: string
          description: Only use these providers.
        ignore:
          type: array
          items:
            type: string
          description: Do not use these providers.
        allow_fallbacks:
          type: boolean
          description: When false, use only the first matching provider.
      description: Choose, exclude, or prioritize providers for a request.
    VoiceSettings:
      type: object
      properties:
        speed:
          type: number
          description: Speech-speed multiplier. `1` is normal speed. The supported range varies by provider (Fish 0.5–2.0, ElevenLabs 0.7–1.2).
        stability:
          type: number
          minimum: 0
          maximum: 1
          description: ElevenLabs-only. Lower = more expressive/variable, higher = more stable.
        similarity_boost:
          type: number
          minimum: 0
          maximum: 1
          description: ElevenLabs-only. Adherence to the original voice.
        style:
          type: number
          minimum: 0
          maximum: 1
          description: ElevenLabs-only. Style exaggeration.
        use_speaker_boost:
          type: boolean
          description: ElevenLabs-only. Boosts similarity to the speaker at some latency cost.
      additionalProperties: {}
      description: Voice settings supported by the selected provider. `speed` works across multiple providers. ElevenLabs also supports `stability`, `similarity_boost`, `style`, and `use_speaker_boost`.
    DeepgramTtsOptions:
      type: object
      properties:
        encoding:
          type: string
          default: linear16
          enum:
            - linear16
            - mulaw
            - alaw
          description: Output audio encoding. Also derivable from an ElevenLabs `output_format` token.
        sample_rate:
          type: number
          enum:
            - 8000
            - 16000
            - 24000
            - 32000
            - 48000
          description: Output sample rate in Hz. Defaults to 24000, or 16000 when `format=pcm`.
        speed:
          type: number
          default: 1
          minimum: 0.7
          maximum: 1.5
          description: Speaking-rate multiplier from 0.7 to 1.5. Also accepted as `voice_settings.speed`.
        container:
          type: string
          description: File container for HTTP requests. Ignored for WebSocket requests.
        bit_rate:
          type: number
          description: Bitrate for compressed HTTP output.
      additionalProperties: {}
      description: Deepgram realtime TTS options. Select an Aura voice with the top-level `model` field.
    ElevenLabsTtsOptions:
      type: object
      properties:
        language_code:
          type: string
          description: Enforce output language, ISO 639-1 (Turbo/Flash v2.5 only).
        enable_logging:
          type: boolean
          default: true
          description: false = zero-retention mode (enterprise only).
        enable_ssml_parsing:
          type: boolean
          default: false
          description: Parse SSML tags in input text (increases latency).
        output_format:
          type: string
          description: "Output codec token: mp3_22050_32, mp3_44100_{32..192}, pcm_{8000..44100}, ulaw_8000, alaw_8000, opus_48000_{32..192}. Defaults to mp3_44100_128, or pcm_16000 when `format=pcm`."
        sync_alignment:
          type: boolean
          default: false
          description: On the streaming surface, forward provider-supplied character timing on audio frames when the model returns it. Providers without timing data accept this option as a no-op.
        auto_mode:
          type: boolean
          default: false
          description: Generate per message instead of buffering; lower latency, worse prosody.
        apply_text_normalization:
          type: string
          default: auto
          enum:
            - auto
            - on
            - off
          description: Number/spelling normalization (`on` unsupported for turbo/flash v2.5).
        seed:
          type: number
          minimum: 0
          maximum: 4294967295
          description: Best-effort deterministic sampling.
        voice_settings:
          type: string
          description: JSON-encoded VoiceSettings object (stability, similarity_boost, style, use_speaker_boost, speed 0.7–1.2), delivered on the init frame.
        generation_config:
          type: string
          description: JSON-encoded generation config. `chunk_length_schedule` values must be between 50 and 500.
      additionalProperties: {}
      description: ElevenLabs streaming-input TTS options. Set `model` and `voice` with the top-level fields.
    SonioxTtsOptions:
      type: object
      properties:
        language:
          type: string
          default: en
          description: TTS language (ISO code).
        language_code:
          type: string
          description: ElevenLabs-compat alias for `language` (the native key wins).
        sample_rate:
          type: number
          enum:
            - 8000
            - 16000
            - 24000
            - 44100
            - 48000
          description: Output sample rate in Hz (streaming default 44100).
        audio_format:
          type: string
          enum:
            - pcm_f32le
            - pcm_s16le
            - pcm_mulaw
            - pcm_alaw
            - wav
            - mp3
            - aac
            - opus
            - flac
          description: Synchronous REST only — the streaming WS always emits pcm_s16le.
        bitrate:
          type: number
          enum:
            - 32000
            - 64000
            - 96000
            - 128000
            - 192000
            - 256000
            - 320000
          description: Synchronous REST only — codec bitrate (bps) for lossy formats.
      additionalProperties: {}
      description: Soniox TTS options. The default model is `tts-rt-v1` and the default voice is `Adrian`. ElevenLabs `output_format` values are also supported.
    FishTtsOptions:
      type: object
      properties:
        format:
          type: string
          default: mp3
          enum:
            - wav
            - pcm
            - mp3
            - opus
          description: Output audio format (`wav`/`opus` only reachable via provider_options).
        sample_rate:
          type: number
          description: "Audio sample rate in Hz (null = format default: 44100, opus 48000)."
        mp3_bitrate:
          type: number
          default: 128
          enum:
            - 64
            - 128
            - 192
          description: MP3 bitrate in kbps (mp3 format only).
        opus_bitrate:
          type: number
          default: -1000
          enum:
            - -1000
            - 24000
            - 32000
            - 48000
            - 64000
          description: Opus bitrate in bps; -1000 = automatic (opus format only).
        temperature:
          type: number
          default: 0.7
          minimum: 0
          maximum: 1
          description: Expressiveness; higher = more varied.
        top_p:
          type: number
          default: 0.7
          minimum: 0
          maximum: 1
          description: Diversity via nucleus sampling.
        chunk_length:
          type: number
          default: 300
          minimum: 100
          maximum: 300
          description: Text segment size for processing.
        normalize:
          type: boolean
          default: true
          description: Text normalization for English/Chinese (literal true/false only).
        latency:
          type: string
          default: normal
          enum:
            - normal
            - balanced
            - low
          description: Latency–quality trade-off.
        prosody:
          type: string
          description: 'JSON-encoded prosody object: `{"speed": 0.5–2.0, "volume": dB, "normalize_loudness": bool}` (normalize_loudness is S2-Pro only).'
        speed:
          type: number
          minimum: 0.5
          maximum: 2
          description: Alias for `prosody.speed`. An explicit `prosody.speed` value takes precedence.
        apply_text_normalization:
          type: string
          enum:
            - auto
            - on
            - off
          description: ElevenLabs-compat alias for `normalize` (native key wins).
        optimize_streaming_latency:
          type: number
          minimum: 0
          maximum: 4
          description: ElevenLabs-compat alias for `latency` (0→normal, 1–2→balanced, 3+→low).
      additionalProperties: {}
      description: Fish Audio realtime TTS options. Set the voice and model with the top-level fields. The default model is `s2-pro`.
    GroqTtsOptions:
      type: object
      properties:
        voice:
          type: string
          default: autumn
          enum:
            - autumn
            - diana
            - hannah
            - austin
            - daniel
            - troy
          description: Orpheus voice. The top-level `voice` value takes precedence.
        response_format:
          type: string
          default: wav
          enum:
            - wav
          description: Output container — Orpheus models accept only wav.
        instructions:
          type: string
          maxLength: 4096
          description: Short free-form vocal direction, injected as a leading bracketed `[direction]` on the spoken text. English Orpheus only — `canopylabs/orpheus-arabic-saudi` documents no vocal direction and is sent the text unchanged.
      additionalProperties: {}
      description: Groq TTS options. Set `voice`, `response_format`, and the top-level `model` field. The default model is `canopylabs/orpheus-v1-english`.
    GrokTtsOptions:
      type: object
      properties:
        language:
          type: string
          default: auto
          description: "Synthesis language: `auto` or a BCP-47 tag (en, ar-EG, ar-SA, ar-AE, bn, zh, fr, de, hi, id, it, ja, ko, pt-BR, pt-PT, ru, es-MX, es-ES, tr, vi). `language_code` alias wins."
        language_code:
          type: string
          description: Alias for `language` (checked first).
        codec:
          type: string
          enum:
            - mp3
            - wav
            - pcm
            - mulaw
            - alaw
          description: Output audio codec. Defaults to MP3, or PCM when `format=pcm`.
        sample_rate:
          type: number
          default: 24000
          enum:
            - 8000
            - 16000
            - 22050
            - 24000
            - 44100
            - 48000
          description: Output sample rate in Hz.
        bit_rate:
          type: number
          default: 128000
          enum:
            - 32000
            - 64000
            - 96000
            - 128000
            - 192000
          description: Bits per second (mp3 codec only).
        speed:
          type: number
          default: 1
          minimum: 0.7
          maximum: 1.5
          description: Speech-speed multiplier from 0.5 to 2.0. Also accepted as `voice_settings.speed`.
        optimize_streaming_latency:
          type: number
          default: 0
          enum:
            - 0
            - 1
            - 2
          description: Latency optimization level (0 = best quality, 2 = lowest latency).
        text_normalization:
          type: boolean
          default: false
          description: Normalize written-form text to spoken form before synthesis.
      additionalProperties: {}
      description: Grok realtime TTS options. Available voices include `ara`, `eve`, `leo`, `rex`, `sal`, and custom voice IDs. The default voice is `eve`.
    MinimaxTtsOptions:
      type: object
      properties:
        speed:
          type: number
          default: 1
          minimum: 0.5
          maximum: 2
          description: Speech rate multiplier (voice_setting.speed). Also read from `voice_settings.speed`.
        vol:
          type: number
          default: 1
          exclusiveMinimum: 0
          maximum: 10
          description: Loudness (voice_setting.vol).
        pitch:
          type: number
          default: 0
          minimum: -12
          maximum: 12
          description: Pitch shift in semitones (voice_setting.pitch).
        sample_rate:
          type: number
          default: 32000
          enum:
            - 8000
            - 16000
            - 22050
            - 24000
            - 32000
            - 44100
          description: Output sampling rate in Hz (audio_setting.sample_rate).
        bitrate:
          type: number
          default: 128000
          enum:
            - 32000
            - 64000
            - 128000
            - 256000
          description: Output bitrate in bps, mp3 format only (audio_setting.bitrate).
        format:
          type: string
          default: mp3
          enum:
            - mp3
            - pcm
            - flac
            - wav
            - pcmu_raw
            - pcmu_wav
            - opus
          description: Audio container and encoding.
      additionalProperties: {}
      description: MiniMax realtime TTS options. The default voice is `English_expressive_narrator`, the default model is `speech-2.8-turbo`, and output is mono.
    CartesiaTtsOptions:
      type: object
      properties:
        speed:
          type: number
          default: 1
          minimum: 0.6
          maximum: 1.5
          description: Speech-speed multiplier (generation_config.speed); also read from `voice_settings.speed`.
        encoding:
          type: string
          default: pcm_s16le
          enum:
            - pcm_f32le
            - pcm_s16le
            - pcm_mulaw
            - pcm_alaw
          description: Raw PCM output encoding (container is always `raw` on the WS).
        sample_rate:
          type: number
          default: 44100
          enum:
            - 8000
            - 16000
            - 22050
            - 24000
            - 44100
            - 48000
          description: Output sample rate in Hz.
        language_code:
          type: string
          description: Transcript language, ISO 639-1 (alias `language`; language_code wins).
        language:
          type: string
          description: Alias for `language_code`.
      additionalProperties: {}
      description: Cartesia realtime TTS options. Use the top-level `voice` and `model` fields to select a voice and model. The default model is `sonic-3.6`.
    TogetherTtsOptions:
      type: object
      properties:
        sample_rate:
          type: number
          default: 24000
          description: Output sampling rate in Hz.
        language:
          type: string
          default: en
          description: Language/locale of the input text (lowercase ISO codes, e.g. en, fr, zh-hk).
        language_code:
          type: string
          description: ElevenLabs-compat alias for `language` (wins over it).
        speed:
          type: number
          default: 1
          minimum: 0.5
          maximum: 2
          description: Speech speed multiplier from 0.5 to 2.0. Also accepted as `voice_settings.speed`.
      additionalProperties: {}
      description: Together TTS options. Realtime output is raw PCM. The default voice is `tara` and the default model is `canopylabs/orpheus-3b-0.1-ft`. Cartesia Sonic models are available for synchronous requests only and require a voice name rather than a UUID.
    OpenaiTtsOptions:
      type: object
      properties:
        voice:
          type: string
          default: alloy
          enum:
            - alloy
            - ash
            - ballad
            - coral
            - echo
            - fable
            - onyx
            - nova
            - sage
            - shimmer
            - verse
            - marin
            - cedar
          description: Voice for generated audio. The top-level `voice` value takes precedence.
        response_format:
          type: string
          default: mp3
          enum:
            - mp3
            - opus
            - aac
            - flac
            - wav
            - pcm
          description: Output audio encoding.
        speed:
          type: number
          default: 1
          minimum: 0.25
          maximum: 4
          description: Playback speed, limited to the range supported by OpenAI.
        instructions:
          type: string
          maxLength: 4096
          description: Free-form delivery direction such as tone, accent, pacing or character. Honored by `gpt-4o-mini-tts`; not supported by `tts-1` or `tts-1-hd`, which are sent no instruction field.
      additionalProperties: {}
      description: OpenAI TTS options. The default model is `gpt-4o-mini-tts`; `tts-1` is also supported.
    GeminiTtsOptions:
      type: object
      properties:
        voice:
          type: string
          default: Kore
          description: Prebuilt voice name (30 voices, e.g. Zephyr, Puck, Charon, Kore, Fenrir, Leda, Orus, Aoede). The top-level `voice` value takes precedence.
        speed:
          type: number
          minimum: 0.25
          maximum: 2
          description: Speaking-rate multiplier from 0.25 to 2.0. Also accepted as `voice_settings.speed`.
        instructions:
          type: string
          maxLength: 4096
          description: Free-form delivery direction such as style, accent, tone or director notes. Gemini has no separate instruction field, so the value is folded into the generation prompt as its own delivery-directions section; it composes with `speed`.
      additionalProperties: {}
      description: Gemini TTS options. Output is always raw PCM s16le @ 24 kHz; language is auto-detected (Gemini TTS accepts no explicit language code).
    FalTtsOptions:
      type: object
      properties:
        voice:
          type: string
          default: Rachel
          description: ElevenLabs voice name or ID. The top-level `voice` value takes precedence.
        stability:
          type: number
          default: 0.5
          minimum: 0
          maximum: 1
          description: Voice stability.
        similarity_boost:
          type: number
          default: 0.75
          minimum: 0
          maximum: 1
          description: Similarity boost.
        style:
          type: number
          minimum: 0
          maximum: 1
          description: Style exaggeration.
        speed:
          type: number
          default: 1
          minimum: 0.7
          maximum: 1.2
          description: Speech tempo; <1 slower, >1 faster.
        language_code:
          type: string
          description: Enforce a language (ISO 639-1).
      additionalProperties: {}
      description: Fal TTS options. Direct fields take precedence over values in `voice_settings`. Output is MP3.
    DeepgramSttOptions:
      type: object
      properties:
        encoding:
          type: string
          enum:
            - linear16
            - linear32
            - flac
            - alaw
            - mulaw
            - amr-nb
            - amr-wb
            - opus
            - ogg-opus
            - speex
            - g729
          description: Expected encoding of submitted raw audio. Also derivable from `audio_format`.
        sample_rate:
          type: number
          description: Sample rate of raw audio in Hz; required with raw encodings.
        channels:
          type: number
          default: 1
          description: Number of audio channels (stripped for Flux models).
        multichannel:
          type: boolean
          default: false
          description: Transcribe each channel independently.
        interim_results:
          type: boolean
          default: false
          description: Send ongoing partial transcripts (forced on when `min_silence_duration_ms` is used).
        endpointing:
          anyOf:
            - type: number
            - type: boolean
          default: 10
          description: Silence (ms) before finalizing an utterance, or `false` to disable.
        utterance_end_ms:
          type: number
          minimum: 1000
          description: Gap (ms) between words before emitting UtteranceEnd; requires interim_results.
        vad_events:
          type: boolean
          default: false
          description: Emit SpeechStarted events.
        smart_format:
          type: boolean
          default: false
          description: Apply full formatting to the transcript.
        no_delay:
          type: boolean
          default: false
          description: Skip smart_format's entity-completion wait (may skip formatting).
        punctuate:
          type: boolean
          default: false
          description: Add punctuation and capitalization.
        diarize:
          type: boolean
          default: false
          description: Recognize speaker changes.
        diarize_model:
          type: string
          enum:
            - latest
            - v1
          description: Selects and enables a diarization model version.
        numerals:
          type: boolean
          default: false
          description: Convert written numbers to numerals.
        profanity_filter:
          type: boolean
          default: false
          description: Filter recognized profanity.
        redact:
          type: string
          description: Redact sensitive info (pci, numbers, ssn, aggressive_numbers); repeat for multiple categories.
        replace:
          type: string
          description: Find-and-replace terms (`term:replacement`); repeatable.
        search:
          type: string
          description: Search submitted audio for terms; repeatable.
        keyterm:
          type: string
          description: Boost specialized terminology (Nova-3 only); repeatable.
        keywords:
          type: string
          description: Keyword boosting `word:boost` (Nova-2 and earlier); repeatable.
        filler_words:
          type: boolean
          default: false
          description: Keep "uh"/"um" in the transcript.
        dictation:
          type: boolean
          default: false
          description: Convert dictated commands to punctuation.
        detect_entities:
          type: boolean
          default: false
          description: Extract entities.
        tag:
          type: string
          description: Label requests for usage reporting.
        extra:
          type: string
          description: Arbitrary `key:value` pairs echoed in metadata; repeatable.
        version:
          type: string
          default: latest
          description: Model version.
        mip_opt_out:
          type: boolean
          default: false
          description: Opt out of the Model Improvement Program.
        eot_threshold:
          type: number
          default: 0.7
          minimum: 0.5
          maximum: 0.9
          description: "Flux only: end-of-turn confidence required to finish a turn."
        eager_eot_threshold:
          type: number
          minimum: 0.3
          maximum: 0.9
          description: "Flux only: lower confidence that fires EagerEndOfTurn/TurnResumed events."
        eot_timeout_ms:
          type: number
          default: 5000
          description: "Flux only: force turn end after this much post-speech time."
        audio_format:
          type: string
          description: Input format such as `pcm_16000` or `ulaw_8000`.
        keyterms:
          type: string
          description: ElevenLabs-compat alias for `keyterm`; repeatable.
        vad_silence_threshold_secs:
          type: number
          description: "ElevenLabs-compat: seconds of silence ending an utterance (mapped to `endpointing`)."
        vad_threshold:
          type: number
          description: "ElevenLabs-compat: enables `vad_events` (the numeric value itself is not honored)."
        min_silence_duration_ms:
          type: number
          description: "ElevenLabs-compat: mapped to `utterance_end_ms` (floored at 1000; forces interim_results)."
        commit_strategy:
          type: string
          enum:
            - auto
            - manual
          description: "ElevenLabs-compat: `manual` disables endpointing; commit via client frames."
        no_verbatim:
          type: boolean
          description: "ElevenLabs-compat: inverted into `filler_words`."
      additionalProperties: {}
      description: Deepgram realtime STT options. Set the model and language with the top-level request fields.
    ElevenLabsSttOptions:
      type: object
      properties:
        audio_format:
          type: string
          default: pcm_16000
          enum:
            - pcm_8000
            - pcm_16000
            - pcm_22050
            - pcm_24000
            - pcm_44100
            - pcm_48000
            - ulaw_8000
          description: Input audio encoding.
        language_code:
          type: string
          description: Input language. When omitted, the language is detected automatically. The top-level `language` value takes precedence.
        commit_strategy:
          type: string
          default: manual
          enum:
            - manual
            - vad
          description: manual = client sends commit frames; vad = auto-commit on silence.
        vad_silence_threshold_secs:
          type: number
          default: 1.5
          minimum: 0.3
          maximum: 3
          description: Silence duration triggering a VAD commit.
        vad_threshold:
          type: number
          default: 0.4
          minimum: 0.1
          maximum: 0.9
          description: Voice-activity detection sensitivity.
        min_speech_duration_ms:
          type: number
          default: 100
          minimum: 50
          maximum: 2000
          description: Minimum speech length to count as speech.
        min_silence_duration_ms:
          type: number
          default: 100
          minimum: 50
          maximum: 2000
          description: Minimum silence length to count as a break.
        include_timestamps:
          type: boolean
          default: false
          description: Word-level timestamps on committed transcripts.
        include_language_detection:
          type: boolean
          default: false
          description: Return the detected language on committed transcripts.
        keyterms:
          type: string
          description: Bias recognition toward these words/phrases (repeatable, ≤1000 terms).
        no_verbatim:
          type: boolean
          default: false
          description: Strip filler words / false starts.
        enable_logging:
          type: boolean
          default: true
          description: false = zero-retention mode (enterprise only).
      additionalProperties: {}
      description: ElevenLabs realtime STT options. Set `model` and `language` with the top-level fields.
    SonioxSttOptions:
      type: object
      properties:
        audio_format:
          type: string
          default: auto
          description: "Encoding of streamed audio: `auto`, a container (aac, aiff, amr, asf, flac, mp3, ogg, wav, webm), or raw (pcm_s16le…pcm_f64, mulaw, alaw). With `auto`, sample_rate/num_channels are not sent."
        sample_rate:
          type: number
          description: Sample rate in Hz; required for raw formats (only sent when audio_format ≠ auto).
        num_channels:
          type: number
          description: Channel count for raw audio (only sent when audio_format ≠ auto).
        language_hints:
          type: string
          description: Suggested languages to bias recognition (repeatable). The top-level `language` value takes precedence.
        context:
          type: string
          description: Domain context to bias recognition (≤10,000 chars).
        enable_endpoint_detection:
          type: boolean
          default: false
          description: Auto-finalize tokens on detected speech pauses.
        enable_speaker_diarization:
          type: boolean
          default: false
          description: Label tokens with a speaker id.
        commit_strategy:
          type: string
          enum:
            - auto
            - manual
          description: "ElevenLabs-compat: `manual` disables endpoint detection; commit via client frames."
        vad_silence_threshold_secs:
          type: number
          description: "ElevenLabs-compat: mapped to `max_endpoint_delay_ms` (clamped 500–3000 ms)."
        min_silence_duration_ms:
          type: number
          description: "ElevenLabs-compat: same mapping when vad_silence_threshold_secs is absent."
        keyterms:
          type: string
          description: "ElevenLabs-compat: mapped to `context.terms` (skipped when `context` is set); repeatable."
      additionalProperties: {}
      description: Soniox realtime STT options. Set `model` and `language` with the top-level fields. Boolean options accept only `true` or `false`.
    AssemblyaiSttOptions:
      type: object
      properties:
        sample_rate:
          type: number
          default: 16000
          minimum: 8000
          maximum: 96000
          description: Sample rate of the incoming audio stream in Hz.
        encoding:
          type: string
          default: pcm_s16le
          enum:
            - pcm_s16le
            - pcm_mulaw
          description: Encoding of the audio stream.
        format_turns:
          type: boolean
          default: false
          description: Return formatted (punctuated/cased) final transcripts (always on for u3-rt-pro).
        end_of_turn_confidence_threshold:
          type: number
          default: 0.4
          minimum: 0
          maximum: 1
          description: Confidence threshold for end-of-turn detection (unsupported on u3-rt-pro).
        min_end_of_turn_silence_when_confident:
          type: number
          default: 160
          description: Silence in milliseconds required to end a turn when confident. Deprecated by AssemblyAI.
        max_turn_silence:
          type: number
          description: Maximum silence (ms) in a turn before end-of-turn is forced (default 1280/1000 per model).
        keyterms_prompt:
          type: string
          description: JSON-encoded string array of bias terms (≤100 terms, ≤50 chars each). Prefer the `keyterms` alias, which JSON-encodes for you.
        keyterms:
          type: string
          description: Repeatable ElevenLabs-compatible alias for `keyterms_prompt`.
        commit_strategy:
          type: string
          enum:
            - auto
            - manual
          description: "ElevenLabs-compat: `manual` sets format_turns=false and commits via ForceEndpoint frames."
        vad_threshold:
          type: number
          description: "ElevenLabs-compat: mapped to `end_of_turn_confidence_threshold`."
        vad_silence_threshold_secs:
          type: number
          description: "ElevenLabs-compat: seconds → `max_turn_silence` ms."
        min_silence_duration_ms:
          type: number
          description: "ElevenLabs-compat: mapped to `min_end_of_turn_silence_when_confident`."
        audio_format:
          type: string
          description: ElevenLabs-style input format, such as `pcm_16000` or `ulaw_8000`.
      additionalProperties: {}
      description: AssemblyAI realtime STT options. Use the top-level `model` field to select the speech model (default `u3-rt-pro`; async transcription defaults to `universal-3-5-pro`).
    GroqSttOptions:
      type: object
      properties:
        audio_format:
          type: string
          default: pcm_16000
          description: Input PCM format, such as `pcm_16000`. The sample rate is used when transcribing the completed stream.
      additionalProperties: {}
      description: Groq STT options. Realtime audio is transcribed when the stream is finalized. The default model is `whisper-large-v3`.
    GrokSttOptions:
      type: object
      properties:
        sample_rate:
          type: number
          default: 16000
          enum:
            - 8000
            - 16000
            - 22050
            - 24000
            - 44100
            - 48000
          description: Input audio sample rate in Hz.
        encoding:
          type: string
          default: pcm
          enum:
            - pcm
            - mulaw
            - alaw
          description: Raw input audio encoding (pcm = s16le).
        interim_results:
          type: boolean
          default: false
          description: Emit partial transcripts (~every 500 ms).
        endpointing:
          type: number
          default: 10
          minimum: 0
          maximum: 5000
          description: Silence (ms) before an utterance is marked final.
        smart_turn:
          type: number
          minimum: 0
          maximum: 1
          description: End-of-turn confidence threshold (0.0–1.0). Supplying it enables Smart Turn; confidence is preserved as provider metadata.
        smart_turn_timeout:
          type: number
          minimum: 1
          maximum: 5000
          description: Maximum silence in milliseconds before forcing `speech_final` while Smart Turn is enabled.
        diarize:
          type: boolean
          default: false
          description: Speaker diarization; adds a speaker id to word results.
        multichannel:
          type: boolean
          default: false
          description: Transcribe each channel independently.
      additionalProperties: {}
      description: Grok realtime STT options. Set `model` and `language` with the top-level fields. With `commit_strategy=manual`, completed transcript text is returned together on commit.
    CartesiaSttOptions:
      type: object
      properties:
        stream_mode:
          type: string
          default: manual
          enum:
            - manual
            - turns
          description: Realtime protocol mode. `turns` selects Cartesia's explicit turn.start/eager_end/resume/end endpoint.
        encoding:
          type: string
          default: pcm_s16le
          enum:
            - pcm_s16le
            - pcm_s32le
            - pcm_f16le
            - pcm_f32le
            - pcm_mulaw
            - pcm_alaw
          description: Input audio encoding.
        sample_rate:
          type: number
          default: 16000
          description: Input sample rate in Hz.
        min_volume:
          type: number
          minimum: 0
          maximum: 1
          description: Volume threshold treated as silence for automatic finalization.
        max_silence_duration_secs:
          type: number
          description: Maximum silence before automatic transcript finalization.
        turn_start_threshold:
          type: number
          minimum: 0.5
          maximum: 0.9
          description: Turns endpoint likelihood threshold for emitting `turn.start`.
        turn_eager_end_threshold:
          type: number
          minimum: 0.3
          maximum: 0.6
          description: Turns endpoint likelihood threshold for emitting `turn.eager_end`.
        turn_end_threshold:
          type: number
          minimum: 0.05
          maximum: 0.5
          description: Turns endpoint likelihood threshold for emitting `turn.end`.
        turn_end_timeout_ms:
          type: integer
          minimum: 640
          maximum: 11200
          description: Maximum wait after speech before the turns endpoint emits `turn.end`.
      additionalProperties: {}
      description: Cartesia realtime STT options. The default model is `ink-2`; use `ink-whisper` when you need word timestamps. Turn signals are opt-in with `stream_mode=turns`; the default language is English.
    OpenaiSttOptions:
      type: object
      properties:
        sample_rate:
          type: number
          default: 24000
          minimum: 24000
          description: Input PCM sample rate. Values below 24000 are sent as 24000.
        audio_format:
          type: string
          description: ElevenLabs-style PCM token (`pcm_16000`); its rate is a fallback for `sample_rate`.
      additionalProperties: {}
      description: OpenAI realtime STT options. Supported models include `gpt-live-transcribe`, `gpt-transcribe`, `gpt-realtime-whisper`, `gpt-4o-transcribe`, and `gpt-4o-mini-transcribe`. `gpt-live-transcribe` accepts a `delay` option (`minimal`/`low`/`medium`/`high`/`xhigh`) to trade latency against accuracy; `gpt-transcribe` and `gpt-live-transcribe` also take `prompt`, `keywords`, and `languages` context hints. Audio is finalized when the client commits it.
    GeminiSttOptions:
      type: object
      properties:
        audio_format:
          type: string
          default: pcm_16000
          description: Input PCM format such as `pcm_16000`.
      additionalProperties: {}
      description: Gemini STT options. Realtime runs over the Live API (`gemini-3.5-transcribe-live`); file transcription is a single blocking request. Word timestamps are returned only by `gemini-3.5-transcribe` on the file surface, never on the realtime one.
    QwenSttOptions:
      type: object
      properties:
        language:
          type: string
          enum:
            - zh
            - yue
            - en
            - ja
            - de
            - ko
            - ru
            - fr
            - pt
            - ar
            - it
            - es
            - hi
            - id
            - th
            - tr
            - uk
            - vi
            - cs
            - da
            - fil
            - fi
            - is
            - ms
            - no
            - pl
            - sv
          description: "Language of the audio. Omit for automatic detection. Reaches ALL THREE bindings: sent as `asr_options.language` on the batch call, as `parameters.language` on `qwen3-asr-flash-filetrans`, and as `session.input_audio_transcription.language` on the realtime session. Chinese dialects (Sichuanese, Hokkien, Wu) are detected under `zh`; Cantonese is the separate `yue` code. An unrecognized code is rejected by the batch endpoint with a precise 400, but is accepted silently on the realtime path, which validates nothing here."
        enable_itn:
          type: string
          default: "false"
          enum:
            - "true"
            - "false"
          description: "Both non-streaming bindings: sent as `asr_options.enable_itn` on the batch chat-completions call and as `parameters.enable_itn` on `qwen3-asr-flash-filetrans`. Inverse text normalization (spoken numbers and dates rendered in digit form). Effective for Chinese and English only."
        context:
          type: string
          description: Both non-streaming bindings. Free-text biasing for domain terms and hotwords, delivered as the first system message on `qwen3-asr-flash` and as `parameters.corpus` on `qwen3-asr-flash-filetrans`. The top-level `prompt` field takes precedence when both are supplied.
      additionalProperties: {}
      description: "Qwen STT options. Three bindings: `qwen3-asr-flash` is blocking file transcription, `qwen3-asr-flash-filetrans` is asynchronous long-file transcription (submitted upstream as a task and polled to completion within the one request), and `qwen3-asr-flash-realtime` is a streaming WebSocket session (the streaming default). `enable_itn` and `context` reach both non-streaming bindings; `language` reaches all three. `qwen3-asr-flash-filetrans` is the only binding that returns word timestamps; request them with the portable `timestamps_granularity=word`. Multi-channel selection is not exposed: the vendor's `channel_id` bills each requested track separately while the router meters one file's duration."
    Health:
      type: object
      properties:
        ok:
          type: boolean
          enum:
            - true
        commit:
          type:
            - string
            - "null"
          description: Git commit SHA injected by the deployment pipeline, or null when unavailable.
      required:
        - ok
        - commit
    ModelsResponse:
      type: object
      properties:
        tts:
          type: array
          items:
            $ref: "#/components/schemas/ModelListing"
          description: Available text-to-speech models.
        stt:
          type: array
          items:
            $ref: "#/components/schemas/ModelListing"
          description: Available speech-to-text models.
      required:
        - tts
        - stt
    ModelListing:
      type: object
      properties:
        id:
          type: string
          description: The model's `{author}/{modelName}` name.
        aliases:
          type: array
          items:
            type: string
          description: Other accepted names for this model.
        providers:
          type: array
          items:
            $ref: "#/components/schemas/ModelProvider"
          description: Providers that support the model, in default order.
      required:
        - id
        - aliases
        - providers
      description: One model with its aliases and supported providers.
    ModelProvider:
      type: object
      properties:
        id:
          type: string
          description: Provider ID.
        modelId:
          type: string
          description: Model ID used by the provider.
        batch:
          type: boolean
          description: "Orthogonal STT discovery flag: the provider processes the synchronous file request via an internal queue. Not a route placement and not exclusive with `synchronous`."
        streaming:
          type: boolean
          description: Whether the model supports streaming (TTS convert or STT WebSocket).
        synchronous:
          type: boolean
          description: "Whether the model supports synchronous requests: blocking TTS convert, or a single blocking STT file-transcription request (including providers that queue it internally)."
        pricing:
          $ref: "#/components/schemas/ModelPricing"
        instructions:
          $ref: "#/components/schemas/TtsInstructionsSupport"
        streamingInput:
          $ref: "#/components/schemas/StreamingSttInputCapabilities"
      required:
        - id
        - modelId
      description: A provider that supports this model.
    ModelPricing:
      type: object
      properties:
        currency:
          type: string
          enum:
            - usd
          description: Currency of the resolved customer price.
        unit:
          type: string
          enum:
            - 1000 characters
            - minute
          description: "Published display unit: TTS is quoted per 1000 characters and STT per minute. Billing continues to meter per character and per audio second, with audio duration rounded up to whole seconds."
        unitPrice:
          type: string
          description: Customer price for the published display unit, as a decimal string rounded to at most 6 significant digits (half up).
        requestPrice:
          type: string
          description: Fixed per-request fee, present only when the binding carries one. Rounded to at most 6 significant digits.
      required:
        - currency
        - unit
        - unitPrice
      description: Resolved customer pricing; absent when the binding is unpriced.
    TtsInstructionsSupport:
      type: object
      properties:
        mode:
          type: string
          enum:
            - native
            - prompt
            - inline-freeform
            - inline-fixed
            - structured
            - unsupported
          description: The instruction mechanism this model documents. `native` is a dedicated free-form instruction field; `prompt` carries free-form direction inside the model's own text prompt; `inline-freeform` accepts open-ended bracketed direction in the spoken text; `inline-fixed` accepts only a finite set of documented tags; `structured` exposes typed controls such as speed, emotion or pitch but no arbitrary prose; `unsupported` documents no delivery-instruction control at all.
        honored:
          type: boolean
          description: "Whether this router translates the `instructions` parameter for this binding. Independent of `mode`: a binding can document an expressive mechanism whose router-side renderer is not written yet, and it publishes `false` until it is."
      required:
        - mode
        - honored
      description: "TTS bindings only: what this binding does with an `instructions` parameter. Absent on STT bindings."
    StreamingSttInputCapabilities:
      type: object
      properties:
        audioFormats:
          type: array
          items:
            type: string
          description: Raw formats accepted without conversion.
        channels:
          type: array
          items:
            type: integer
          description: Accepted input channel counts.
        commitStrategies:
          type: array
          items:
            type: string
            enum:
              - auto
              - manual
        turnDetection:
          type: array
          items:
            type: string
            enum:
              - acoustic
              - semantic
        routerVadFallback:
          type: boolean
          description: Whether router PCM inspection supplies automatic commits.
        portableOptions:
          type: array
          items:
            type: string
          description: Explicit portable options accepted by this binding.
        signals:
          type: array
          items:
            $ref: "#/components/schemas/SttSignalActivation"
          description: "What each portable activation makes the session signal. The contract is request-scoped rather than a property of the model, so this is a list: pick the entry whose `commitStrategy`, `turnDetection` and `eagerEndThreshold` match the request you intend to make. An empty array means the binding advertises no `stt.signal` states at all."
      required:
        - audioFormats
        - channels
        - commitStrategies
        - turnDetection
        - routerVadFallback
        - portableOptions
        - signals
      description: STT streaming input portability metadata; absent on TTS/non-streaming bindings.
    SttSignalActivation:
      type: object
      properties:
        commitStrategy:
          type: string
          enum:
            - auto
            - manual
          description: The commit strategy this entry describes.
        turnDetection:
          type: string
          enum:
            - acoustic
            - semantic
          description: The automatic detector this entry describes. Absent under manual commits, which name none.
        eagerEndThreshold:
          type: boolean
          description: Whether `eager_end_threshold` is requested. Present only on bindings where requesting the predictive option changes the signals; absent means the entry holds either way.
        states:
          type: array
          items:
            type: string
            enum:
              - started
              - end_candidate
              - resumed
              - end
          description: The `stt.signal` lifecycle states a session in this activation can carry.
        turnScopes:
          type: array
          items:
            type: string
            enum:
              - utterance
              - turn
          description: "The scopes a non-`started` state is reported at: an acoustic utterance boundary, a conversational turn, or both."
        basis:
          type: array
          items:
            type: string
            enum:
              - vad
              - silence
              - acoustic
              - linguistic
              - semantic
              - provider_declared
          description: The provider evidence behind this activation's boundary decisions. Absent when the activation reports no boundary at all, which is also when `turnScopes` is empty.
      required:
        - commitStrategy
        - states
        - turnScopes
    ProvidersResponse:
      type: object
      properties:
        providers:
          type: object
          additionalProperties:
            $ref: "#/components/schemas/ProviderListing"
          description: Available providers, keyed by provider ID.
      required:
        - providers
    ProviderListing:
      type: object
      properties:
        defaults:
          $ref: "#/components/schemas/ProviderDefaults"
        tts:
          type: array
          items:
            $ref: "#/components/schemas/ProviderServedModel"
          description: TTS models available from this provider.
        stt:
          type: array
          items:
            $ref: "#/components/schemas/ProviderServedModel"
          description: STT models available from this provider.
      required:
        - defaults
        - tts
        - stt
      description: One provider's defaults and supported models.
    ProviderDefaults:
      type: object
      properties:
        tts:
          type: object
          properties:
            model:
              type: string
            voice:
              type: string
        stt:
          type: object
          properties:
            model:
              type: string
            synchronousModel:
              type: string
              description: Default synchronous file-transcription model when it differs from the streaming model.
      description: Defaults used when a request omits a model or voice.
    ProviderServedModel:
      type: object
      properties:
        id:
          type: string
          description: Model ID used by the provider.
        canonical:
          type: string
          description: The model's public `{author}/{modelName}` name.
        aliases:
          type: array
          items:
            type: string
          description: Other accepted names for this model.
        batch:
          type: boolean
          description: "Orthogonal STT discovery flag: the provider processes the synchronous file request via an internal queue. Not a route placement and not exclusive with `synchronous`."
        streaming:
          type: boolean
          description: Whether the model supports streaming (TTS convert or STT WebSocket).
        synchronous:
          type: boolean
          description: "Whether the model supports synchronous requests: blocking TTS convert, or a single blocking STT file-transcription request (including providers that queue it internally)."
        pricing:
          $ref: "#/components/schemas/ModelPricing"
        formats:
          type: array
          items:
            type: string
            enum:
              - mp3
              - opus
              - aac
              - flac
              - wav
              - pcm
          description: "TTS models only: output container families servable on the SYNCHRONOUS convert routes (the provider's native formats, plus `wav` when the router wraps a raw-PCM provider's output; non-native families are served by transcoding the provider's best native stream, so every family is listed while the router's transcode service is available). Streaming WebSocket output formats are the separate `streamFormats` contract, not described by this field. Absent on STT models."
        streamFormats:
          type: array
          items:
            type: string
            enum:
              - mp3
              - opus
              - aac
              - flac
              - wav
              - pcm
          description: "TTS models with streaming placement only: output container families served honestly on the STREAMING TTS WebSocket, as measured by live format discovery. Unlike the synchronous `formats` contract there is no router-side WAV wrap on the WebSocket path, so `wav` appears only when the provider streams RIFF bytes natively. Absent on non-streaming TTS models and on STT models."
        instructions:
          allOf:
            - $ref: "#/components/schemas/TtsInstructionsSupport"
            - description: "TTS models only: what this binding does with an `instructions` parameter. Absent on STT models."
        streamingInput:
          allOf:
            - $ref: "#/components/schemas/StreamingSttInputCapabilities"
            - description: STT streaming input portability metadata; absent on TTS/non-streaming models.
      required:
        - id
        - canonical
        - aliases
      description: One model available from this provider.
    VoiceCatalogueResponse:
      type: object
      properties:
        voices:
          type: array
          items:
            $ref: "#/components/schemas/VoiceCatalogueEntry"
        facets:
          type: array
          items:
            $ref: "#/components/schemas/VoiceCatalogueFacet"
        total_count:
          type: integer
          minimum: 0
        has_more:
          type: boolean
        next_cursor:
          type:
            - string
            - "null"
        catalogue_updated_at:
          type: string
          format: date-time
      required:
        - voices
        - total_count
        - has_more
        - next_cursor
        - catalogue_updated_at
    VoiceCatalogueEntry:
      type: object
      properties:
        model:
          $ref: "#/components/schemas/VoiceCatalogueValue"
        voice:
          $ref: "#/components/schemas/VoiceCatalogueVoice"
        providers:
          type: array
          items:
            $ref: "#/components/schemas/VoiceCatalogueProvider"
      required:
        - model
        - voice
        - providers
    VoiceCatalogueValue:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
      required:
        - id
        - name
    VoiceCatalogueVoice:
      type: object
      properties:
        id:
          type: string
          description: Exact voice value accepted by the provider.
        name:
          type: string
        description:
          type:
            - string
            - "null"
        category:
          allOf:
            - $ref: "#/components/schemas/VoiceCatalogueValue"
            - type:
                - object
                - "null"
        preview_url:
          type:
            - string
            - "null"
          format: uri
        languages:
          type: array
          items:
            $ref: "#/components/schemas/VoiceCatalogueLanguage"
        labels:
          type: array
          items:
            $ref: "#/components/schemas/VoiceCatalogueLabel"
        source_urls:
          type: array
          items:
            type: string
            format: uri
        scope:
          type: object
          properties:
            type:
              type: string
              enum:
                - global
          required:
            - type
        first_seen_at:
          type: string
          format: date-time
        last_seen_at:
          type: string
          format: date-time
      required:
        - id
        - name
        - description
        - category
        - preview_url
        - languages
        - labels
        - source_urls
        - scope
        - first_seen_at
        - last_seen_at
    VoiceCatalogueLanguage:
      allOf:
        - $ref: "#/components/schemas/VoiceCatalogueValue"
        - type: object
          properties:
            locale:
              type: string
            accent:
              type: string
    VoiceCatalogueLabel:
      type: object
      properties:
        facet:
          $ref: "#/components/schemas/VoiceCatalogueValue"
        value:
          $ref: "#/components/schemas/VoiceCatalogueValue"
      required:
        - facet
        - value
    VoiceCatalogueProvider:
      allOf:
        - $ref: "#/components/schemas/VoiceCatalogueValue"
        - type: object
          properties:
            default:
              type: boolean
            provider_model_id:
              type: string
            metrics:
              $ref: "#/components/schemas/VoiceCatalogueProviderMetrics"
          required:
            - default
            - provider_model_id
            - metrics
    VoiceCatalogueProviderMetrics:
      type:
        - object
        - "null"
      properties:
        popularity_score:
          type: integer
          minimum: 0
        likes:
          type: integer
          minimum: 0
        saves:
          type: integer
          minimum: 0
        shares:
          type: integer
          minimum: 0
        uses:
          type: integer
          minimum: 0
        characters_7d:
          type: integer
          minimum: 0
        characters_1y:
          type: integer
          minimum: 0
        clones:
          type: integer
          minimum: 0
      required:
        - popularity_score
    VoiceCatalogueFacet:
      allOf:
        - $ref: "#/components/schemas/VoiceCatalogueValue"
        - type: object
          properties:
            values:
              type: array
              items:
                allOf:
                  - $ref: "#/components/schemas/VoiceCatalogueValue"
                  - type: object
                    properties:
                      count:
                        type: integer
                        minimum: 0
                    required:
                      - count
          required:
            - values
    NativeError:
      type: object
      properties:
        error:
          type: string
          description: Machine-readable error code.
        provider:
          type: string
          description: Present on invalid_model errors.
        model:
          type: string
          description: Present on invalid_model errors.
        supported:
          type: array
          items:
            type: string
          description: Supported model ids, present on invalid_model errors.
        tried:
          type: array
          items:
            type: string
          description: Providers considered for the request.
      required:
        - error
      description: Error response used by native endpoints.
      example:
        error: not_found
    AgentSignupAccepted:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
          description: Whether the request was accepted.
        expiresIn:
          type: number
          enum:
            - 300
          description: Seconds available to submit the verification code.
      required:
        - success
        - expiresIn
    AccountError:
      type: object
      properties:
        error:
          type: string
          enum:
            - invalid_request
            - invalid_or_expired_code
            - too_many_attempts
            - rate_limited
            - email_delivery_failed
            - account_service_unavailable
            - agent_signup_failed
            - missing_api_key
            - invalid_api_key
            - tenant_disabled
            - topup_not_allowed
            - idempotency_conflict
            - checkout_unavailable
            - topup_link_failed
            - account_read_failed
          description: Machine-readable error code.
      required:
        - error
    AgentSignupStart:
      type: object
      properties:
        email:
          type: string
          maxLength: 254
          format: email
          description: Email address to verify for the AllModels account.
          example: user@example.com
      required:
        - email
      additionalProperties: false
    AgentSignupVerified:
      type: object
      properties:
        apiKey:
          type: string
          minLength: 1
          description: AllModels API key. Store it securely and use it to authenticate future requests.
      required:
        - apiKey
    AgentSignupVerify:
      type: object
      properties:
        email:
          type: string
          maxLength: 254
          format: email
          description: Email address to verify for the AllModels account.
          example: user@example.com
        code:
          type: string
          pattern: ^\d{6}$
          description: Six-digit verification code sent to the email address.
          example: "123456"
      required:
        - email
        - code
      additionalProperties: false
    SdkError:
      type: object
      properties:
        detail:
          type: object
          properties:
            message:
              type: string
              description: Human-readable failure description.
            status:
              type: string
              description: Machine-readable error code.
          required:
            - message
            - status
          additionalProperties: {}
          description: Error detail; extra context keys vary by error.
      required:
        - detail
      description: ElevenLabs-compatible error response.
    AccountTopUpLinkResponse:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: Secure payment URL. Open it in a browser or send it to the person funding the account.
        amount_usd:
          type: number
          minimum: 5
          maximum: 1000
          description: Amount to add to the account balance, in USD. Use between $5 and $1,000 with up to two decimal places.
          example: 50
        expires_at:
          type: string
          format: date-time
          description: Date and time when the payment link expires.
      required:
        - url
        - amount_usd
        - expires_at
    AccountTopUpLinkRequest:
      type: object
      properties:
        amount_usd:
          type: number
          minimum: 5
          maximum: 1000
          description: Amount to add to the account balance, in USD. Use between $5 and $1,000 with up to two decimal places.
          example: 50
      required:
        - amount_usd
      additionalProperties: false
    AccountBalanceResponse:
      type: object
      properties:
        state:
          type: string
          enum:
            - ok
            - exhausted
          description: "`ok` when paid credits or an active promotional grant are available; `exhausted` otherwise."
        paid_credits:
          type: integer
          description: Recorded paid balance in credits. It can be negative after usage; use `spendable_paid_credits` for available paid funds. For monthly-billed accounts it never goes below zero — the amount owed is reported in `outstanding_credits` instead.
          example: 1250000
        spendable_paid_credits:
          type: integer
          minimum: 0
          description: Paid credits currently available for any supported API request. Never less than zero. Monthly-billed accounts spend against their invoice allowance instead, so this figure can be 0 while requests are still accepted.
          example: 1250000
        promotional_credits:
          type: integer
          minimum: 0
          description: Total unspent promotional credits across the grants shown below. Check each grant's eligibility, expiry, and targets before using it.
          example: 1250000
        paid_balance_usd:
          type: number
          description: USD equivalent of `paid_credits`.
          example: 1.25
        updated_at:
          type: string
          format: date-time
          description: When this balance snapshot was last updated. Recent charges may take a short time to appear.
        promotion_grants:
          type: array
          items:
            $ref: "#/components/schemas/AccountPromotionGrant"
          description: Promotional credit grants associated with the account.
        billing_mode:
          type: string
          enum:
            - monthly
          description: Present only for monthly-billed accounts, which settle usage by invoice instead of prepaid top-ups.
        outstanding_credits:
          type: integer
          minimum: 0
          description: Usage accrued against the monthly billing allowance, in credits. The next monthly invoice charges this amount. Present only for monthly-billed accounts.
          example: 1250000
        outstanding_usd:
          type: number
          minimum: 0
          description: USD equivalent of `outstanding_credits`. Present only for monthly-billed accounts.
          example: 1.25
      required:
        - state
        - paid_credits
        - spendable_paid_credits
        - promotional_credits
        - paid_balance_usd
        - updated_at
        - promotion_grants
    AccountPromotionGrant:
      type: object
      properties:
        name:
          type: string
          description: Display name for the promotional credit grant.
        remaining_credits:
          type: integer
          minimum: 0
          description: Unspent credits remaining in this grant. One credit equals $0.000001.
          example: 1250000
        remaining_usd:
          type: number
          minimum: 0
          description: USD equivalent of `remaining_credits`.
          example: 1.25
        expires_at:
          type:
            - string
            - "null"
          format: date-time
          description: When the grant expires, or `null` if it does not expire.
        eligible:
          type: boolean
          description: Whether this account currently satisfies the grant's eligibility requirements.
        targets:
          type: array
          items:
            type: object
            properties:
              provider:
                type: string
                description: Provider that can use this grant.
              model:
                type: string
                description: Model that can use this grant. `*` means every model from the listed provider.
            required:
              - provider
              - model
          description: Provider and model combinations that can use this grant.
      required:
        - name
        - remaining_credits
        - remaining_usd
        - expires_at
        - eligible
        - targets
    AccountUsageResponse:
      type: object
      properties:
        from:
          type: string
          format: date-time
        to:
          type: string
          format: date-time
        totals:
          type: object
          properties:
            request_count:
              type: integer
              minimum: 0
            credits:
              type: integer
              minimum: 0
              description: Platform credits. One credit equals $0.000001.
              example: 1250000
            cost_usd:
              type: number
              minimum: 0
              description: USD value derived from platform credits.
              example: 1.25
            usage:
              type: array
              items:
                type: object
                properties:
                  unit:
                    type: string
                    enum:
                      - characters
                      - audio_seconds
                      - bytes
                  amount:
                    type: number
                    minimum: 0
                required:
                  - unit
                  - amount
          required:
            - request_count
            - credits
            - cost_usd
            - usage
        points:
          type: array
          items:
            $ref: "#/components/schemas/AccountUsagePoint"
      required:
        - from
        - to
        - totals
        - points
    AccountUsagePoint:
      type: object
      properties:
        date:
          type: string
          format: date
        provider:
          type: string
        model:
          type: string
        capability:
          type: string
          enum:
            - tts
            - stt
        usage_unit:
          type: string
          enum:
            - characters
            - audio_seconds
            - bytes
        usage_amount:
          type: number
          minimum: 0
        request_count:
          type: integer
          minimum: 0
        credits:
          type: integer
          minimum: 0
          description: Platform credits. One credit equals $0.000001.
          example: 1250000
        cost_usd:
          type: number
          minimum: 0
          description: USD value derived from platform credits.
          example: 1.25
      required:
        - date
        - provider
        - model
        - capability
        - usage_unit
        - usage_amount
        - request_count
        - credits
        - cost_usd
    AccountActivityResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/AccountActivityItem"
        next_cursor:
          type:
            - string
            - "null"
      required:
        - items
        - next_cursor
    AccountActivityItem:
      type: object
      properties:
        id:
          type: string
        started_at:
          type: string
          format: date-time
        finished_at:
          type: string
          format: date-time
        latency_ms:
          type: integer
          minimum: 0
        provider:
          type: string
        model:
          type: string
        capability:
          type: string
          enum:
            - tts
            - stt
        status:
          type: string
          enum:
            - completed
            - failed
        usage_unit:
          type: string
          enum:
            - characters
            - audio_seconds
            - bytes
        usage_amount:
          type: number
          minimum: 0
        credits:
          type:
            - integer
            - "null"
          minimum: 0
          description: Platform credits. One credit equals $0.000001.
          example: 1250000
        cost_usd:
          type:
            - number
            - "null"
          minimum: 0
          description: USD value derived from platform credits.
          example: 1.25
      required:
        - id
        - started_at
        - finished_at
        - latency_ms
        - provider
        - model
        - capability
        - status
        - usage_unit
        - usage_amount
        - credits
        - cost_usd
    AccountTransactionsResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: "#/components/schemas/AccountTransaction"
        next_cursor:
          type:
            - string
            - "null"
      required:
        - items
        - next_cursor
    AccountTransaction:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - top_up
            - adjustment
            - refund
            - grant
            - expiration
        amount_credits:
          type: integer
          description: Platform credits. One credit equals $0.000001.
          example: 1250000
        amount_usd:
          type: number
          description: USD value derived from platform credits.
          example: 1.25
        balance_after_credits:
          type: integer
          description: Platform credits. One credit equals $0.000001.
          example: 1250000
        balance_after_usd:
          type: number
          description: USD value derived from platform credits.
          example: 1.25
        created_at:
          type: string
          format: date-time
      required:
        - id
        - type
        - amount_credits
        - amount_usd
        - balance_after_credits
        - balance_after_usd
        - created_at
    NativeSttInputError:
      type: object
      properties:
        error:
          type: string
          description: "Machine-readable error code: `missing_audio_format`, `invalid_stt_input`, `unsupported_stt_option`, `unsupported_audio_format`, `conflicting_audio_format`, `unknown_stt_parameter`, `invalid_event_format`, `invalid_model`, or `invalid_stt_request`."
        message:
          type: string
          description: Human-readable explanation. Absent on `invalid_model` and `invalid_stt_request`.
        parameter:
          type: string
          description: The single rejected portable parameter, when the failure is attributable to one.
        parameters:
          type: array
          items:
            type: string
          description: Rejected unknown bare query keys, present on `unknown_stt_parameter`.
        provider:
          type: string
          description: Selected provider, when routing already resolved.
        model:
          type: string
          description: Selected model, when routing already resolved.
        supported:
          description: "Accepted values for the rejected parameter: audio formats, portable option names, channel counts, commit strategies, turn detectors, or event formats."
      required:
        - error
      description: Pre-upgrade validation error returned by `GET /v1/stt`.
    SdkValidationErrorBody:
      type: object
      properties:
        detail:
          type: object
          properties:
            loc:
              type: array
              items:
                type: string
            msg:
              type: string
            type:
              type: string
          required:
            - loc
            - msg
            - type
      required:
        - detail
      description: ElevenLabs-compatible validation error.
    SdkTtsBody:
      type: object
      properties:
        text:
          type: string
          minLength: 1
          maxLength: 2000
          description: Text to synthesize. Texts over 2000 characters are rejected with 413.
        model_id:
          type: string
          description: "Model id: bare name or `{author}/{modelName}` slug (e.g. `grok/grok-tts`). Non-string values are ignored."
        provider:
          anyOf:
            - $ref: "#/components/schemas/ProviderPreferences"
          description: OpenRouter-style provider preferences. Non-object values are ignored.
        voice_settings:
          anyOf:
            - $ref: "#/components/schemas/VoiceSettings"
          description: Voice settings supported by the selected provider.
        generation_config:
          type: object
          description: ElevenLabs-only generation tuning; ignored by other providers.
        provider_options:
          anyOf:
            - $ref: "#/components/schemas/DeepgramTtsOptions"
            - $ref: "#/components/schemas/ElevenLabsTtsOptions"
            - $ref: "#/components/schemas/SonioxTtsOptions"
            - $ref: "#/components/schemas/FishTtsOptions"
            - $ref: "#/components/schemas/GroqTtsOptions"
            - $ref: "#/components/schemas/GrokTtsOptions"
            - $ref: "#/components/schemas/MinimaxTtsOptions"
            - $ref: "#/components/schemas/CartesiaTtsOptions"
            - $ref: "#/components/schemas/TogetherTtsOptions"
            - $ref: "#/components/schemas/OpenaiTtsOptions"
            - $ref: "#/components/schemas/GeminiTtsOptions"
            - $ref: "#/components/schemas/FalTtsOptions"
          description: Provider-specific options. See the provider schemas for supported fields.
      required:
        - text
      additionalProperties: {}
      description: Text-to-speech request body.
    SdkSttFileResponse:
      type: object
      properties:
        language_code:
          type: string
          description: Detected or requested language code; empty string when unknown.
        language_probability:
          type: number
          description: Confidence of the language detection, when the provider reports one.
        text:
          type: string
          description: The full transcript.
        words:
          type: array
          items:
            $ref: "#/components/schemas/SdkSttWord"
          description: Word-level entries; may be empty when the provider reports no word timing.
      required:
        - language_code
        - text
        - words
      description: ElevenLabs-compatible transcription result.
    SdkSttWord:
      type: object
      properties:
        text:
          type: string
          description: The transcribed token text.
        start:
          type: number
          description: Token start, in seconds.
        end:
          type: number
          description: Token end, in seconds.
        type:
          type: string
          enum:
            - word
            - spacing
            - audio_event
          description: Token kind.
        speaker_id:
          type: string
          description: Speaker label, when diarization is enabled.
        logprob:
          type: number
          description: Token log probability, when the provider reports one.
        characters:
          type: array
          items:
            type: object
            properties:
              text:
                type: string
              start:
                type: number
              end:
                type: number
            required:
              - text
              - start
              - end
          description: Per-character timestamps, when the provider exposes them.
      required:
        - text
        - start
        - end
        - type
      description: ElevenLabs-compatible word entry in a file transcription result.
    SdkSttFileBody:
      type: object
      properties:
        file:
          type: string
          format: binary
          description: "Audio file to transcribe. Supported formats: WAV, MP3, FLAC, MP4/M4A, OGG, and WebM."
        model_id:
          type: string
          description: "Model id: bare name or `{author}/{modelName}` slug (e.g. `elevenlabs/scribe_v2`)."
        language_code:
          type: string
          description: Expected language.
        timestamps_granularity:
          type: string
          enum:
            - none
            - word
            - character
          default: word
          description: Timestamp detail to include in the response.
        diarize:
          type: string
          description: Set to `true` or `1` to enable speaker diarization.
        provider:
          type: string
          description: Provider preferences as a JSON string.
        provider_options:
          type: string
          description: Provider-specific options as a JSON string.
      required:
        - file
      additionalProperties: {}
      description: Audio file and transcription options.
    SdkVoicesGetAllResponse:
      type: object
      properties:
        voices:
          type: array
          items:
            $ref: "#/components/schemas/SdkVoice"
          description: The selectable voices.
      required:
        - voices
    SdkVoice:
      type: object
      properties:
        voice_id:
          type: string
          description: Voice ID to use in the `{voice_id}` TTS path parameter.
        name:
          type: string
          description: Display name; falls back to the voice id when the provider reports none.
        labels:
          type: object
          additionalProperties:
            type: string
          description: Voice metadata labels (`gender`, `language`) when the provider reports them; `{}` otherwise.
        category:
          type: string
          enum:
            - premade
          description: Voice category. AllModels returns `premade` for listed provider voices.
        available_for_tiers:
          type: array
          items:
            type: string
          description: Always empty.
        high_quality_base_model_ids:
          type: array
          items:
            type: string
          description: Always empty.
      required:
        - voice_id
        - name
        - labels
        - category
        - available_for_tiers
        - high_quality_base_model_ids
      description: An ElevenLabs-compatible voice object.
    SdkVoicesSearchResponse:
      type: object
      properties:
        voices:
          type: array
          items:
            $ref: "#/components/schemas/SdkVoice"
          description: The selectable voices (one page).
        has_more:
          type: boolean
          enum:
            - false
          description: Always false — the listing is a single page.
        next_page_token:
          type: "null"
          description: Always null — no cursor pagination.
        total_count:
          type: integer
          description: Total voices before `page_size` truncation.
      required:
        - voices
        - has_more
        - next_page_token
        - total_count
    OpenAiError:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            param:
              type:
                - string
                - "null"
            code:
              type:
                - string
                - "null"
          required:
            - message
            - type
      required:
        - error
      description: OpenAI-compatible error response.
    OpenAiSpeechBody:
      type: object
      properties:
        input:
          type: string
          minLength: 1
          maxLength: 4096
          description: Text to synthesize.
        model:
          type: string
          minLength: 1
          description: Model id, optionally provider-prefixed.
        voice:
          anyOf:
            - type: string
              minLength: 1
            - type: object
              properties:
                id:
                  type: string
                  minLength: 1
              required:
                - id
          description: Voice id string or custom voice object with id.
        instructions:
          type: string
          maxLength: 4096
          description: Free-form delivery instructions (tone, accent, pacing, character). Forwarded natively where the selected binding has a dedicated instruction field, and otherwise rendered into the mechanism that binding documents; the per-binding `instructions` capability published on `/v1/models` says which. A binding that cannot honor the parameter is never served a silently downgraded rendition — the request returns 422 `unsupported_parameter` instead. Maximum 4096 characters.
        response_format:
          type: string
          description: "Output format: one of `mp3`, `opus`, `aac`, `flac`, `wav`, `pcm` (case-insensitive). Formats the selected provider cannot emit natively are served by transcoding its best native stream (audio responses only, not `stream_format=sse`); combinations that cannot be transcoded return `invalid_response_format`."
        speed:
          type: number
          description: Playback speed, where supported.
        stream_format:
          type: string
          enum:
            - audio
            - sse
        provider:
          description: Provider preferences.
        provider_options:
          anyOf:
            - $ref: "#/components/schemas/DeepgramTtsOptions"
            - $ref: "#/components/schemas/ElevenLabsTtsOptions"
            - $ref: "#/components/schemas/SonioxTtsOptions"
            - $ref: "#/components/schemas/FishTtsOptions"
            - $ref: "#/components/schemas/GroqTtsOptions"
            - $ref: "#/components/schemas/GrokTtsOptions"
            - $ref: "#/components/schemas/MinimaxTtsOptions"
            - $ref: "#/components/schemas/CartesiaTtsOptions"
            - $ref: "#/components/schemas/TogetherTtsOptions"
            - $ref: "#/components/schemas/OpenaiTtsOptions"
            - $ref: "#/components/schemas/GeminiTtsOptions"
            - $ref: "#/components/schemas/FalTtsOptions"
      required:
        - input
        - model
        - voice
      additionalProperties: {}
    OpenAiTimestampWord:
      type: object
      properties:
        word:
          type: string
          description: The transcribed word text.
        start:
          type: number
          description: Word start, in seconds.
        end:
          type: number
          description: Word end, in seconds.
      required:
        - word
        - start
        - end
      description: OpenAI verbose-JSON word timestamp entry.
    OpenAiTimestampSegment:
      type: object
      properties:
        id:
          anyOf:
            - type: integer
            - type: string
        seek:
          type: integer
        start:
          type: number
          description: Segment start, in seconds.
        end:
          type: number
          description: Segment end, in seconds.
        text:
          type: string
          description: The segment transcript.
        tokens:
          type: array
          items:
            type: integer
        temperature:
          type: number
        avg_logprob:
          type: number
        compression_ratio:
          type: number
        no_speech_prob:
          type: number
        type:
          type: string
        speaker:
          type: string
          description: Speaker label, when diarization is enabled.
      required:
        - text
      description: OpenAI verbose-JSON segment timestamp entry.
    OpenAiTranscriptionBody:
      type: object
      properties:
        file:
          type: string
          format: binary
        model:
          type: string
          minLength: 1
          description: Model id, optionally provider-prefixed.
        language:
          type: string
        prompt:
          type: string
        response_format:
          type: string
          enum:
            - json
            - text
            - srt
            - vtt
            - verbose_json
            - diarized_json
        stream:
          type: boolean
        temperature:
          type: number
        timestamp_granularities:
          type: array
          items:
            type: string
            enum:
              - word
              - segment
        chunking_strategy:
          description: Provider-supported chunking configuration.
        include:
          type: array
          items:
            type: string
        known_speaker_names:
          type: array
          items:
            type: string
        known_speaker_references:
          type: array
          items:
            type: string
        provider:
          description: Provider preferences.
        provider_options:
          anyOf:
            - $ref: "#/components/schemas/DeepgramSttOptions"
            - $ref: "#/components/schemas/ElevenLabsSttOptions"
            - $ref: "#/components/schemas/SonioxSttOptions"
            - $ref: "#/components/schemas/AssemblyaiSttOptions"
            - $ref: "#/components/schemas/GroqSttOptions"
            - $ref: "#/components/schemas/GrokSttOptions"
            - $ref: "#/components/schemas/CartesiaSttOptions"
            - $ref: "#/components/schemas/OpenaiSttOptions"
            - $ref: "#/components/schemas/GeminiSttOptions"
            - $ref: "#/components/schemas/QwenSttOptions"
      required:
        - model
      additionalProperties: {}
    SpeechEngine:
      type: object
      properties:
        speech_engine_id:
          type: string
        name:
          type: string
        speech_engine:
          type: object
          properties:
            ws_url:
              type: string
            request_headers:
              type: object
              additionalProperties:
                type: string
          required:
            - ws_url
            - request_headers
        allmodels:
          type: object
          properties:
            stt:
              type: object
              properties:
                model_id:
                  type: string
                  description: AllModels model slug.
                provider:
                  type: string
                  description: Optional provider pin.
                provider_options:
                  type: object
                  additionalProperties: {}
                  description: Provider-specific options applied when a conversation starts.
                input:
                  type: object
                  additionalProperties: {}
                  description: Portable streaming input options. On a TTS selection this accepts `instructions`, a free-form delivery direction of at most 4096 characters. A profile that carries one is routed only to bindings that honor delivery instructions; when none does, issuing a conversation grant fails with `instructions_not_supported` rather than synthesizing speech that ignores it.
              required:
                - model_id
            tts:
              type: object
              properties:
                model_id:
                  type: string
                  description: AllModels model slug.
                provider:
                  type: string
                  description: Optional provider pin.
                provider_options:
                  type: object
                  additionalProperties: {}
                  description: Provider-specific options applied when a conversation starts.
                input:
                  type: object
                  additionalProperties: {}
                  description: Portable streaming input options. On a TTS selection this accepts `instructions`, a free-form delivery direction of at most 4096 characters. A profile that carries one is routed only to bindings that honor delivery instructions; when none does, issuing a conversation grant fails with `instructions_not_supported` rather than synthesizing speech that ignores it.
              required:
                - model_id
          required:
            - stt
            - tts
      required:
        - speech_engine_id
        - name
        - speech_engine
        - allmodels
      additionalProperties: {}
    SpeechEngineRequest:
      type: object
      properties:
        name:
          type: string
          description: Developer-facing Speech Engine name.
        speech_engine:
          type: object
          properties:
            ws_url:
              type: string
              format: uri
              description: Your application's secure WebSocket endpoint.
            request_headers:
              type: object
              additionalProperties: {}
              description: Headers included when connecting to your application.
          required:
            - ws_url
        asr:
          type: object
          properties:
            quality:
              type: string
            provider:
              type: string
              description: ElevenLabs ASR provider setting. Use the `stt` query extension for other providers.
            user_input_audio_format:
              type: string
            keywords:
              type: array
              items:
                type: string
          additionalProperties: {}
        tts:
          type: object
          properties:
            model_id:
              type: string
              description: ElevenLabs TTS model. Use the `tts.model` query extension for non-ElevenLabs models.
            voice_id:
              type: string
            supported_voices:
              type: array
              items:
                type: object
                additionalProperties: {}
            expressive_mode:
              type: boolean
            suggested_audio_tags:
              type: array
              items:
                type: object
                additionalProperties: {}
            agent_output_audio_format:
              type: string
            optimize_streaming_latency:
              type: number
              description: Deprecated ElevenLabs no-op retained for SDK compatibility.
            stability:
              type: number
            speed:
              type: number
            similarity_boost:
              type: number
            text_normalisation_type:
              type: string
              enum:
                - system_prompt
                - elevenlabs
            pronunciation_dictionary_locators:
              type: array
              items:
                type: object
                additionalProperties: {}
            enable_phoneme_tags:
              type: boolean
          additionalProperties: {}
        turn:
          type: object
          additionalProperties: {}
        conversation:
          type: object
          additionalProperties: {}
        privacy:
          type: object
          additionalProperties: {}
        call_limits:
          type: object
          additionalProperties: {}
        language:
          type: string
        tags:
          type: array
          items:
            type: string
        overrides:
          type: object
          additionalProperties: {}
        allmodels:
          type: object
          properties:
            lifecycle:
              type: object
              properties:
                mode:
                  type: string
                  enum:
                    - permanent
                    - ephemeral
                expires_in_seconds:
                  type: integer
                  minimum: 60
                  maximum: 3600
                  description: Lifetime of an ephemeral Speech Engine.
              required:
                - mode
      additionalProperties: {}
      description: ElevenLabs-compatible Speech Engine configuration. Use standard ASR and TTS fields first. Use the `stt` and `tts` query extensions only to select non-ElevenLabs models or pass settings that have no standard Speech Engine field.
    RealtimeProfile:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
          enum:
            - realtime.profile
        type:
          type: string
          enum:
            - pipeline
        name:
          type: string
        pipeline:
          type: object
          additionalProperties: {}
        revision:
          type: integer
      required:
        - id
        - object
        - type
        - name
        - pipeline
        - revision
      additionalProperties: {}
    RealtimeProfileRequest:
      type: object
      properties:
        name:
          type: string
          description: Developer-facing profile name.
        type:
          type: string
          enum:
            - pipeline
          default: pipeline
        pipeline:
          type: object
          properties:
            stt:
              type: object
              properties:
                model:
                  type: string
                  description: AllModels model slug, such as deepgram/nova-3.
                provider:
                  type: string
                  description: Pin this part of the pipeline to one provider.
                provider_preferences:
                  type: object
                  properties:
                    order:
                      type: array
                      items:
                        type: string
                      description: Providers to try first, in order.
                    only:
                      type: array
                      items:
                        type: string
                      description: Restrict selection to these providers.
                    ignore:
                      type: array
                      items:
                        type: string
                      description: Exclude these providers.
                    allow_fallbacks:
                      type: boolean
                      description: Allow another eligible provider when needed.
                provider_options:
                  type: object
                  additionalProperties: {}
                  description: Provider-specific options passed when the session starts.
              required:
                - model
              additionalProperties: {}
            tts:
              type: object
              properties:
                model:
                  type: string
                  description: AllModels model slug, such as deepgram/nova-3.
                provider:
                  type: string
                  description: Pin this part of the pipeline to one provider.
                provider_preferences:
                  type: object
                  properties:
                    order:
                      type: array
                      items:
                        type: string
                      description: Providers to try first, in order.
                    only:
                      type: array
                      items:
                        type: string
                      description: Restrict selection to these providers.
                    ignore:
                      type: array
                      items:
                        type: string
                      description: Exclude these providers.
                    allow_fallbacks:
                      type: boolean
                      description: Allow another eligible provider when needed.
                provider_options:
                  type: object
                  additionalProperties: {}
                  description: Provider-specific options passed when the session starts.
              required:
                - model
              additionalProperties: {}
            upstream:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  description: Your application's secure WebSocket endpoint for transcripts and response text.
                headers:
                  type: object
                  additionalProperties:
                    type: string
                  description: Headers AllModels includes when connecting to your application.
                context_mode:
                  type: string
                  enum:
                    - full
                    - incremental
                  description: Send the complete conversation history or only the newest transcript.
                interim_transcripts:
                  type: boolean
                  description: Forward interim transcripts to your application when available.
              required:
                - url
              additionalProperties: {}
          required:
            - stt
            - tts
            - upstream
        conversation:
          type: object
          additionalProperties: {}
        client:
          type: object
          additionalProperties: {}
        limits:
          type: object
          additionalProperties: {}
        lifecycle:
          type: object
          properties:
            mode:
              type: string
              enum:
                - permanent
                - ephemeral
            expires_in_seconds:
              type: integer
              minimum: 60
              maximum: 86400
              description: Lifetime of an ephemeral profile.
          required:
            - mode
        tags:
          type: array
          items:
            type: string
      required:
        - name
        - pipeline
      additionalProperties: {}
    RealtimeProfilePatch:
      type: object
      properties:
        name:
          type: string
          description: Developer-facing profile name.
        type:
          type: string
          enum:
            - pipeline
          default: pipeline
        pipeline:
          type: object
          properties:
            stt:
              type: object
              properties:
                model:
                  type: string
                  description: AllModels model slug, such as deepgram/nova-3.
                provider:
                  type: string
                  description: Pin this part of the pipeline to one provider.
                provider_preferences:
                  type: object
                  properties:
                    order:
                      type: array
                      items:
                        type: string
                      description: Providers to try first, in order.
                    only:
                      type: array
                      items:
                        type: string
                      description: Restrict selection to these providers.
                    ignore:
                      type: array
                      items:
                        type: string
                      description: Exclude these providers.
                    allow_fallbacks:
                      type: boolean
                      description: Allow another eligible provider when needed.
                provider_options:
                  type: object
                  additionalProperties: {}
                  description: Provider-specific options passed when the session starts.
              additionalProperties: {}
            tts:
              type: object
              properties:
                model:
                  type: string
                  description: AllModels model slug, such as deepgram/nova-3.
                provider:
                  type: string
                  description: Pin this part of the pipeline to one provider.
                provider_preferences:
                  type: object
                  properties:
                    order:
                      type: array
                      items:
                        type: string
                      description: Providers to try first, in order.
                    only:
                      type: array
                      items:
                        type: string
                      description: Restrict selection to these providers.
                    ignore:
                      type: array
                      items:
                        type: string
                      description: Exclude these providers.
                    allow_fallbacks:
                      type: boolean
                      description: Allow another eligible provider when needed.
                provider_options:
                  type: object
                  additionalProperties: {}
                  description: Provider-specific options passed when the session starts.
              additionalProperties: {}
            upstream:
              type: object
              properties:
                url:
                  type: string
                  format: uri
                  description: Your application's secure WebSocket endpoint for transcripts and response text.
                headers:
                  type: object
                  additionalProperties:
                    type: string
                  description: Headers AllModels includes when connecting to your application.
                context_mode:
                  type: string
                  enum:
                    - full
                    - incremental
                  description: Send the complete conversation history or only the newest transcript.
                interim_transcripts:
                  type: boolean
                  description: Forward interim transcripts to your application when available.
              additionalProperties: {}
        conversation:
          type: object
          additionalProperties: {}
        client:
          type: object
          additionalProperties: {}
        limits:
          type: object
          additionalProperties: {}
        lifecycle:
          type: object
          properties:
            mode:
              type: string
              enum:
                - permanent
                - ephemeral
            expires_in_seconds:
              type: integer
              minimum: 60
              maximum: 86400
              description: Lifetime of an ephemeral profile.
        tags:
          type: array
          items:
            type: string
      additionalProperties: {}
  parameters: {}
paths:
  /health:
    get:
      tags:
        - Health
      summary: Liveness probe
      operationId: healthCheck
      description: 'Returns `{ "ok": true }` and the deployed Git commit when the API is available. The commit is null when it was not injected at deployment. No authentication required.'
      security: []
      responses:
        "200":
          description: API is available.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Health"
              example:
                ok: true
                commit: 0123456789abcdef0123456789abcdef01234567
  /v1/models:
    get:
      tags:
        - Models
      summary: List models
      operationId: listModels
      security: []
      description: Lists the TTS and STT models available through AllModels. Each model includes accepted aliases, supported providers, and whether it can be used for streaming or synchronous requests (with an orthogonal `batch` flag for STT providers that queue internally).
      responses:
        "200":
          description: Available TTS and STT models.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ModelsResponse"
              example:
                tts:
                  - id: elevenlabs/eleven-turbo-v2-5
                    aliases:
                      - elevenlabs/eleven_turbo_v2_5
                    providers:
                      - id: elevenlabs
                        modelId: eleven_turbo_v2_5
                        streaming: true
                        synchronous: true
                        instructions:
                          mode: structured
                          honored: false
                        pricing:
                          currency: usd
                          unit: 1000 characters
                          unitPrice: "0.0394359"
                      - id: fal
                        modelId: fal-ai/elevenlabs/tts/turbo-v2.5
                        streaming: false
                        synchronous: true
                        instructions:
                          mode: structured
                          honored: false
                        pricing:
                          currency: usd
                          unit: 1000 characters
                          unitPrice: "0.055"
                stt:
                  - id: openai/whisper-large-v3
                    aliases:
                      - groq/whisper-large-v3
                      - together/openai/whisper-large-v3
                    providers:
                      - id: groq
                        modelId: whisper-large-v3
                        streaming: false
                        synchronous: true
                        batch: false
                        pricing:
                          currency: usd
                          unit: minute
                          unitPrice: "0.00633"
                          requestPrice: "0.001055"
                      - id: together
                        modelId: openai/whisper-large-v3
                        streaming: true
                        synchronous: true
                        batch: false
                      - id: fal
                        modelId: fal-ai/whisper
                        streaming: false
                        synchronous: true
                        batch: false
                  - id: assemblyai/universal-3-5-pro
                    aliases: []
                    providers:
                      - id: assemblyai
                        modelId: universal-3-5-pro
                        streaming: false
                        synchronous: true
                        batch: true
  /v1/providers:
    get:
      tags:
        - Providers
      summary: List providers
      operationId: listProviders
      security: []
      description: Lists available providers, their default models and voices, and the TTS and STT models they support. Use `GET /v1/models` to browse by model instead.
      responses:
        "200":
          description: The provider listing.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProvidersResponse"
              example:
                providers:
                  openai:
                    defaults:
                      tts:
                        model: gpt-4o-mini-tts
                        voice: alloy
                      stt:
                        model: gpt-realtime-whisper
                    tts:
                      - id: gpt-4o-mini-tts
                        canonical: openai/gpt-4o-mini-tts
                        aliases: []
                        streaming: false
                        synchronous: true
                        formats:
                          - mp3
                          - opus
                          - aac
                          - flac
                          - wav
                          - pcm
                        instructions:
                          mode: native
                          honored: true
                        pricing:
                          currency: usd
                          unit: 1000 characters
                          unitPrice: "0.016875"
                    stt:
                      - id: whisper-1
                        canonical: openai/whisper-1
                        aliases: []
                        streaming: false
                        synchronous: true
                        batch: false
                        pricing:
                          currency: usd
                          unit: minute
                          unitPrice: "0.00633"
  /v1/voices:
    get:
      tags:
        - Voices
      summary: Search voices
      operationId: listVoices
      description: Search voices available through AllModels. Filter by model, provider, language, category, or labels, and page through results with a cursor. No API key is required.
      security: []
      parameters:
        - schema:
            type: string
            description: Search voice names and descriptive metadata.
          required: false
          description: Search voice names and descriptive metadata.
          name: q
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: AllModels model ID. Repeat to match any supplied model.
          required: false
          description: AllModels model ID. Repeat to match any supplied model.
          name: model
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: Provider ID. Repeat to match any supplied provider.
          required: false
          description: Provider ID. Repeat to match any supplied provider.
          name: provider
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: Language ID, such as `en`. Repeat to match any supplied language.
          required: false
          description: Language ID, such as `en`. Repeat to match any supplied language.
          name: language
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: Voice category, such as `official` or `community`. Repeat to match any supplied category.
          required: false
          description: Voice category, such as `official` or `community`. Repeat to match any supplied category.
          name: category
          in: query
        - schema:
            anyOf:
              - type: string
              - type: array
                items:
                  type: string
            description: A `facet:value` filter, such as `gender:female`.
          required: false
          description: A `facet:value` filter, such as `gender:female`.
          name: label
          in: query
        - schema:
            type: string
            format: date-time
            description: Return voices added after this RFC 3339 timestamp.
          required: false
          description: Return voices added after this RFC 3339 timestamp.
          name: first_seen_after
          in: query
        - schema:
            type: string
            enum:
              - featured
              - relevance
              - newest
              - popular
              - name
            description: Sort by featured, relevance, newest, popularity, or name. Featured results place official voices before community voices. Relevance requires q.
          required: false
          description: Sort by featured, relevance, newest, popularity, or name. Featured results place official voices before community voices. Relevance requires q.
          name: sort
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
            description: Number of results to return.
          required: false
          description: Number of results to return.
          name: page_size
          in: query
        - schema:
            type: string
            description: "`next_cursor` from the previous response."
          required: false
          description: "`next_cursor` from the previous response."
          name: cursor
          in: query
        - schema:
            type: string
            enum:
              - "true"
              - "false"
            default: "false"
            description: Include available filters and result counts.
          required: false
          description: Include available filters and result counts.
          name: include_facets
          in: query
      responses:
        "200":
          description: A page of matching voices.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VoiceCatalogueResponse"
        "400":
          description: One or more query parameters are invalid.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
        "409":
          description: The voice catalogue changed while paginating. Start again without a cursor.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: catalogue_changed
        "503":
          description: Voice search is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: voice_catalogue_unavailable
  /account/agent-signup:
    post:
      tags:
        - Account
      summary: Email a sign-in code
      operationId: startAgentSignup
      description: Start email-based account access for an agent. Provide the email address whose owner will approve access. AllModels sends that address a six-digit code. Ask the owner for the code, then call `POST /account/agent-signup/verify` with the same email address. No API key is required for this request, and the flow works for both new and existing AllModels accounts.
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AgentSignupStart"
      responses:
        "202":
          description: The verification email was accepted for delivery.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentSignupAccepted"
              example:
                success: true
                expiresIn: 300
        "400":
          description: The request body is missing or contains an invalid email address.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "429":
          description: Please wait before requesting another code, then try again.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "500":
          description: AllModels could not start account access. Try again later.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "503":
          description: The verification email could not be sent right now. Try again later.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
  /account/agent-signup/verify:
    post:
      tags:
        - Account
      summary: Verify the code and receive an API key
      operationId: verifyAgentSignup
      description: "Complete email-based account access by submitting the same email address and the six-digit code from the verification email. A successful response contains an AllModels API key. Save it securely when received because the full key is returned only in this response. Use it as `Authorization: Bearer <apiKey>` for authenticated API requests. If the code cannot be verified, start the flow again to request a new one."
      security: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AgentSignupVerify"
      responses:
        "200":
          description: The email was verified and an API key was returned. Save the key before discarding the response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentSignupVerified"
              example:
                apiKey: sk_live_...
        "400":
          description: The email or code is missing, malformed, incorrect, expired, or already used. Request a new code and try again.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "429":
          description: Please wait before trying another code, then start the flow again.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "500":
          description: AllModels could not complete account access. Try again later.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "503":
          description: Account access is temporarily unavailable. Try again later.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
  /el/v1/convai/conversation:
    get:
      tags:
        - ElevenLabs SDK
      summary: Speech Engine conversation WebSocket
      description: Connect using the signed_url returned by the signed URL endpoint. The client sends microphone audio directly to AllModels and receives transcripts, response text, and synthesized audio.
      operationId: speechEngineConversation
      x-codeSamples:
        - lang: TypeScript
          label: ElevenLabs SDK
          source: |-
            import { Conversation } from "@elevenlabs/client";

            const conversation = await Conversation.startSession({
              signedUrl,
              connectionType: "websocket",
            });

            // End the session when your UI is finished.
            await conversation.endSession();
        - lang: Python
          label: ElevenLabs SDK
          source: |-
            # pip install "elevenlabs[pyaudio]"
            import os
            from elevenlabs.client import ElevenLabs
            from elevenlabs.conversational_ai.conversation import Conversation
            from elevenlabs.conversational_ai.default_audio_interface import DefaultAudioInterface

            client = ElevenLabs(
                api_key=os.environ["ALLMODELS_API_KEY"],
                base_url="https://api.allmodels.io/el",
            )
            conversation = Conversation(
                client=client,
                agent_id="seng_01JZ8H4B1M4YDQ3Z4MXN8D0Q1A",
                requires_auth=True,
                audio_interface=DefaultAudioInterface(),
            )

            conversation.start_session()
            try:
                input("Press Enter to end the conversation...\n")
            finally:
                conversation.end_session()

            print(conversation.wait_for_session_end())
      security: []
      parameters:
        - schema:
            type: string
            description: Opaque credential included in the signed URL.
          required: true
          description: Opaque credential included in the signed URL.
          name: conversation_signature
          in: query
        - schema:
            type: string
            description: Speech Engine id included by ElevenLabs-compatible clients.
          required: false
          description: Speech Engine id included by ElevenLabs-compatible clients.
          name: agent_id
          in: query
        - schema:
            type: string
          required: true
          name: Upgrade
          in: header
      responses:
        "101":
          description: WebSocket connection established. No HTTP response body.
        "401":
          description: Missing or invalid conversation signature.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
        "426":
          description: Request was not a WebSocket upgrade.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: websocket upgrade required
                  status: websocket_upgrade_required
        "503":
          description: The Speech Engine service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
  /v1/realtime:
    get:
      tags:
        - Realtime
      summary: Connect to a Realtime session
      description: Connect with a single-use client_secret, or use profile_id with an Authorization Bearer token. Client audio is accepted as soon as the WebSocket opens.
      operationId: realtimeConnect
      security:
        - RealtimeClientSecret: []
        - BearerAuth: []
      parameters:
        - schema:
            type: string
            description: Single-use credential returned by POST /v1/realtime/client-secrets.
          required: false
          description: Single-use credential returned by POST /v1/realtime/client-secrets.
          name: client_secret
          in: query
        - schema:
            type: string
            description: Realtime profile used with Authorization Bearer authentication.
          required: false
          description: Realtime profile used with Authorization Bearer authentication.
          name: profile_id
          in: query
      responses:
        "101":
          description: WebSocket connection established. No HTTP response body.
        "401":
          description: The Authorization Bearer token is missing or invalid.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: missing_api_key
        "426":
          description: Request was not a WebSocket upgrade.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: websocket_upgrade_required
        "503":
          description: The Realtime service is temporarily unavailable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - type
                      - code
                      - message
                    additionalProperties: {}
                required:
                  - error
  /account/top-up-link:
    post:
      tags:
        - Account
      summary: Create a link to add account balance
      operationId: createAccountTopUpLink
      description: "Create a secure payment link for adding prepaid balance to the account associated with your API key. Authenticate with `Authorization: Bearer <apiKey>` and provide the amount in `amount_usd`. Open the returned `url` in a browser or send it to the person who manages account funding. After payment succeeds, the account balance updates automatically."
      security:
        - BearerAuth: []
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 255
            description: Optional identifier for safely retrying a request after a timeout or network error. Reuse the same value only when `amount_usd` is unchanged.
          required: false
          description: Optional identifier for safely retrying a request after a timeout or network error. Reuse the same value only when `amount_usd` is unchanged.
          name: idempotency-key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AccountTopUpLinkRequest"
      responses:
        "201":
          description: The payment link was created. Use `url` before `expires_at`.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountTopUpLinkResponse"
              example:
                url: https://checkout.stripe.com/c/pay/cs_test_example
                amount_usd: 50
                expires_at: 2026-07-22T12:00:00.000Z
        "400":
          description: "`amount_usd` or `Idempotency-Key` is missing or invalid."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "401":
          description: "Provide a valid AllModels API key using `Authorization: Bearer <apiKey>`."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "403":
          description: This API key is inactive or is not permitted to create account top-up links.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "409":
          description: This `Idempotency-Key` was already used with a different amount. Use a new key or retry the original amount.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "500":
          description: The payment link could not be created. Try again later.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "502":
          description: The payment link could not be created right now. Try again later.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "503":
          description: Account top-ups are temporarily unavailable. Try again later.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
  /account/balance:
    get:
      tags:
        - Account
      summary: Check account balance
      operationId: getAccountBalance
      description: "Use this endpoint to check the paid and promotional credits associated with your API key. Authenticate with `Authorization: Bearer <apiKey>`. Use `spendable_paid_credits` to see the paid balance available for any request; monthly-billed accounts spend against their invoice allowance instead, tracked by `outstanding_credits`. Promotional credits can be limited to the provider and model combinations in `promotion_grants.targets`, so check each grant's `eligible` and `expires_at` values before relying on it. A `state` of `exhausted` means no balance is currently available for requests. One credit equals $0.000001. You can call this endpoint even when the balance is zero."
      responses:
        "200":
          description: Paid and promotional balances for the account associated with the API key.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountBalanceResponse"
              example:
                state: ok
                paid_credits: 1250000
                spendable_paid_credits: 1250000
                promotional_credits: 500000
                paid_balance_usd: 1.25
                updated_at: 2026-07-21T12:00:00Z
                promotion_grants:
                  - name: Welcome credits
                    remaining_credits: 500000
                    remaining_usd: 0.5
                    expires_at: 2026-08-31T23:59:59Z
                    eligible: true
                    targets:
                      - provider: elevenlabs
                        model: elevenlabs/eleven-turbo-v2-5
        "401":
          description: Provide a valid AllModels API key.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "403":
          description: The API key is inactive.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
  /account/usage:
    get:
      tags:
        - Account
      summary: Get API-key usage
      operationId: getAccountUsage
      description: Returns daily usage for the authenticating API key only. Usage events are persisted asynchronously and may take a short time to appear.
      parameters:
        - schema:
            type: string
            format: date-time
            description: Inclusive RFC 3339 start time. Defaults to 30 days before `to`.
          required: false
          description: Inclusive RFC 3339 start time. Defaults to 30 days before `to`.
          name: from
          in: query
        - schema:
            type: string
            format: date-time
            description: Inclusive RFC 3339 end time. Defaults to the current time. The range may not exceed 90 days.
          required: false
          description: Inclusive RFC 3339 end time. Defaults to the current time. The range may not exceed 90 days.
          name: to
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 200
          required: false
          name: provider
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 200
          required: false
          name: model
          in: query
        - schema:
            type: string
            enum:
              - tts
              - stt
          required: false
          name: capability
          in: query
      responses:
        "200":
          description: Aggregate usage and totals.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountUsageResponse"
        "400":
          description: A query parameter is malformed or the requested time range exceeds 90 days.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "401":
          description: Provide a valid AllModels API key.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "403":
          description: The API key is inactive.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "500":
          description: The account data could not be loaded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "503":
          description: Account data is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
  /account/activity:
    get:
      tags:
        - Account
      summary: List API-key activity
      operationId: listAccountActivity
      description: Lists individual requests made with the authenticating API key, newest first. Activity is asynchronously persisted. Treat pagination cursors as opaque.
      parameters:
        - schema:
            type: string
            format: date-time
            description: Inclusive RFC 3339 start time. Defaults to 30 days before `to`.
          required: false
          description: Inclusive RFC 3339 start time. Defaults to 30 days before `to`.
          name: from
          in: query
        - schema:
            type: string
            format: date-time
            description: Inclusive RFC 3339 end time. Defaults to the current time. The range may not exceed 90 days.
          required: false
          description: Inclusive RFC 3339 end time. Defaults to the current time. The range may not exceed 90 days.
          name: to
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 200
          required: false
          name: provider
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 200
          required: false
          name: model
          in: query
        - schema:
            type: string
            enum:
              - tts
              - stt
          required: false
          name: capability
          in: query
        - schema:
            type: string
            enum:
              - completed
              - failed
          required: false
          name: status
          in: query
        - schema:
            type: string
            pattern: ^([1-9]|[1-9]\d|100)$
            description: Number of records to return, from 1 to 100. Defaults to 50.
          required: false
          description: Number of records to return, from 1 to 100. Defaults to 50.
          name: limit
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 512
            description: Opaque cursor returned as `next_cursor` by the previous page.
          required: false
          description: Opaque cursor returned as `next_cursor` by the previous page.
          name: cursor
          in: query
      responses:
        "200":
          description: One page of API request activity.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountActivityResponse"
        "400":
          description: A query parameter is malformed or the requested time range exceeds 90 days.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "401":
          description: Provide a valid AllModels API key.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "403":
          description: The API key is inactive.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "500":
          description: The account data could not be loaded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "503":
          description: Account data is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
  /account/transactions:
    get:
      tags:
        - Account
      summary: List account credit transactions
      operationId: listAccountTransactions
      description: Lists organization-level credit events without payment-provider identifiers, reference IDs, or arbitrary metadata. Per-request usage debits are available from the activity endpoint instead.
      parameters:
        - schema:
            type: string
            pattern: ^([1-9]|[1-9]\d|100)$
            description: Number of records to return, from 1 to 100. Defaults to 50.
          required: false
          description: Number of records to return, from 1 to 100. Defaults to 50.
          name: limit
          in: query
        - schema:
            type: string
            minLength: 1
            maxLength: 512
            description: Opaque cursor returned as `next_cursor` by the previous page.
          required: false
          description: Opaque cursor returned as `next_cursor` by the previous page.
          name: cursor
          in: query
      responses:
        "200":
          description: One page of sanitized credit transactions.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountTransactionsResponse"
        "400":
          description: A query parameter is malformed or the requested time range exceeds 90 days.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "401":
          description: Provide a valid AllModels API key.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "403":
          description: The API key is inactive.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "500":
          description: The account data could not be loaded.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
        "503":
          description: Account data is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountError"
  /v1/tts:
    get:
      tags:
        - Native TTS/STT
      summary: Native streaming TTS (WebSocket)
      operationId: nativeTtsStream
      description: |-
        Opens a WebSocket using the selected provider's text-to-speech protocol.
        The request must include `Upgrade: websocket`.

        After connecting, send provider-specific JSON messages and receive binary
        audio. For example, Grok accepts `{"type":"text","text":"..."}` plus optional
        `{"type":"flush"}` / `{"type":"close"}` frames.

        Use `provider_options` for provider-specific settings. You can also pass
        supported options directly as query parameters. If both forms set the same
        option, `provider_options[<name>]=<value>` takes precedence. Recognized enum
        and boolean option values are case-insensitive and are normalized to each
        provider's wire spelling; free-form values such as prompts, keyterms, and voice
        IDs retain their original case.

        Authentication failures close the connection with code `4401` or `4403`.
        The close reason contains `{ "error": "<code>" }`.

        The message-level protocol is documented at [/docs/realtime](/docs/realtime)
        (AsyncAPI spec: [/asyncapi.yaml](/asyncapi.yaml)).
      parameters:
        - schema:
            $ref: "#/components/schemas/TtsProviderId"
          required: false
          description: Use a specific TTS provider.
          name: provider
          in: query
        - schema:
            type: string
          required: false
          description: Provider voice id (e.g. `eve` for Grok, `EXAVITQu4vr4xnSDxMaL` for ElevenLabs).
          name: voice
          in: query
        - schema:
            type: string
          required: false
          description: "Model id: bare name (`eleven_flash_v2_5`) or `{author}/{modelName}` slug (`elevenlabs/eleven_flash_v2_5`)."
          name: model
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs in preferred order. Providers not listed remain eligible.
          style: form
          explode: false
          name: provider_order
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs. Only these providers may serve the request.
          style: form
          explode: false
          name: provider_only
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs that must not serve the request.
          style: form
          explode: false
          name: provider_ignore
          in: query
        - schema:
            type: boolean
          required: false
          description: Set to `false` to prevent fallback to another provider. Automatic provider retries are not currently supported.
          name: allow_fallbacks
          in: query
        - schema:
            type: string
            enum:
              - mp3
              - pcm
          required: false
          description: Output audio container.
          name: format
          in: query
        - schema:
            type: string
            default: "true"
          required: false
          description: Auto-flush buffered text. Any value except the literal `false` enables it.
          name: auto_flush
          in: query
        - schema:
            type: object
            additionalProperties:
              type: string
            anyOf:
              - $ref: "#/components/schemas/DeepgramTtsOptions"
              - $ref: "#/components/schemas/ElevenLabsTtsOptions"
              - $ref: "#/components/schemas/SonioxTtsOptions"
              - $ref: "#/components/schemas/FishTtsOptions"
              - $ref: "#/components/schemas/GroqTtsOptions"
              - $ref: "#/components/schemas/GrokTtsOptions"
              - $ref: "#/components/schemas/MinimaxTtsOptions"
              - $ref: "#/components/schemas/CartesiaTtsOptions"
              - $ref: "#/components/schemas/TogetherTtsOptions"
              - $ref: "#/components/schemas/OpenaiTtsOptions"
              - $ref: "#/components/schemas/GeminiTtsOptions"
              - $ref: "#/components/schemas/FalTtsOptions"
          required: false
          description: Provider-specific options in bracket notation, such as `provider_options[encoding]=linear16`. You can also pass supported options directly as query parameters. If both forms set the same option, the bracketed value takes precedence.
          style: deepObject
          explode: true
          name: provider_options
          in: query
        - schema:
            type: string
            const: websocket
          required: true
          description: Must be websocket to perform the protocol upgrade.
          name: Upgrade
          in: header
      responses:
        "101":
          description: WebSocket connection established. No HTTP response body.
        "400":
          description: Missing/unknown provider, invalid format, or unsupported model.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              examples:
                invalidRequest:
                  value:
                    error: invalid_tts_request
                invalidModel:
                  value:
                    error: invalid_model
                    provider: grok
                    model: bogus
                    supported:
                      - grok-tts
        "401":
          description: The Authorization Bearer token is missing or invalid.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: missing_api_key
        "403":
          description: The API key cannot use any provider that matches the request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: provider_not_allowed
                tried:
                  - deepgram
                  - soniox
                  - assemblyai
        "422":
          description: The request carries `instructions` no candidate binding honors (see `instructions` on `/v1/models`).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              examples:
                instructionsNotSupported:
                  value:
                    error: instructions_not_supported
                    model: grok-tts
                    tried:
                      - grok
        "426":
          description: Request was not a WebSocket upgrade.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: websocket_upgrade_required
        "500":
          description: Authentication could not be initialized.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: auth_not_initialized
  /v1/stt:
    get:
      tags:
        - Native TTS/STT
      summary: Native streaming STT (WebSocket)
      operationId: nativeSttStream
      description: |-
        Opens a WebSocket and emits normalized streaming speech-to-text events.
        The request must include `Upgrade: websocket`.

        Stream binary audio and use `stt.audio.commit`, `stt.audio.clear`, and
        `stt.session.close` controls. Server events share a sequenced
        `stt.*` envelope. Transcript updates remain separate from a unified
        flat `stt.signal` event whose state is `started`, `end_candidate`,
        `resumed`, or `end`. Optional `turn_scope` preserves utterance-versus-turn
        meaning; it is distinct from transcript-final `scope`. Only signals explicitly
        supplied by the selected provider are surfaced.

        Use `event_format=provider` for provider-native passthrough in both
        directions. Provider-mode server frames are forwarded without signal mapping,
        timestamp rewriting, deduplication, or router-generated JSON events.
        This mode requires a direct upstream realtime WebSocket.

        `audio_format` is required and describes the unchanged raw bytes. No
        resampling, transcoding, or FFmpeg occurs in the streaming path. Portable flat
        parameters control commits, turn detection, VAD thresholds, partials,
        timestamps, language detection, keyterms/context, diarization, formatting, and
        filler words. Unknown bare parameters are rejected. Put provider-native names
        under `provider_options[<name>]`; native overrides win except that conflicting
        encoding/sample-rate/channel declarations return
        `conflicting_audio_format`.

        Portable input mapping:

        | Family | Default automatic behavior | Native translation / fallback |
        |---|---|---|
        | Deepgram Nova | acoustic endpointing | `endpointing`, `utterance_end_ms`, `vad_events` |
        | Deepgram Flux | semantic turns | `eot_threshold`, `eager_eot_threshold`, `eot_timeout_ms` |
        | ElevenLabs Scribe realtime | provider VAD | `commit_strategy=vad`, `vad_*`, `min_*` |
        | Soniox realtime | acoustic endpointing | `enable_endpoint_detection`, `max_endpoint_delay_ms` |
        | AssemblyAI streaming | provider turn detection | model-specific turn silence/confidence fields |
        | xAI Grok | acoustic; semantic when requested | `endpointing` or Smart Turn fields |
        | Cartesia ink-2 | semantic turns | `stream_mode=turns`; manual selects `manual` |
        | Cartesia ink-whisper | acoustic router VAD | no provider turn detector; router VAD segments the stream |
        | OpenAI transcription | server VAD | nested `turn_detection` session object |
        | OpenAI realtime Whisper | acoustic router VAD | provider detector disabled; router sends native commits |
        | Together | provider VAD | `threshold`, `min_silence_duration_ms`, `min_speech_duration_ms` |

        Router VAD supplies `turn_detection=acoustic` only for OpenAI realtime
        Whisper and Cartesia `ink-whisper`. Deepgram Flux has no router-VAD path —
        its client grammar carries no commit frame — so it serves semantic turn
        detection only and rejects `turn_detection=acoustic` with
        `unsupported_stt_option`.

        Each model family advertises only the portable options it can translate to a
        native parameter; an explicit option outside that set fails before audio with
        `unsupported_stt_option` rather than riding along as a silent no-op. Omitted
        options fall back to the family's own behavior — `interim_results`, for
        example, has no global default. Router VAD can create transcript commits but
        never manufactures provider-originated `stt.signal` events, and the signals a
        session may emit are fixed by the `capabilities` object echoed in
        `stt.session.started`.

        Authentication failures close the connection with code `4401` or `4403`.

        The message-level protocol is documented at [/docs/realtime](/docs/realtime)
        (AsyncAPI spec: [/asyncapi.yaml](/asyncapi.yaml)).
      parameters:
        - schema:
            $ref: "#/components/schemas/SttProviderId"
          required: false
          description: Use a specific STT provider.
          name: provider
          in: query
        - schema:
            type: string
          required: false
          description: "Model id: bare name (`nova-3`) or `{author}/{modelName}` slug (`deepgram/nova-3`)."
          name: model
          in: query
        - schema:
            type: string
          required: false
          description: Expected language.
          name: language
          in: query
        - schema:
            type: string
            enum:
              - pcm_8000
              - pcm_16000
              - pcm_22050
              - pcm_24000
              - pcm_44100
              - pcm_48000
              - ulaw_8000
          required: true
          description: Actual raw mono audio bytes sent by the client. The router maps this declaration to the provider's native parameters but never resamples or transcodes.
          name: audio_format
          in: query
        - schema:
            type: integer
            minimum: 1
            default: 1
          required: false
          description: Input channel count. Defaults to mono (`1`).
          name: channels
          in: query
        - schema:
            type: string
            enum:
              - auto
              - manual
            default: auto
          required: false
          description: "`auto` uses provider segmentation or reviewed router VAD; `manual` requires `stt.audio.commit`."
          name: commit_strategy
          in: query
        - schema:
            type: string
            enum:
              - auto
              - acoustic
              - semantic
            default: auto
          required: false
          description: Automatic detector intent. Explicit acoustic/semantic requests fail if unsupported.
          name: turn_detection
          in: query
        - schema:
            type: number
            minimum: 0
          required: false
          description: Trailing silence used for automatic acoustic segmentation.
          name: silence_duration_ms
          in: query
        - schema:
            type: number
            minimum: 0
          required: false
          description: Minimum speech duration before activation.
          name: min_speech_duration_ms
          in: query
        - schema:
            type: number
            minimum: 0
          required: false
          description: Minimum silence duration before a boundary.
          name: min_silence_duration_ms
          in: query
        - schema:
            type: number
            minimum: 0
          required: false
          description: Maximum wait for a provider turn/endpoint decision.
          name: turn_timeout_ms
          in: query
        - schema:
            type: number
            minimum: 0
            maximum: 1
          required: false
          description: Portable speech/VAD threshold.
          name: speech_threshold
          in: query
        - schema:
            type: number
            minimum: 0
            maximum: 1
          required: false
          description: Portable semantic end-of-turn threshold.
          name: turn_threshold
          in: query
        - schema:
            type: number
            minimum: 0
            maximum: 1
          required: false
          description: Predictive eager-end threshold; predictive boundaries remain opt-in.
          name: eager_end_threshold
          in: query
        - schema:
            type: boolean
          required: false
          description: "Request mutable transcript hypotheses. There is no global default: when omitted, the selected model family's own behavior applies (`false` for Deepgram Flux, `true` elsewhere). The resolved value is echoed in `stt.session.started.input_config.interim_results`."
          name: interim_results
          in: query
        - schema:
            type: boolean
          required: false
          description: Request provider timestamps.
          name: include_timestamps
          in: query
        - schema:
            type: boolean
          required: false
          description: Request provider language detection metadata.
          name: include_language_detection
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Repeated speech-recognition keyterms.
          style: form
          explode: true
          name: keyterms
          in: query
        - schema:
            type: string
          required: false
          description: Recognition context or prompt.
          name: context
          in: query
        - schema:
            type: boolean
          required: false
          description: Request speaker diarization.
          name: diarization
          in: query
        - schema:
            type: boolean
          required: false
          description: Request provider-native transcript formatting.
          name: formatting
          in: query
        - schema:
            type: boolean
          required: false
          description: Request filler/disfluency words when supported.
          name: include_filler_words
          in: query
        - schema:
            type: string
            enum:
              - normalized
              - provider
            default: normalized
          required: false
          description: Server/client event grammar. `normalized` is the default sequenced `stt.*` contract; `provider` forwards the selected provider's frames without mapping, rewriting, deduplication, or router-generated JSON events. Provider mode requires a direct upstream realtime WebSocket.
          name: event_format
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs in preferred order. Providers not listed remain eligible.
          style: form
          explode: false
          name: provider_order
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs. Only these providers may serve the request.
          style: form
          explode: false
          name: provider_only
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs that must not serve the request.
          style: form
          explode: false
          name: provider_ignore
          in: query
        - schema:
            type: boolean
          required: false
          description: Set to `false` to prevent fallback to another provider. Automatic provider retries are not currently supported.
          name: allow_fallbacks
          in: query
        - schema:
            type: object
            additionalProperties:
              type: string
            anyOf:
              - $ref: "#/components/schemas/DeepgramSttOptions"
              - $ref: "#/components/schemas/ElevenLabsSttOptions"
              - $ref: "#/components/schemas/SonioxSttOptions"
              - $ref: "#/components/schemas/AssemblyaiSttOptions"
              - $ref: "#/components/schemas/GroqSttOptions"
              - $ref: "#/components/schemas/GrokSttOptions"
              - $ref: "#/components/schemas/CartesiaSttOptions"
              - $ref: "#/components/schemas/OpenaiSttOptions"
              - $ref: "#/components/schemas/GeminiSttOptions"
              - $ref: "#/components/schemas/QwenSttOptions"
          required: false
          description: Provider-specific options in bracket notation, such as `provider_options[encoding]=linear16`. Provider-native names are accepted only inside this namespace; unknown bare query parameters are rejected.
          style: deepObject
          explode: true
          name: provider_options
          in: query
        - schema:
            type: string
            const: websocket
          required: true
          description: Must be websocket to perform the protocol upgrade.
          name: Upgrade
          in: header
      responses:
        "101":
          description: WebSocket connection established. No HTTP response body.
        "400":
          description: "Pre-upgrade validation failure. `error` is one of: `invalid_stt_request` (unknown pinned provider), `invalid_model` (no streaming binding for the model), `unknown_stt_parameter` (bare query key outside the portable set), `missing_audio_format`, `invalid_stt_input` (malformed portable value, or `turn_detection` set together with `commit_strategy=manual`), `unsupported_audio_format`, `unsupported_stt_option` (option, channel count, commit strategy, or turn detector the selected model cannot serve), `conflicting_audio_format` (a `provider_options[...]` encoding/rate override that disagrees with `audio_format`), or `invalid_event_format`."
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/NativeSttInputError"
                  - $ref: "#/components/schemas/NativeError"
              examples:
                invalidModel:
                  value:
                    error: invalid_model
                    provider: soniox
                    model: bogus
                    supported:
                      - stt-rt-v5
                missingAudioFormat:
                  value:
                    error: missing_audio_format
                    message: audio_format is required because streaming audio bytes are not self-describing
                    parameter: audio_format
                    supported:
                      - pcm_8000
                      - pcm_16000
                      - pcm_22050
                      - pcm_24000
                      - pcm_44100
                      - pcm_48000
                      - ulaw_8000
                unknownParameter:
                  value:
                    error: unknown_stt_parameter
                    message: Provider-native parameters must use provider_options[<name>].
                    parameters:
                      - sample_rate
                unsupportedOption:
                  value:
                    error: unsupported_stt_option
                    message: acoustic turn detection is not supported by the selected streaming model
                    parameter: turn_detection
                    supported:
                      - semantic
                    provider: deepgram
                    model: flux-general-en
                unsupportedAudioFormat:
                  value:
                    error: unsupported_audio_format
                    message: pcm_8000 is not supported by the selected streaming model
                    parameter: audio_format
                    supported:
                      - pcm_24000
                    provider: openai
                    model: gpt-realtime-whisper
                conflictingAudioFormat:
                  value:
                    error: conflicting_audio_format
                    message: provider_options[sample_rate] conflicts with audio_format=pcm_16000
                    parameter: sample_rate
                    provider: assemblyai
                    model: u3-rt-pro
        "401":
          description: The Authorization Bearer token is missing or invalid.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: missing_api_key
        "403":
          description: The API key cannot use any provider that matches the request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: provider_not_allowed
                tried:
                  - deepgram
                  - soniox
                  - assemblyai
        "422":
          description: No edge pricing is configured for the selected provider/model, so the session is refused before the upgrade.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: model_not_priced
                provider: deepgram
                model: flux-general-en
        "426":
          description: Request was not a WebSocket upgrade.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: websocket_upgrade_required
        "500":
          description: Authentication could not be initialized.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: auth_not_initialized
  /el/v1/text-to-speech/{voice_id}/stream:
    post:
      tags:
        - ElevenLabs SDK
      summary: ElevenLabs SDK-compatible TTS (HTTP streaming)
      operationId: sdkTtsStream
      security:
        - XiApiKey: []
        - BearerAuth: []
      description: |-
        Generates speech with `client.textToSpeech.stream(...)` and returns audio as
        it is produced. The response `Content-Type` follows `output_format`: `mp3_*` →
        `audio/mpeg`, `pcm_*` → `audio/L16; rate=N`, otherwise
        `application/octet-stream`.

        Use `provider_options` for provider-specific settings. You can also pass
        supported options directly as query parameters. If both forms set the same
        option, `provider_options[<name>]=<value>` takes precedence. Recognized enum
        and boolean option values are case-insensitive and are normalized to each
        provider's wire spelling; free-form values such as prompts, keyterms, and voice
        IDs retain their original case.
      parameters:
        - schema:
            type: string
          required: true
          description: Provider voice id (path segment). For Grok TTS, eve is the default voice.
          name: voice_id
          in: path
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs in preferred order. Providers not listed remain eligible.
          style: form
          explode: false
          name: provider_order
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs. Only these providers may serve the request.
          style: form
          explode: false
          name: provider_only
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs that must not serve the request.
          style: form
          explode: false
          name: provider_ignore
          in: query
        - schema:
            type: boolean
          required: false
          description: Set to `false` to prevent fallback to another provider. Automatic provider retries are not currently supported.
          name: allow_fallbacks
          in: query
        - schema:
            type: string
          required: false
          description: Output format (case-insensitive), such as mp3_44100_128 or pcm_16000. Formats the selected provider cannot emit natively are served by transcoding its best native stream.
          name: output_format
          in: query
        - schema:
            type: string
          required: false
          name: enable_logging
          in: query
        - schema:
            type: string
          required: false
          name: optimize_streaming_latency
          in: query
        - schema:
            type: object
            additionalProperties:
              type: string
            anyOf:
              - $ref: "#/components/schemas/DeepgramTtsOptions"
              - $ref: "#/components/schemas/ElevenLabsTtsOptions"
              - $ref: "#/components/schemas/SonioxTtsOptions"
              - $ref: "#/components/schemas/FishTtsOptions"
              - $ref: "#/components/schemas/GroqTtsOptions"
              - $ref: "#/components/schemas/GrokTtsOptions"
              - $ref: "#/components/schemas/MinimaxTtsOptions"
              - $ref: "#/components/schemas/CartesiaTtsOptions"
              - $ref: "#/components/schemas/TogetherTtsOptions"
              - $ref: "#/components/schemas/OpenaiTtsOptions"
              - $ref: "#/components/schemas/GeminiTtsOptions"
              - $ref: "#/components/schemas/FalTtsOptions"
          required: false
          description: Provider-specific options in bracket notation, such as `provider_options[encoding]=linear16`. You can also pass supported options directly as query parameters. If both forms set the same option, the bracketed value takes precedence.
          style: deepObject
          explode: true
          name: provider_options
          in: query
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SdkTtsBody"
            example:
              text: Hello from AllModels.
              model_id: elevenlabs/eleven_flash_v2_5
              provider:
                order:
                  - elevenlabs
                  - minimax
      responses:
        "200":
          description: Streaming audio.
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
            audio/L16:
              schema:
                type: string
                format: binary
            application/octet-stream:
              schema:
                type: string
                format: binary
        "400":
          description: Malformed JSON body (invalid_json), unsupported output_format (invalid_output_format — non-native formats are normally served by transcoding, so this remains only when no transcode source exists or the transcode service is unavailable), or unsupported model (invalid_model).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              examples:
                invalidJson:
                  value:
                    detail:
                      message: invalid json body
                      status: invalid_json
                invalidOutputFormat:
                  value:
                    detail:
                      message: unsupported output_format 'flac' for provider 'elevenlabs'
                      status: invalid_output_format
                      provider: elevenlabs
                      output_format: flac
                invalidModel:
                  value:
                    detail:
                      message: unsupported model 'bogus' for provider 'elevenlabs'
                      status: invalid_model
                      provider: elevenlabs
                      model: bogus
                      supported:
                        - eleven_v3
                        - eleven_multilingual_v2
                        - eleven_flash_v2_5
                        - eleven_turbo_v2_5
                        - eleven_turbo_v2
                        - eleven_flash_v2
        "401":
          description: 'The AllModels API key is missing or invalid. Authentication errors use `{ "error": "<code>" }`.'
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              examples:
                missingApiKey:
                  value:
                    error: missing_api_key
                invalidApiKey:
                  value:
                    error: invalid_api_key
        "402":
          description: The organization's balance is too low to start the request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: this organization has insufficient prepaid balance
                  status: insufficient_balance
        "403":
          description: The organization is disabled or the key cannot use the selected provider. Organization errors use `{ "error" }`; provider errors use the ElevenLabs-compatible `{ "detail" }` response.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/NativeError"
                  - $ref: "#/components/schemas/SdkError"
              examples:
                tenantDisabled:
                  value:
                    error: tenant_disabled
                providerNotAllowed:
                  value:
                    detail:
                      message: no allowed provider candidate matched this request
                      status: provider_not_allowed
                      tried:
                        - minimax
                        - elevenlabs
        "413":
          description: The text field exceeds 2000 characters.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: text exceeds 2000 characters
                  status: tts_text_too_large
        "422":
          description: The request body is invalid, pricing is unavailable for the selected model, or the request carries `instructions` no candidate binding honors (see `instructions` on `/v1/models`).
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/SdkValidationErrorBody"
                  - $ref: "#/components/schemas/SdkError"
              examples:
                missingText:
                  value:
                    detail:
                      loc:
                        - body
                        - text
                      msg: field required
                      type: value_error.missing
                modelNotPriced:
                  value:
                    detail:
                      message: no pricing is configured for this model
                      status: model_not_priced
                      provider: elevenlabs
                      model: eleven_flash_v2_5
                instructionsNotSupported:
                  value:
                    detail:
                      message: the selected provider/model binding cannot honor delivery instructions
                      status: instructions_not_supported
                      model: eleven_flash_v2_5
                      tried:
                        - elevenlabs
        "502":
          description: The selected provider request failed (upstream_error), or transcoding to the requested non-native output_format failed (transcode_failed).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: upstream text-to-speech request failed
                  status: upstream_error
  /el/v1/text-to-speech/{voice_id}:
    post:
      tags:
        - ElevenLabs SDK
      summary: ElevenLabs SDK-compatible TTS (convert)
      operationId: sdkTtsConvert
      security:
        - XiApiKey: []
        - BearerAuth: []
      description: |-
        Generates speech with `client.textToSpeech.convert(...)`. It accepts the same
        request and returns the same streaming audio response as the `/stream` endpoint.

        Use `provider_options` for provider-specific settings. You can also pass
        supported options directly as query parameters. If both forms set the same
        option, `provider_options[<name>]=<value>` takes precedence. Recognized enum
        and boolean option values are case-insensitive and are normalized to each
        provider's wire spelling; free-form values such as prompts, keyterms, and voice
        IDs retain their original case.
      parameters:
        - schema:
            type: string
          required: true
          description: Provider voice id (path segment). For Grok TTS, eve is the default voice.
          name: voice_id
          in: path
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs in preferred order. Providers not listed remain eligible.
          style: form
          explode: false
          name: provider_order
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs. Only these providers may serve the request.
          style: form
          explode: false
          name: provider_only
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs that must not serve the request.
          style: form
          explode: false
          name: provider_ignore
          in: query
        - schema:
            type: boolean
          required: false
          description: Set to `false` to prevent fallback to another provider. Automatic provider retries are not currently supported.
          name: allow_fallbacks
          in: query
        - schema:
            type: string
          required: false
          description: Output format (case-insensitive), such as mp3_44100_128 or pcm_16000. Formats the selected provider cannot emit natively are served by transcoding its best native stream.
          name: output_format
          in: query
        - schema:
            type: string
          required: false
          name: enable_logging
          in: query
        - schema:
            type: string
          required: false
          name: optimize_streaming_latency
          in: query
        - schema:
            type: object
            additionalProperties:
              type: string
            anyOf:
              - $ref: "#/components/schemas/DeepgramTtsOptions"
              - $ref: "#/components/schemas/ElevenLabsTtsOptions"
              - $ref: "#/components/schemas/SonioxTtsOptions"
              - $ref: "#/components/schemas/FishTtsOptions"
              - $ref: "#/components/schemas/GroqTtsOptions"
              - $ref: "#/components/schemas/GrokTtsOptions"
              - $ref: "#/components/schemas/MinimaxTtsOptions"
              - $ref: "#/components/schemas/CartesiaTtsOptions"
              - $ref: "#/components/schemas/TogetherTtsOptions"
              - $ref: "#/components/schemas/OpenaiTtsOptions"
              - $ref: "#/components/schemas/GeminiTtsOptions"
              - $ref: "#/components/schemas/FalTtsOptions"
          required: false
          description: Provider-specific options in bracket notation, such as `provider_options[encoding]=linear16`. You can also pass supported options directly as query parameters. If both forms set the same option, the bracketed value takes precedence.
          style: deepObject
          explode: true
          name: provider_options
          in: query
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SdkTtsBody"
            example:
              text: Hello from AllModels.
              model_id: elevenlabs/eleven_flash_v2_5
              provider:
                order:
                  - elevenlabs
                  - minimax
      responses:
        "200":
          description: Streaming audio.
          content:
            audio/mpeg:
              schema:
                type: string
                format: binary
            audio/L16:
              schema:
                type: string
                format: binary
            application/octet-stream:
              schema:
                type: string
                format: binary
        "400":
          description: Malformed JSON body (invalid_json), unsupported output_format (invalid_output_format — non-native formats are normally served by transcoding, so this remains only when no transcode source exists or the transcode service is unavailable), or unsupported model (invalid_model).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              examples:
                invalidJson:
                  value:
                    detail:
                      message: invalid json body
                      status: invalid_json
                invalidOutputFormat:
                  value:
                    detail:
                      message: unsupported output_format 'flac' for provider 'elevenlabs'
                      status: invalid_output_format
                      provider: elevenlabs
                      output_format: flac
                invalidModel:
                  value:
                    detail:
                      message: unsupported model 'bogus' for provider 'elevenlabs'
                      status: invalid_model
                      provider: elevenlabs
                      model: bogus
                      supported:
                        - eleven_v3
                        - eleven_multilingual_v2
                        - eleven_flash_v2_5
                        - eleven_turbo_v2_5
                        - eleven_turbo_v2
                        - eleven_flash_v2
        "401":
          description: 'The AllModels API key is missing or invalid. Authentication errors use `{ "error": "<code>" }`.'
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              examples:
                missingApiKey:
                  value:
                    error: missing_api_key
                invalidApiKey:
                  value:
                    error: invalid_api_key
        "402":
          description: The organization's balance is too low to start the request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: this organization has insufficient prepaid balance
                  status: insufficient_balance
        "403":
          description: The organization is disabled or the key cannot use the selected provider. Organization errors use `{ "error" }`; provider errors use the ElevenLabs-compatible `{ "detail" }` response.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/NativeError"
                  - $ref: "#/components/schemas/SdkError"
              examples:
                tenantDisabled:
                  value:
                    error: tenant_disabled
                providerNotAllowed:
                  value:
                    detail:
                      message: no allowed provider candidate matched this request
                      status: provider_not_allowed
                      tried:
                        - minimax
                        - elevenlabs
        "413":
          description: The text field exceeds 2000 characters.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: text exceeds 2000 characters
                  status: tts_text_too_large
        "422":
          description: The request body is invalid, pricing is unavailable for the selected model, or the request carries `instructions` no candidate binding honors (see `instructions` on `/v1/models`).
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/SdkValidationErrorBody"
                  - $ref: "#/components/schemas/SdkError"
              examples:
                missingText:
                  value:
                    detail:
                      loc:
                        - body
                        - text
                      msg: field required
                      type: value_error.missing
                modelNotPriced:
                  value:
                    detail:
                      message: no pricing is configured for this model
                      status: model_not_priced
                      provider: elevenlabs
                      model: eleven_flash_v2_5
                instructionsNotSupported:
                  value:
                    detail:
                      message: the selected provider/model binding cannot honor delivery instructions
                      status: instructions_not_supported
                      model: eleven_flash_v2_5
                      tried:
                        - elevenlabs
        "502":
          description: The selected provider request failed (upstream_error), or transcoding to the requested non-native output_format failed (transcode_failed).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: upstream text-to-speech request failed
                  status: upstream_error
  /el/v1/text-to-speech/{voice_id}/stream-input:
    get:
      tags:
        - ElevenLabs SDK
      summary: ElevenLabs SDK-compatible streaming-input TTS (WebSocket)
      operationId: sdkTtsStreamInput
      security:
        - XiApiKey: []
        - BearerAuth: []
      description: |-
        Streams text into TTS with the ElevenLabs WebSocket protocol. Use it to start
        generating audio before all of the text is available. The request must include
        `Upgrade: websocket`.

        **Client → server** frames (JSON):
        - `{ "text": " ", "voice_settings": { "speed": 1.0 }, "generation_config": {...} }` — optional init frame (single space). See the `VoiceSettings` schema for the supported keys; `speed` is honored across providers.
        - `{ "text": "Hello ", "try_trigger_generation": true }` — append text.
        - `{ "text": "world.", "flush": true }` — append and force generation.
        - `{ "text": "", "flush": true }` — flush without closing.
        - `{ "text": "" }` — close the stream.

        **Server → client** frames (JSON):
        - `{ "audio": "<base64 bytes>" }` — one frame per audio chunk.
        - `{ "audio": null, "error": "<code>", "code": "<status>" }` — error.

        Text is buffered by default to improve prosody across message boundaries. Two
        ElevenLabs-only options control buffering:
        - `auto_mode` (query param) — disables buffering; audio is generated per
          message rather than across the buffer.
        - `generation_config.chunk_length_schedule` (init-frame field) — tunes the
          buffer size, e.g. the init frame
          `{ "text": " ", "generation_config": { "chunk_length_schedule": [50] } }`.

        The `try_trigger_generation` and `flush` fields are supported by ElevenLabs,
        Deepgram, Grok, and Fish. MiniMax does not support mid-stream flushing.

        Deepgram WebSocket TTS supports only `pcm_*` and `ulaw_*`. Requesting
        `mp3_*` returns `400 invalid_output_format`.

        Use `provider_options` for provider-specific settings. You can also pass
        supported options directly as query parameters. If both forms set the same
        option, `provider_options[<name>]=<value>` takes precedence. Recognized enum
        and boolean option values are case-insensitive and are normalized to each
        provider's wire spelling; free-form values such as prompts, keyterms, and voice
        IDs retain their original case.

        The message-level protocol is documented at [/docs/realtime](/docs/realtime)
        (AsyncAPI spec: [/asyncapi.yaml](/asyncapi.yaml)).
      parameters:
        - schema:
            type: string
          required: true
          description: Provider voice id (path segment). For Grok TTS, eve is the default voice.
          name: voice_id
          in: path
        - schema:
            type: string
          required: false
          description: "Model id: bare name or `{author}/{modelName}` slug (`elevenlabs/eleven_flash_v2_5`)."
          name: model_id
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs in preferred order. Providers not listed remain eligible.
          style: form
          explode: false
          name: provider_order
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs. Only these providers may serve the request.
          style: form
          explode: false
          name: provider_only
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs that must not serve the request.
          style: form
          explode: false
          name: provider_ignore
          in: query
        - schema:
            type: boolean
          required: false
          description: Set to `false` to prevent fallback to another provider. Automatic provider retries are not currently supported.
          name: allow_fallbacks
          in: query
        - schema:
            type: string
          required: false
          description: Provider output format (case-insensitive), e.g. mp3_44100_128, pcm_16000, or ulaw_8000. Deepgram WS TTS only supports pcm_*/ulaw_*.
          name: output_format
          in: query
        - schema:
            type: string
          required: false
          description: Seconds of client inactivity before the ElevenLabs connection is closed.
          name: inactivity_timeout
          in: query
        - schema:
            type: string
          required: false
          description: ElevenLabs only. Generate audio for each message instead of buffering text across messages.
          name: auto_mode
          in: query
        - schema:
            type: string
          required: false
          description: ElevenLabs only. Set to `false` to disable provider request logging.
          name: enable_logging
          in: query
        - schema:
            type: string
          required: false
          description: ISO language code for speech generation.
          name: language_code
          in: query
        - schema:
            type: string
          required: false
          description: "ElevenLabs text-normalization mode: `auto`, `on`, or `off`."
          name: apply_text_normalization
          in: query
        - schema:
            type: string
          required: false
          description: ElevenLabs only. Parse SSML tags in the input text.
          name: enable_ssml_parsing
          in: query
        - schema:
            type: object
            additionalProperties:
              type: string
            anyOf:
              - $ref: "#/components/schemas/DeepgramTtsOptions"
              - $ref: "#/components/schemas/ElevenLabsTtsOptions"
              - $ref: "#/components/schemas/SonioxTtsOptions"
              - $ref: "#/components/schemas/FishTtsOptions"
              - $ref: "#/components/schemas/GroqTtsOptions"
              - $ref: "#/components/schemas/GrokTtsOptions"
              - $ref: "#/components/schemas/MinimaxTtsOptions"
              - $ref: "#/components/schemas/CartesiaTtsOptions"
              - $ref: "#/components/schemas/TogetherTtsOptions"
              - $ref: "#/components/schemas/OpenaiTtsOptions"
              - $ref: "#/components/schemas/GeminiTtsOptions"
              - $ref: "#/components/schemas/FalTtsOptions"
          required: false
          description: Provider-specific options in bracket notation, such as `provider_options[encoding]=linear16`. You can also pass supported options directly as query parameters. If both forms set the same option, the bracketed value takes precedence.
          style: deepObject
          explode: true
          name: provider_options
          in: query
        - schema:
            type: string
            const: websocket
          required: true
          description: Must be websocket to perform the protocol upgrade.
          name: Upgrade
          in: header
      responses:
        "101":
          description: WebSocket connection established. No HTTP response body.
        "400":
          description: Unsupported `output_format` (`invalid_output_format`) or unsupported `model` (`invalid_model`).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              examples:
                invalidOutputFormat:
                  value:
                    detail:
                      message: Deepgram TTS WS only supports pcm_*/ulaw_* output formats.
                      status: invalid_output_format
                      provider: deepgram
                      output_format: mp3_44100_128
                invalidModel:
                  value:
                    detail:
                      message: unsupported model 'bogus' for provider 'elevenlabs'
                      status: invalid_model
                      provider: elevenlabs
                      model: bogus
                      supported:
                        - eleven_v3
                        - eleven_multilingual_v2
                        - eleven_flash_v2_5
                        - eleven_turbo_v2_5
                        - eleven_turbo_v2
                        - eleven_flash_v2
        "401":
          description: The Authorization Bearer token is missing or invalid.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: missing_api_key
        "422":
          description: The request body is invalid, pricing is unavailable for the selected model, or the request carries `instructions` no candidate binding honors (see `instructions` on `/v1/models`).
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/SdkValidationErrorBody"
                  - $ref: "#/components/schemas/SdkError"
              examples:
                missingText:
                  value:
                    detail:
                      loc:
                        - body
                        - text
                      msg: field required
                      type: value_error.missing
                modelNotPriced:
                  value:
                    detail:
                      message: no pricing is configured for this model
                      status: model_not_priced
                      provider: elevenlabs
                      model: eleven_flash_v2_5
                instructionsNotSupported:
                  value:
                    detail:
                      message: the selected provider/model binding cannot honor delivery instructions
                      status: instructions_not_supported
                      model: eleven_flash_v2_5
                      tried:
                        - elevenlabs
        "426":
          description: Request was not a WebSocket upgrade.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: websocket upgrade required
                  status: websocket_upgrade_required
        "500":
          description: Authentication could not be initialized.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: authentication was not initialized
                  status: auth_not_initialized
  /el/v1/speech-to-text:
    post:
      tags:
        - ElevenLabs SDK
      summary: ElevenLabs SDK-compatible STT (file upload)
      operationId: sdkSttFile
      security:
        - XiApiKey: []
        - BearerAuth: []
      description: |-
        Transcribes an uploaded audio file with `client.speechToText.convert(...)`.
        Supported formats are WAV, MP3, FLAC, MP4/M4A, OGG, and WebM. Unsupported or
        unreadable files return `422 indeterminate_audio_duration`.

        Use `provider_options` for provider-specific settings. You can also pass
        supported options directly as query parameters. If both forms set the same
        option, `provider_options[<name>]=<value>` takes precedence. Recognized enum
        and boolean option values are case-insensitive and are normalized to each
        provider's wire spelling; free-form values such as prompts, keyterms, and voice
        IDs retain their original case.
      parameters:
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs in preferred order. Providers not listed remain eligible.
          style: form
          explode: false
          name: provider_order
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs. Only these providers may serve the request.
          style: form
          explode: false
          name: provider_only
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs that must not serve the request.
          style: form
          explode: false
          name: provider_ignore
          in: query
        - schema:
            type: boolean
          required: false
          description: Set to `false` to prevent fallback to another provider. Automatic provider retries are not currently supported.
          name: allow_fallbacks
          in: query
        - schema:
            type: object
            additionalProperties:
              type: string
            anyOf:
              - $ref: "#/components/schemas/DeepgramSttOptions"
              - $ref: "#/components/schemas/ElevenLabsSttOptions"
              - $ref: "#/components/schemas/SonioxSttOptions"
              - $ref: "#/components/schemas/AssemblyaiSttOptions"
              - $ref: "#/components/schemas/GroqSttOptions"
              - $ref: "#/components/schemas/GrokSttOptions"
              - $ref: "#/components/schemas/CartesiaSttOptions"
              - $ref: "#/components/schemas/OpenaiSttOptions"
              - $ref: "#/components/schemas/GeminiSttOptions"
              - $ref: "#/components/schemas/QwenSttOptions"
          required: false
          description: Provider-specific options in bracket notation, such as `provider_options[encoding]=linear16`. You can also pass supported options directly as query parameters. If both forms set the same option, the bracketed value takes precedence.
          style: deepObject
          explode: true
          name: provider_options
          in: query
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/SdkSttFileBody"
      responses:
        "200":
          description: Transcription result.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkSttFileResponse"
              example:
                language_code: en
                language_probability: 0.98
                text: Hello from AllModels.
                words:
                  - text: Hello
                    start: 0
                    end: 0.4
                    type: word
        "400":
          description: Malformed multipart body (invalid_multipart), invalid timestamps_granularity, or unsupported model (invalid_model).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              examples:
                invalidMultipart:
                  value:
                    detail:
                      message: invalid multipart body
                      status: invalid_multipart
                invalidTimestampsGranularity:
                  value:
                    detail:
                      message: timestamps_granularity must be one of none, word, character
                      status: invalid_timestamps_granularity
                      timestamps_granularity: sentence
                invalidModel:
                  value:
                    detail:
                      message: unsupported model 'bogus' for provider 'deepgram'
                      status: invalid_model
                      provider: deepgram
                      model: bogus
                      supported:
                        - nova-3
                        - nova-2
        "401":
          description: 'The AllModels API key is missing or invalid. Authentication errors use `{ "error": "<code>" }`.'
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              examples:
                missingApiKey:
                  value:
                    error: missing_api_key
                invalidApiKey:
                  value:
                    error: invalid_api_key
        "402":
          description: The organization's balance is too low to start the request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: this organization has insufficient prepaid balance
                  status: insufficient_balance
        "403":
          description: The organization is disabled or the key cannot use the selected provider. Organization errors use `{ "error" }`; provider errors use the ElevenLabs-compatible `{ "detail" }` response.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/NativeError"
                  - $ref: "#/components/schemas/SdkError"
              examples:
                tenantDisabled:
                  value:
                    error: tenant_disabled
                providerNotAllowed:
                  value:
                    detail:
                      message: no allowed provider candidate matched this request
                      status: provider_not_allowed
                      tried:
                        - minimax
                        - elevenlabs
        "422":
          description: Missing file, unreadable audio duration (`indeterminate_audio_duration`), or unavailable pricing for the selected model (`model_not_priced`).
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/SdkValidationErrorBody"
                  - $ref: "#/components/schemas/SdkError"
              examples:
                missingFile:
                  value:
                    detail:
                      loc:
                        - body
                        - file
                      msg: field required
                      type: value_error.missing
                indeterminateAudioDuration:
                  value:
                    detail:
                      message: "could not determine audio length for prepaid billing; supported containers: wav, mp3, flac, mp4/m4a, ogg, webm"
                      status: indeterminate_audio_duration
                      provider: deepgram
                modelNotPriced:
                  value:
                    detail:
                      message: no pricing is configured for this model
                      status: model_not_priced
                      provider: deepgram
                      model: nova-3
        "501":
          description: The selected provider does not support file transcription.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: provider 'example-provider' does not support file transcription
                  status: transcription_not_supported
                  provider: example-provider
        "502":
          description: The selected provider request failed.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: upstream text-to-speech request failed
                  status: upstream_error
  /el/v1/speech-to-text/realtime:
    get:
      tags:
        - ElevenLabs SDK
      summary: ElevenLabs SDK-compatible realtime STT (WebSocket)
      operationId: sdkSttRealtime
      security:
        - XiApiKey: []
        - BearerAuth: []
      description: |-
        Streams audio and receives ElevenLabs-compatible transcript events with
        `client.speechToText.realtime.connect(...)`. The request must include
        `Upgrade: websocket`.

        **Client → server** frames (JSON):
        `{ "message_type": "input_audio_chunk", "audio_base_64": "...", "sample_rate": 16000, "commit": true }`

        **Server → client** frames (JSON), `message_type` one of:
        `session_started`, `partial_transcript`, `committed_transcript`,
        `committed_transcript_with_timestamps`, `error`.

        **Commit strategy.** `commit_strategy=vad` finds utterance boundaries
        automatically with the model's native turn detection or VAD. Tune it with the
        `vad_*` / `min_*` params. `auto` is accepted as a legacy alias of `vad`.
        `commit_strategy=manual` instead lets the client close an
        utterance explicitly by sending an `input_audio_chunk` frame with
        `commit: true` (the SDK's `conn.commit()`) and is the compatibility
        surface's default. With providers that do not support
        manual commits, completed transcript text is returned together on commit.

        The ElevenLabs SDK does not support custom headers on this connection. Select a
        provider with a `<provider>/<model>` value in `model_id`.

        Use `provider_options` for provider-specific settings. You can also pass
        supported options directly as query parameters. If both forms set the same
        option, `provider_options[<name>]=<value>` takes precedence. Recognized enum
        and boolean option values are case-insensitive and are normalized to each
        provider's wire spelling; free-form values such as prompts, keyterms, and voice
        IDs retain their original case.

        The message-level protocol is documented at [/docs/realtime](/docs/realtime)
        (AsyncAPI spec: [/asyncapi.yaml](/asyncapi.yaml)).
      parameters:
        - schema:
            type: string
          required: false
          description: "Model id: bare name or `{author}/{modelName}` slug (`deepgram/nova-3`)."
          name: model_id
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs in preferred order. Providers not listed remain eligible.
          style: form
          explode: false
          name: provider_order
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs. Only these providers may serve the request.
          style: form
          explode: false
          name: provider_only
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs that must not serve the request.
          style: form
          explode: false
          name: provider_ignore
          in: query
        - schema:
            type: boolean
          required: false
          description: Set to `false` to prevent fallback to another provider. Automatic provider retries are not currently supported.
          name: allow_fallbacks
          in: query
        - schema:
            type: string
          required: false
          name: language_code
          in: query
        - schema:
            type: string
          required: false
          description: Input audio format, such as `pcm_16000` or `ulaw_8000`.
          name: audio_format
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Keyword/keyterm biasing. Repeat the param for multiple terms.
          name: keyterms
          in: query
        - schema:
            type: string
          required: false
          description: "VAD tuning (auto commit): trailing silence, in seconds, that ends an utterance."
          name: vad_silence_threshold_secs
          in: query
        - schema:
            type: string
          required: false
          description: "VAD tuning (auto commit): speech-probability threshold (0–1) for detecting speech."
          name: vad_threshold
          in: query
        - schema:
            type: string
          required: false
          description: "VAD tuning (auto commit): minimum speech length, in ms, before an utterance starts."
          name: min_speech_duration_ms
          in: query
        - schema:
            type: string
          required: false
          description: "VAD tuning (auto commit): minimum silence length, in ms, before an utterance ends."
          name: min_silence_duration_ms
          in: query
        - schema:
            type: string
          required: false
          description: When set, committed transcripts include word/char timestamps (`committed_transcript_with_timestamps` frames).
          name: include_timestamps
          in: query
        - schema:
            type: string
          required: false
          description: Request provider language detection metadata where supported.
          name: include_language_detection
          in: query
        - schema:
            type: string
            enum:
              - vad
              - manual
              - auto
            default: manual
          required: false
          description: "Utterance segmentation. `vad` lets the model decide boundaries automatically — its native turn detection or VAD (tune via the `vad_*` / `min_*` params); `auto` is an accepted legacy alias of `vad`; `manual` (default) lets the client commit utterances explicitly with an `input_audio_chunk` frame carrying `commit: true` (`conn.commit()`)."
          name: commit_strategy
          in: query
        - schema:
            type: string
          required: false
          description: When set, requests non-verbatim (cleaned/formatted) transcripts where the provider supports it.
          name: no_verbatim
          in: query
        - schema:
            type: object
            additionalProperties:
              type: string
            anyOf:
              - $ref: "#/components/schemas/DeepgramSttOptions"
              - $ref: "#/components/schemas/ElevenLabsSttOptions"
              - $ref: "#/components/schemas/SonioxSttOptions"
              - $ref: "#/components/schemas/AssemblyaiSttOptions"
              - $ref: "#/components/schemas/GroqSttOptions"
              - $ref: "#/components/schemas/GrokSttOptions"
              - $ref: "#/components/schemas/CartesiaSttOptions"
              - $ref: "#/components/schemas/OpenaiSttOptions"
              - $ref: "#/components/schemas/GeminiSttOptions"
              - $ref: "#/components/schemas/QwenSttOptions"
          required: false
          description: Provider-specific options in bracket notation, such as `provider_options[encoding]=linear16`. Provider-native names are accepted only inside this namespace; unknown bare query parameters are rejected.
          style: deepObject
          explode: true
          name: provider_options
          in: query
        - schema:
            type: string
            const: websocket
          required: true
          description: Must be websocket to perform the protocol upgrade.
          name: Upgrade
          in: header
      responses:
        "101":
          description: WebSocket connection established. No HTTP response body.
        "400":
          description: Unsupported model (invalid_model).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              examples:
                invalidModel:
                  value:
                    detail:
                      message: unsupported model 'bogus' for provider 'soniox'
                      status: invalid_model
                      provider: soniox
                      model: bogus
                      supported:
                        - stt-rt-v5
        "401":
          description: The Authorization Bearer token is missing or invalid.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: missing_api_key
        "426":
          description: Request was not a WebSocket upgrade.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: websocket upgrade required
                  status: websocket_upgrade_required
        "500":
          description: Authentication could not be initialized.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: authentication was not initialized
                  status: auth_not_initialized
  /el/v1/voices:
    get:
      tags:
        - ElevenLabs SDK
      summary: List voices (SDK get_all)
      operationId: sdkVoicesGetAll
      security:
        - XiApiKey: []
        - BearerAuth: []
      description: Lists voices with ElevenLabs `voices.get_all()`. Use `provider_only` to choose a provider. The returned `voice_id` values can be used directly with the `/el` TTS endpoints.
      parameters:
        - schema:
            $ref: "#/components/schemas/TtsProviderId"
          required: false
          description: Return voices from one TTS provider. Defaults to `elevenlabs`.
          name: provider_only
          in: query
      responses:
        "200":
          description: ElevenLabs-compatible voice list.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkVoicesGetAllResponse"
              example:
                voices:
                  - voice_id: EXAVITQu4vr4xnSDxMaL
                    name: Sarah
                    labels:
                      gender: female
                    category: premade
                    available_for_tiers: []
                    high_quality_base_model_ids: []
        "400":
          description: Unknown or non-TTS provider selection.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: unknown or non-TTS provider 'assemblyai'
                  status: invalid_provider
                  provider: assemblyai
                  supported:
                    - deepgram
                    - elevenlabs
                    - openai
        "401":
          description: 'The AllModels API key is missing or invalid. Authentication errors use `{ "error": "<code>" }`.'
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              examples:
                missingApiKey:
                  value:
                    error: missing_api_key
                invalidApiKey:
                  value:
                    error: invalid_api_key
  /el/v2/voices:
    get:
      tags:
        - ElevenLabs SDK
      summary: List voices (SDK search)
      operationId: sdkVoicesSearch
      security:
        - XiApiKey: []
        - BearerAuth: []
      description: Lists voices with ElevenLabs `voices.search()`. Use `page_size` to limit the result. All matching voices are returned in one page.
      parameters:
        - schema:
            $ref: "#/components/schemas/TtsProviderId"
          required: false
          description: Return voices from one TTS provider. Defaults to `elevenlabs`.
          name: provider_only
          in: query
        - schema:
            type: integer
            minimum: 1
          required: false
          description: Maximum voices to return. Malformed values are ignored (full page served).
          name: page_size
          in: query
      responses:
        "200":
          description: ElevenLabs-compatible voice search result.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkVoicesSearchResponse"
              example:
                voices:
                  - voice_id: EXAVITQu4vr4xnSDxMaL
                    name: Sarah
                    labels:
                      gender: female
                    category: premade
                    available_for_tiers: []
                    high_quality_base_model_ids: []
                has_more: false
                next_page_token: null
                total_count: 1
        "400":
          description: Unknown or non-TTS provider selection.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: unknown or non-TTS provider 'assemblyai'
                  status: invalid_provider
                  provider: assemblyai
                  supported:
                    - deepgram
                    - elevenlabs
                    - openai
        "401":
          description: 'The AllModels API key is missing or invalid. Authentication errors use `{ "error": "<code>" }`.'
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              examples:
                missingApiKey:
                  value:
                    error: missing_api_key
                invalidApiKey:
                  value:
                    error: invalid_api_key
  /oai/audio/speech:
    post:
      tags:
        - OpenAI SDK
      summary: OpenAI SDK-compatible speech
      description: |-
        Generates speech with the official OpenAI SDK. Set the client's base URL to `https://api.allmodels.io/oai` and use your AllModels API key. Use `stream_format=audio` for audio bytes or `stream_format=sse` for OpenAI speech events.

        Use `provider_options` for provider-specific settings. You can also pass
        supported options directly as query parameters. If both forms set the same
        option, `provider_options[<name>]=<value>` takes precedence. Recognized enum
        and boolean option values are case-insensitive and are normalized to each
        provider's wire spelling; free-form values such as prompts, keyterms, and voice
        IDs retain their original case.
      operationId: openAiSpeech
      security:
        - BearerAuth: []
      parameters:
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs in preferred order. Providers not listed remain eligible.
          style: form
          explode: false
          name: provider_order
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs. Only these providers may serve the request.
          style: form
          explode: false
          name: provider_only
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs that must not serve the request.
          style: form
          explode: false
          name: provider_ignore
          in: query
        - schema:
            type: boolean
          required: false
          description: Set to `false` to prevent fallback to another provider. Automatic provider retries are not currently supported.
          name: allow_fallbacks
          in: query
        - schema:
            type: object
            additionalProperties:
              type: string
            anyOf:
              - $ref: "#/components/schemas/DeepgramTtsOptions"
              - $ref: "#/components/schemas/ElevenLabsTtsOptions"
              - $ref: "#/components/schemas/SonioxTtsOptions"
              - $ref: "#/components/schemas/FishTtsOptions"
              - $ref: "#/components/schemas/GroqTtsOptions"
              - $ref: "#/components/schemas/GrokTtsOptions"
              - $ref: "#/components/schemas/MinimaxTtsOptions"
              - $ref: "#/components/schemas/CartesiaTtsOptions"
              - $ref: "#/components/schemas/TogetherTtsOptions"
              - $ref: "#/components/schemas/OpenaiTtsOptions"
              - $ref: "#/components/schemas/GeminiTtsOptions"
              - $ref: "#/components/schemas/FalTtsOptions"
          required: false
          description: Provider-specific options in bracket notation, such as `provider_options[encoding]=linear16`. You can also pass supported options directly as query parameters. If both forms set the same option, the bracketed value takes precedence.
          style: deepObject
          explode: true
          name: provider_options
          in: query
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OpenAiSpeechBody"
      responses:
        "200":
          description: Audio bytes or speech SSE events.
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
            audio/mpeg:
              schema:
                type: string
                format: binary
            audio/ogg:
              schema:
                type: string
                format: binary
            audio/aac:
              schema:
                type: string
                format: binary
            audio/flac:
              schema:
                type: string
                format: binary
            audio/wav:
              schema:
                type: string
                format: binary
            text/event-stream:
              schema:
                type: string
        "400":
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
        "401":
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
        "402":
          description: Insufficient balance.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
        "403":
          description: Provider forbidden.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
        "422":
          description: Unprocessable request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
        "502":
          description: Provider request failed (`upstream_error`), or transcoding to the requested non-native response_format failed (`transcode_failed`).
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
  /oai/audio/transcriptions:
    post:
      tags:
        - OpenAI SDK
      summary: OpenAI SDK-compatible transcription
      description: |-
        Transcribes an uploaded audio file with the official OpenAI JavaScript or Python SDK. Set `stream=true` only when the selected model supports streaming transcription.

        Use `provider_options` for provider-specific settings. You can also pass
        supported options directly as query parameters. If both forms set the same
        option, `provider_options[<name>]=<value>` takes precedence. Recognized enum
        and boolean option values are case-insensitive and are normalized to each
        provider's wire spelling; free-form values such as prompts, keyterms, and voice
        IDs retain their original case.
      operationId: openAiTranscription
      security:
        - BearerAuth: []
      parameters:
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs in preferred order. Providers not listed remain eligible.
          style: form
          explode: false
          name: provider_order
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs. Only these providers may serve the request.
          style: form
          explode: false
          name: provider_only
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs that must not serve the request.
          style: form
          explode: false
          name: provider_ignore
          in: query
        - schema:
            type: boolean
          required: false
          description: Set to `false` to prevent fallback to another provider. Automatic provider retries are not currently supported.
          name: allow_fallbacks
          in: query
        - schema:
            type: object
            additionalProperties:
              type: string
            anyOf:
              - $ref: "#/components/schemas/DeepgramSttOptions"
              - $ref: "#/components/schemas/ElevenLabsSttOptions"
              - $ref: "#/components/schemas/SonioxSttOptions"
              - $ref: "#/components/schemas/AssemblyaiSttOptions"
              - $ref: "#/components/schemas/GroqSttOptions"
              - $ref: "#/components/schemas/GrokSttOptions"
              - $ref: "#/components/schemas/CartesiaSttOptions"
              - $ref: "#/components/schemas/OpenaiSttOptions"
              - $ref: "#/components/schemas/GeminiSttOptions"
              - $ref: "#/components/schemas/QwenSttOptions"
          required: false
          description: Provider-specific options in bracket notation, such as `provider_options[encoding]=linear16`. You can also pass supported options directly as query parameters. If both forms set the same option, the bracketed value takes precedence.
          style: deepObject
          explode: true
          name: provider_options
          in: query
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: "#/components/schemas/OpenAiTranscriptionBody"
      responses:
        "200":
          description: Transcription result.
          content:
            application/json:
              schema:
                type: object
                properties:
                  text:
                    type: string
                  words:
                    type: array
                    items:
                      $ref: "#/components/schemas/OpenAiTimestampWord"
                    description: Word-level timestamps; present only for `verbose_json` with word granularity.
                  segments:
                    type: array
                    items:
                      $ref: "#/components/schemas/OpenAiTimestampSegment"
                    description: Segment-level timestamps; present for verbose and diarized JSON responses.
                additionalProperties: {}
            text/plain:
              schema:
                type: string
            text/vtt:
              schema:
                type: string
            application/x-subrip:
              schema:
                type: string
            text/event-stream:
              schema:
                type: string
        "400":
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
        "401":
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
        "402":
          description: Insufficient balance.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
        "403":
          description: Provider forbidden.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
        "422":
          description: Unprocessable request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
        "502":
          description: Provider request failed.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
  /oai/realtime:
    get:
      tags:
        - OpenAI SDK
      summary: OpenAI SDK-compatible realtime transcription
      description: |-
        Streams input audio and receives OpenAI realtime transcription events. Set `intent=transcription`; use `/oai/audio/speech` to stream generated speech. Node and Python clients use Bearer authentication. Browser clients can pass `realtime` and `openai-insecure-api-key.<allmodels-key>` as WebSocket subprotocols. Send OpenAI's nested `session.update` before audio. `turn_detection: null`, `server_vad`, and `semantic_vad` translate to portable manual, acoustic, and semantic intent for the selected provider. Unsupported configurations arrive as official OpenAI `error` events. Query-level `provider_options[...]` remains the native override extension.



        The message-level protocol is documented at [/docs/realtime](/docs/realtime) (AsyncAPI spec: [/asyncapi.yaml](/asyncapi.yaml)).
      operationId: openAiRealtime
      security:
        - BearerAuth: []
      parameters:
        - schema:
            type: string
            enum:
              - transcription
          required: false
          description: Realtime mode. Only `transcription` is supported.
          name: intent
          in: query
        - schema:
            type: string
          required: false
          description: Realtime transcription model, preferably using `{author}/{modelName}`.
          name: model
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs in preferred order. Providers not listed remain eligible.
          style: form
          explode: false
          name: provider_order
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs. Only these providers may serve the request.
          style: form
          explode: false
          name: provider_only
          in: query
        - schema:
            type: array
            items:
              type: string
          required: false
          description: Comma-separated or repeated provider IDs that must not serve the request.
          style: form
          explode: false
          name: provider_ignore
          in: query
        - schema:
            type: boolean
          required: false
          description: Set to `false` to prevent fallback to another provider. Automatic provider retries are not currently supported.
          name: allow_fallbacks
          in: query
        - schema:
            type: object
            additionalProperties:
              type: string
            anyOf:
              - $ref: "#/components/schemas/DeepgramSttOptions"
              - $ref: "#/components/schemas/ElevenLabsSttOptions"
              - $ref: "#/components/schemas/SonioxSttOptions"
              - $ref: "#/components/schemas/AssemblyaiSttOptions"
              - $ref: "#/components/schemas/GroqSttOptions"
              - $ref: "#/components/schemas/GrokSttOptions"
              - $ref: "#/components/schemas/CartesiaSttOptions"
              - $ref: "#/components/schemas/OpenaiSttOptions"
              - $ref: "#/components/schemas/GeminiSttOptions"
              - $ref: "#/components/schemas/QwenSttOptions"
          required: false
          description: Provider-specific options in bracket notation, such as `provider_options[encoding]=linear16`. Provider-native names are accepted only inside this namespace; unknown bare query parameters are rejected.
          style: deepObject
          explode: true
          name: provider_options
          in: query
        - schema:
            type: string
            const: websocket
          required: true
          description: Must be websocket to perform the protocol upgrade.
          name: Upgrade
          in: header
      responses:
        "101":
          description: WebSocket upgraded.
        "400":
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
        "401":
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
        "402":
          description: Insufficient balance.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
        "403":
          description: Provider forbidden.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
        "422":
          description: Unprocessable request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
        "426":
          description: WebSocket upgrade required.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
        "502":
          description: Provider request failed.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OpenAiError"
  /el/v1/speech-engine:
    post:
      tags:
        - ElevenLabs SDK
      summary: Create Speech Engine
      description: Creates a reusable Speech Engine configuration that connects client audio to STT, forwards transcripts to your application, and streams synthesized responses back to the client.
      operationId: speechEngineCreate
      x-codeSamples:
        - lang: TypeScript
          label: ElevenLabs SDK
          source: |-
            import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";

            const elevenlabs = new ElevenLabsClient({
              apiKey: process.env.ALLMODELS_API_KEY,
              baseUrl: "https://api.allmodels.io/el",
            });

            const engine = await elevenlabs.speechEngine.create({
              name: "Support agent", // optional
              speechEngine: {
                wsUrl: "wss://app.example.com/voice-agent",
                requestHeaders: {
                  authorization: "Bearer YOUR_APPLICATION_TOKEN",
                }, // optional
              },
              asr: {
                userInputAudioFormat: "pcm_16000", // optional
              },
              tts: {
                voiceId: "YOUR_CARTESIA_VOICE_ID",
                agentOutputAudioFormat: "pcm_16000", // optional
                speed: 1.1, // optional
              },
              language: "en", // optional
            }, {
              queryParams: {
                stt: { model: "deepgram/nova-3" },
                tts: { model: "cartesia/sonic-3" },
              },
            });

            console.log(engine.engineId);
        - lang: Python
          label: ElevenLabs SDK
          source: |-
            import os
            from elevenlabs.client import ElevenLabs
            from elevenlabs.types import (
                AsrConversationalConfig,
                SpeechEngineConfig,
                TtsConversationalConfigInput,
            )

            client = ElevenLabs(
                api_key=os.environ["ALLMODELS_API_KEY"],
                base_url="https://api.allmodels.io/el",
            )

            engine = client.speech_engine.create(
                name="Support agent",  # optional
                speech_engine=SpeechEngineConfig(
                    ws_url="wss://app.example.com/voice-agent",
                    request_headers={
                        "authorization": "Bearer YOUR_APPLICATION_TOKEN",
                    },  # optional
                ),
                asr=AsrConversationalConfig(
                    user_input_audio_format="pcm_16000",  # optional
                ),
                tts=TtsConversationalConfigInput(
                    voice_id="YOUR_CARTESIA_VOICE_ID",
                    agent_output_audio_format="pcm_16000",  # optional
                    speed=1.1,  # optional
                ),
                language="en",  # optional
                request_options={
                    "additional_query_parameters": {
                        "stt[model]": "deepgram/nova-3",
                        "tts[model]": "cartesia/sonic-3",
                    }
                },
            )

            print(engine.engine_id)
      security:
        - XiApiKey: []
        - BearerAuth: []
      parameters:
        - schema:
            type: string
            description: AllModels streaming STT model. The router selects an eligible provider automatically.
          required: false
          description: AllModels streaming STT model. The router selects an eligible provider automatically.
          name: stt[model]
          in: query
        - schema:
            type: string
            description: Optional STT provider pin. Omit to use automatic provider routing.
          required: false
          description: Optional STT provider pin. Omit to use automatic provider routing.
          name: stt[provider]
          in: query
        - schema:
            type: string
            description: "Provider-specific STT setting with no standard Speech Engine field. Replace `name` with the option name; the JavaScript SDK accepts `stt: { provider_options: { ... } }`."
          required: false
          description: "Provider-specific STT setting with no standard Speech Engine field. Replace `name` with the option name; the JavaScript SDK accepts `stt: { provider_options: { ... } }`."
          name: stt[provider_options][name]
          in: query
        - schema:
            type: string
            description: "Portable STT setting with no standard Speech Engine field, such as `turn_detection`. Replace `name` with the setting name; the JavaScript SDK accepts `stt: { input: { ... } }`."
          required: false
          description: "Portable STT setting with no standard Speech Engine field, such as `turn_detection`. Replace `name` with the setting name; the JavaScript SDK accepts `stt: { input: { ... } }`."
          name: stt[input][name]
          in: query
        - schema:
            type: string
            description: AllModels streaming TTS model. The router selects an eligible provider automatically.
          required: false
          description: AllModels streaming TTS model. The router selects an eligible provider automatically.
          name: tts[model]
          in: query
        - schema:
            type: string
            description: Optional TTS provider pin. Omit to use automatic provider routing.
          required: false
          description: Optional TTS provider pin. Omit to use automatic provider routing.
          name: tts[provider]
          in: query
        - schema:
            type: string
            description: "Provider-specific TTS setting with no standard Speech Engine field. Replace `name` with the option name; the JavaScript SDK accepts `tts: { provider_options: { ... } }`."
          required: false
          description: "Provider-specific TTS setting with no standard Speech Engine field. Replace `name` with the option name; the JavaScript SDK accepts `tts: { provider_options: { ... } }`."
          name: tts[provider_options][name]
          in: query
        - schema:
            type: string
            description: Portable TTS setting with no standard Speech Engine field. Supported names are `text_buffer_mode`, `text_buffer_min_characters`, `text_buffer_target_characters`, `text_buffer_max_characters`, and `instructions` — a free-form delivery direction of at most 4096 characters, which restricts the profile to bindings that honor one.
          required: false
          description: Portable TTS setting with no standard Speech Engine field. Supported names are `text_buffer_mode`, `text_buffer_min_characters`, `text_buffer_target_characters`, `text_buffer_max_characters`, and `instructions` — a free-form delivery direction of at most 4096 characters, which restricts the profile to bindings that honor one.
          name: tts[input][name]
          in: query
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SpeechEngineRequest"
      responses:
        "201":
          description: ElevenLabs-compatible Speech Engine.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SpeechEngine"
        "401":
          description: 'The AllModels API key is missing or invalid. Authentication errors use `{ "error": "<code>" }`.'
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              examples:
                missingApiKey:
                  value:
                    error: missing_api_key
                invalidApiKey:
                  value:
                    error: invalid_api_key
        "413":
          description: Invalid profile, retention, upstream URL/header, model, or audio format.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
        "422":
          description: Invalid profile, retention, upstream URL/header, model, or audio format.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
        "503":
          description: The Speech Engine service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
    get:
      tags:
        - ElevenLabs SDK
      summary: List Speech Engines
      description: Lists the permanent Speech Engines available to the authenticated project.
      operationId: speechEngineList
      x-codeSamples:
        - lang: TypeScript
          label: ElevenLabs SDK
          source: |-
            import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";

            const elevenlabs = new ElevenLabsClient({
              apiKey: process.env.ALLMODELS_API_KEY,
              baseUrl: "https://api.allmodels.io/el",
            });

            const page = await elevenlabs.speechEngine.list({
              pageSize: 20,
              sortDirection: "desc",
            });

            console.log(page.speechEngines);
        - lang: Python
          label: ElevenLabs SDK
          source: |-
            import os
            from elevenlabs.client import ElevenLabs

            client = ElevenLabs(
                api_key=os.environ["ALLMODELS_API_KEY"],
                base_url="https://api.allmodels.io/el",
            )

            page = client.speech_engine.list(
                page_size=20,
                sort_direction="desc",
            )

            print(page.speech_engines)
      security:
        - XiApiKey: []
        - BearerAuth: []
      parameters:
        - schema:
            type: integer
            minimum: 1
            maximum: 100
          required: false
          name: page_size
          in: query
        - schema:
            type: string
          required: false
          name: search
          in: query
        - schema:
            type: string
            enum:
              - asc
              - desc
          required: false
          name: sort_direction
          in: query
        - schema:
            type: string
          required: false
          name: sort_by
          in: query
        - schema:
            type: string
          required: false
          name: cursor
          in: query
      responses:
        "200":
          description: Paginated Speech Engine summaries.
          content:
            application/json:
              schema:
                type: object
                properties:
                  speech_engines:
                    type: array
                    items:
                      type: object
                      properties:
                        speech_engine_id:
                          type: string
                        name:
                          type: string
                      required:
                        - speech_engine_id
                        - name
                      additionalProperties: {}
                  next_cursor:
                    type:
                      - string
                      - "null"
                  has_more:
                    type: boolean
                required:
                  - speech_engines
                  - next_cursor
                  - has_more
        "401":
          description: 'The AllModels API key is missing or invalid. Authentication errors use `{ "error": "<code>" }`.'
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              examples:
                missingApiKey:
                  value:
                    error: missing_api_key
                invalidApiKey:
                  value:
                    error: invalid_api_key
        "503":
          description: The Speech Engine service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
  /el/v1/speech-engine/{speech_engine_id}:
    get:
      tags:
        - ElevenLabs SDK
      summary: Get Speech Engine
      description: Returns one Speech Engine configuration.
      operationId: speechEngineGet
      x-codeSamples:
        - lang: TypeScript
          label: ElevenLabs SDK
          source: |-
            import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";

            const elevenlabs = new ElevenLabsClient({
              apiKey: process.env.ALLMODELS_API_KEY,
              baseUrl: "https://api.allmodels.io/el",
            });

            const engine = await elevenlabs.speechEngine.get("seng_01JZ8H4B1M4YDQ3Z4MXN8D0Q1A");
        - lang: Python
          label: ElevenLabs SDK
          source: |-
            import os
            from elevenlabs.client import ElevenLabs

            client = ElevenLabs(
                api_key=os.environ["ALLMODELS_API_KEY"],
                base_url="https://api.allmodels.io/el",
            )

            engine = client.speech_engine.get("seng_01JZ8H4B1M4YDQ3Z4MXN8D0Q1A")
      security:
        - XiApiKey: []
        - BearerAuth: []
      parameters:
        - schema:
            type: string
            example: seng_01JZ8H4B1M4YDQ3Z4MXN8D0Q1A
          required: true
          name: speech_engine_id
          in: path
      responses:
        "200":
          description: ElevenLabs-compatible Speech Engine.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SpeechEngine"
        "401":
          description: 'The AllModels API key is missing or invalid. Authentication errors use `{ "error": "<code>" }`.'
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              examples:
                missingApiKey:
                  value:
                    error: missing_api_key
                invalidApiKey:
                  value:
                    error: invalid_api_key
        "404":
          description: Speech Engine not found.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
        "503":
          description: The Speech Engine service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
    patch:
      tags:
        - ElevenLabs SDK
      summary: Update Speech Engine
      description: Replaces the configurable fields of a Speech Engine.
      operationId: speechEngineUpdate
      x-codeSamples:
        - lang: TypeScript
          label: ElevenLabs SDK
          source: |-
            import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";

            const elevenlabs = new ElevenLabsClient({
              apiKey: process.env.ALLMODELS_API_KEY,
              baseUrl: "https://api.allmodels.io/el",
            });

            const engine = await elevenlabs.speechEngine.update(
              "seng_01JZ8H4B1M4YDQ3Z4MXN8D0Q1A",
              { name: "Updated support agent" },
            );
        - lang: Python
          label: ElevenLabs SDK
          source: |-
            import os
            from elevenlabs.client import ElevenLabs

            client = ElevenLabs(
                api_key=os.environ["ALLMODELS_API_KEY"],
                base_url="https://api.allmodels.io/el",
            )

            engine = client.speech_engine.update(
                "seng_01JZ8H4B1M4YDQ3Z4MXN8D0Q1A",
                name="Updated support agent",
            )
      security:
        - XiApiKey: []
        - BearerAuth: []
      parameters:
        - schema:
            type: string
            example: seng_01JZ8H4B1M4YDQ3Z4MXN8D0Q1A
          required: true
          name: speech_engine_id
          in: path
        - schema:
            type: string
            description: AllModels streaming STT model. The router selects an eligible provider automatically.
          required: false
          description: AllModels streaming STT model. The router selects an eligible provider automatically.
          name: stt[model]
          in: query
        - schema:
            type: string
            description: Optional STT provider pin. Omit to use automatic provider routing.
          required: false
          description: Optional STT provider pin. Omit to use automatic provider routing.
          name: stt[provider]
          in: query
        - schema:
            type: string
            description: "Provider-specific STT setting with no standard Speech Engine field. Replace `name` with the option name; the JavaScript SDK accepts `stt: { provider_options: { ... } }`."
          required: false
          description: "Provider-specific STT setting with no standard Speech Engine field. Replace `name` with the option name; the JavaScript SDK accepts `stt: { provider_options: { ... } }`."
          name: stt[provider_options][name]
          in: query
        - schema:
            type: string
            description: "Portable STT setting with no standard Speech Engine field, such as `turn_detection`. Replace `name` with the setting name; the JavaScript SDK accepts `stt: { input: { ... } }`."
          required: false
          description: "Portable STT setting with no standard Speech Engine field, such as `turn_detection`. Replace `name` with the setting name; the JavaScript SDK accepts `stt: { input: { ... } }`."
          name: stt[input][name]
          in: query
        - schema:
            type: string
            description: AllModels streaming TTS model. The router selects an eligible provider automatically.
          required: false
          description: AllModels streaming TTS model. The router selects an eligible provider automatically.
          name: tts[model]
          in: query
        - schema:
            type: string
            description: Optional TTS provider pin. Omit to use automatic provider routing.
          required: false
          description: Optional TTS provider pin. Omit to use automatic provider routing.
          name: tts[provider]
          in: query
        - schema:
            type: string
            description: "Provider-specific TTS setting with no standard Speech Engine field. Replace `name` with the option name; the JavaScript SDK accepts `tts: { provider_options: { ... } }`."
          required: false
          description: "Provider-specific TTS setting with no standard Speech Engine field. Replace `name` with the option name; the JavaScript SDK accepts `tts: { provider_options: { ... } }`."
          name: tts[provider_options][name]
          in: query
        - schema:
            type: string
            description: Portable TTS setting with no standard Speech Engine field. Supported names are `text_buffer_mode`, `text_buffer_min_characters`, `text_buffer_target_characters`, `text_buffer_max_characters`, and `instructions` — a free-form delivery direction of at most 4096 characters, which restricts the profile to bindings that honor one.
          required: false
          description: Portable TTS setting with no standard Speech Engine field. Supported names are `text_buffer_mode`, `text_buffer_min_characters`, `text_buffer_target_characters`, `text_buffer_max_characters`, and `instructions` — a free-form delivery direction of at most 4096 characters, which restricts the profile to bindings that honor one.
          name: tts[input][name]
          in: query
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SpeechEngineRequest"
      responses:
        "200":
          description: ElevenLabs-compatible Speech Engine.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SpeechEngine"
        "401":
          description: 'The AllModels API key is missing or invalid. Authentication errors use `{ "error": "<code>" }`.'
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              examples:
                missingApiKey:
                  value:
                    error: missing_api_key
                invalidApiKey:
                  value:
                    error: invalid_api_key
        "404":
          description: Speech Engine not found.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
        "413":
          description: Invalid profile, retention, upstream URL/header, model, or audio format.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
        "422":
          description: Invalid profile, retention, upstream URL/header, model, or audio format.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
        "503":
          description: The Speech Engine service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
    delete:
      tags:
        - ElevenLabs SDK
      summary: Delete Speech Engine
      description: Deletes a Speech Engine so it can no longer issue new signed URLs.
      operationId: speechEngineDelete
      x-codeSamples:
        - lang: TypeScript
          label: ElevenLabs SDK
          source: |-
            import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";

            const elevenlabs = new ElevenLabsClient({
              apiKey: process.env.ALLMODELS_API_KEY,
              baseUrl: "https://api.allmodels.io/el",
            });

            await elevenlabs.speechEngine.delete("seng_01JZ8H4B1M4YDQ3Z4MXN8D0Q1A");
        - lang: Python
          label: ElevenLabs SDK
          source: |-
            import os
            from elevenlabs.client import ElevenLabs

            client = ElevenLabs(
                api_key=os.environ["ALLMODELS_API_KEY"],
                base_url="https://api.allmodels.io/el",
            )

            client.speech_engine.delete("seng_01JZ8H4B1M4YDQ3Z4MXN8D0Q1A")
      security:
        - XiApiKey: []
        - BearerAuth: []
      parameters:
        - schema:
            type: string
            example: seng_01JZ8H4B1M4YDQ3Z4MXN8D0Q1A
          required: true
          name: speech_engine_id
          in: path
      responses:
        "204":
          description: Speech Engine deleted.
        "401":
          description: 'The AllModels API key is missing or invalid. Authentication errors use `{ "error": "<code>" }`.'
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              examples:
                missingApiKey:
                  value:
                    error: missing_api_key
                invalidApiKey:
                  value:
                    error: invalid_api_key
        "404":
          description: Speech Engine not found.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
        "503":
          description: The Speech Engine service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
  /el/v1/convai/conversation/get-signed-url:
    get:
      tags:
        - ElevenLabs SDK
      summary: Get Speech Engine signed URL
      description: Returns a short-lived, single-use WebSocket URL that a browser or mobile client can open without receiving your AllModels API key.
      operationId: speechEngineSignedUrl
      x-codeSamples:
        - lang: TypeScript
          label: ElevenLabs SDK
          source: |-
            import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";

            const elevenlabs = new ElevenLabsClient({
              apiKey: process.env.ALLMODELS_API_KEY,
              baseUrl: "https://api.allmodels.io/el",
            });

            const { signedUrl, conversationId } =
              await elevenlabs.conversationalAi.conversations.getSignedUrl({
                agentId: "seng_01JZ8H4B1M4YDQ3Z4MXN8D0Q1A",
                includeConversationId: true,
              });

            console.log({ signedUrl, conversationId });
        - lang: Python
          label: ElevenLabs SDK
          source: |-
            import os
            from elevenlabs.client import ElevenLabs

            client = ElevenLabs(
                api_key=os.environ["ALLMODELS_API_KEY"],
                base_url="https://api.allmodels.io/el",
            )

            grant = client.conversational_ai.conversations.get_signed_url(
                agent_id="seng_01JZ8H4B1M4YDQ3Z4MXN8D0Q1A",
                include_conversation_id=True,
            )

            print(grant.signed_url)
      security:
        - XiApiKey: []
        - BearerAuth: []
      parameters:
        - schema:
            type: string
          required: true
          name: agent_id
          in: query
        - schema:
            type: string
            enum:
              - "0"
              - "1"
              - "true"
              - "false"
          required: false
          name: include_conversation_id
          in: query
      responses:
        "200":
          description: Short-lived direct-client URL.
          content:
            application/json:
              schema:
                type: object
                properties:
                  signed_url:
                    type: string
                  conversation_id:
                    type: string
                required:
                  - signed_url
        "401":
          description: 'The AllModels API key is missing or invalid. Authentication errors use `{ "error": "<code>" }`.'
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              examples:
                missingApiKey:
                  value:
                    error: missing_api_key
                invalidApiKey:
                  value:
                    error: invalid_api_key
        "402":
          description: The organization's balance is too low to start the request.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: this organization has insufficient prepaid balance
                  status: insufficient_balance
        "403":
          description: The organization is disabled or the key cannot use the selected provider. Organization errors use `{ "error" }`; provider errors use the ElevenLabs-compatible `{ "detail" }` response.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/NativeError"
                  - $ref: "#/components/schemas/SdkError"
              examples:
                tenantDisabled:
                  value:
                    error: tenant_disabled
                providerNotAllowed:
                  value:
                    detail:
                      message: no allowed provider candidate matched this request
                      status: provider_not_allowed
                      tried:
                        - minimax
                        - elevenlabs
        "404":
          description: Speech Engine not found.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
        "422":
          description: Invalid profile, retention, upstream URL/header, model, or audio format.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
        "503":
          description: The Speech Engine service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
  /v1/realtime/profiles:
    post:
      tags:
        - Realtime
      summary: Create a Realtime profile
      description: Creates a reusable STT → application → TTS configuration.
      operationId: realtimeProfileCreate
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RealtimeProfileRequest"
      responses:
        "201":
          description: Realtime profile.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RealtimeProfile"
        "401":
          description: The Authorization Bearer token is missing or invalid.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: missing_api_key
        "422":
          description: The Realtime configuration is invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - type
                      - code
                      - message
                    additionalProperties: {}
                required:
                  - error
        "503":
          description: The Realtime service is temporarily unavailable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - type
                      - code
                      - message
                    additionalProperties: {}
                required:
                  - error
    get:
      tags:
        - Realtime
      summary: List Realtime profiles
      operationId: realtimeProfileList
      security:
        - BearerAuth: []
      parameters:
        - schema:
            type: integer
            minimum: 1
            maximum: 100
          required: false
          name: page_size
          in: query
        - schema:
            type: string
          required: false
          name: search
          in: query
        - schema:
            type: string
            enum:
              - asc
              - desc
          required: false
          name: sort_direction
          in: query
        - schema:
            type: string
          required: false
          name: cursor
          in: query
      responses:
        "200":
          description: Paginated Realtime profiles.
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    enum:
                      - list
                  data:
                    type: array
                    items:
                      $ref: "#/components/schemas/RealtimeProfile"
                  has_more:
                    type: boolean
                  next_cursor:
                    type:
                      - string
                      - "null"
                required:
                  - object
                  - data
                  - has_more
                  - next_cursor
        "401":
          description: The Authorization Bearer token is missing or invalid.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: missing_api_key
        "503":
          description: The Realtime service is temporarily unavailable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - type
                      - code
                      - message
                    additionalProperties: {}
                required:
                  - error
  /v1/realtime/profiles/{profile_id}:
    get:
      tags:
        - Realtime
      summary: Get a Realtime profile
      operationId: realtimeProfileGet
      security:
        - BearerAuth: []
      parameters:
        - schema:
            type: string
            example: rtp_01K0EXAMPLE
            description: Realtime profile to use.
          required: true
          description: Realtime profile to use.
          name: profile_id
          in: path
      responses:
        "200":
          description: Realtime profile.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RealtimeProfile"
        "401":
          description: The Authorization Bearer token is missing or invalid.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: missing_api_key
        "404":
          description: Realtime profile not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - type
                      - code
                      - message
                    additionalProperties: {}
                required:
                  - error
        "503":
          description: The Realtime service is temporarily unavailable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - type
                      - code
                      - message
                    additionalProperties: {}
                required:
                  - error
    patch:
      tags:
        - Realtime
      summary: Update a Realtime profile
      operationId: realtimeProfileUpdate
      security:
        - BearerAuth: []
      parameters:
        - schema:
            type: string
            example: rtp_01K0EXAMPLE
            description: Realtime profile to use.
          required: true
          description: Realtime profile to use.
          name: profile_id
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RealtimeProfilePatch"
      responses:
        "200":
          description: Realtime profile.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RealtimeProfile"
        "401":
          description: The Authorization Bearer token is missing or invalid.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: missing_api_key
        "404":
          description: Realtime profile not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - type
                      - code
                      - message
                    additionalProperties: {}
                required:
                  - error
        "422":
          description: The Realtime configuration is invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - type
                      - code
                      - message
                    additionalProperties: {}
                required:
                  - error
        "503":
          description: The Realtime service is temporarily unavailable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - type
                      - code
                      - message
                    additionalProperties: {}
                required:
                  - error
    delete:
      tags:
        - Realtime
      summary: Delete a Realtime profile
      operationId: realtimeProfileDelete
      security:
        - BearerAuth: []
      parameters:
        - schema:
            type: string
            example: rtp_01K0EXAMPLE
            description: Realtime profile to use.
          required: true
          description: Realtime profile to use.
          name: profile_id
          in: path
      responses:
        "204":
          description: Profile deleted.
        "401":
          description: The Authorization Bearer token is missing or invalid.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: missing_api_key
        "404":
          description: Realtime profile not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - type
                      - code
                      - message
                    additionalProperties: {}
                required:
                  - error
        "503":
          description: The Realtime service is temporarily unavailable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - type
                      - code
                      - message
                    additionalProperties: {}
                required:
                  - error
  /v1/realtime/client-secrets:
    post:
      tags:
        - Realtime
      summary: Create a Realtime client secret
      description: Creates credentials for an untrusted client, such as a browser or mobile app, to connect directly to AllModels without receiving your API key.
      operationId: realtimeClientSecretCreate
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                profile_id:
                  type: string
                  description: Existing Realtime profile to use. Provide either profile_id or profile.
                profile:
                  allOf:
                    - $ref: "#/components/schemas/RealtimeProfileRequest"
                    - description: Inline ephemeral profile. Provide either profile or profile_id.
                expires_in_seconds:
                  type: integer
                  minimum: 30
                  maximum: 900
                  description: How long the client may wait before opening the WebSocket.
                overrides:
                  type: object
                  additionalProperties: {}
                  description: Session-only profile overrides; the saved profile is not changed.
              additionalProperties: {}
      responses:
        "200":
          description: Single-use client secret and direct WebSocket URL.
          content:
            application/json:
              schema:
                type: object
                properties:
                  session_id:
                    type: string
                  profile_id:
                    type: string
                  client_secret:
                    type: object
                    properties:
                      value:
                        type: string
                      expires_at:
                        type: number
                    required:
                      - value
                      - expires_at
                  url:
                    type: string
                required:
                  - session_id
                  - profile_id
                  - client_secret
                  - url
                additionalProperties: {}
        "401":
          description: The Authorization Bearer token is missing or invalid.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NativeError"
              example:
                error: missing_api_key
        "402":
          description: The organization's balance is too low to start the session.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SdkError"
              example:
                detail:
                  message: this organization has insufficient prepaid balance
                  status: insufficient_balance
        "403":
          description: The organization is disabled or the API key cannot use a provider that matches the profile.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: "#/components/schemas/NativeError"
                  - $ref: "#/components/schemas/SdkError"
              examples:
                tenantDisabled:
                  value:
                    error: tenant_disabled
                providerNotAllowed:
                  value:
                    detail:
                      message: no allowed provider candidate matched this request
                      status: provider_not_allowed
                      tried:
                        - deepgram
                        - elevenlabs
        "422":
          description: The Realtime configuration is invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - type
                      - code
                      - message
                    additionalProperties: {}
                required:
                  - error
        "503":
          description: The Realtime service is temporarily unavailable.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - type
                      - code
                      - message
                    additionalProperties: {}
                required:
                  - error
webhooks: {}
