PyAI Dub API

Asynchronous dubbing: submit a recording, choose the languages, poll the job and download the output.

GitHub OpenAPI

Operations 10

GET /v1/dub/jobs/{job_id}/editor Read editable dubbing passages #
PATCH /v1/dub/jobs/{job_id}/editor Save transcript, translation and pronunciation edits #
POST /v1/dub/jobs/{job_id}/revisions Regenerate selected passages as a new dub #
GET /v1/dub/jobs/{job_id}/subtitles.{format} Export original or translated subtitles #
GET /v1/dub/jobs/{job_id}/source Load the original audio for comparison #
GET /healthz/dub Dubbing availability and languages #
POST /v1/dub Create a dubbing job #
GET /v1/dub/jobs/{job_id} Get dubbing job status #
GET /v1/dub/jobs/{job_id}/audio Download dubbed audio #
GET /v1/dub/jobs/{job_id}/video Download a dubbed video output #

Specifications

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/pyai-com:pyai-com-dub-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

pyai-com-dub-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: PyAI Dub API
  version: 2.14.0
  description: 'Telephony-native Voice AI behind one bearer key:


    - **Hear**, speech-to-text · `POST /v1/audio/transcriptions` (streaming + batch)

    - **Speak**, text-to-speech · `POST /v1/audio/speech`, `GET /v1/voices`

    - **Clone**, custom voices from a short clip · `/v1/voice/clones`

    - **Cast**, auto-directed expressive voiceovers · `/v1/cast`

    - **Dub**, asynchronous audio and video dubbing · `POST /v1/dub` (guide)

    - **Cue configuration frames (reserved)**; Hear streams skip knowledge-base retrieval by default

    - **Omni**, full-duplex agentic voice (speech-to-speech, grounded in your knowledge bases + tools) · `/v1/omni`

    - **Knowledge Bases**, hosted grounding for Omni: create bases, add documents (file, URL, or text), crawl a public website, bind to agents or org defaults · `/v1/knowledgebases`

    - **AMD API**, answering-machine detection: know *who or what* answered a call (human, voicemail, IVR, iPhone/Google screening, dead number) with the reason it decided · `wss …/v1/amd/stream` (Twilio Media Streams drop-in), `POST /v1/amd/config`, `GET /v1/amd/calls/{id}`

    - **Agents Beta**, the live console feature to create, configure, test, and connect Omni voice agents without code. Beta features and limits may change. ## Identity, billing and authentication

    - Before any generation or transcription, call GET /v1/me (MCP: whoami). Verify org_id, project_id, environment, scopes, limits and billing/credit context against the intended project. Do not infer identity or free usage from a key prefix or tool name. Stop on a mismatch or unknown budget; never switch to a live project automatically. - Test usage has enforced limits; live usage is billed. Current meters and rates: https://pyai.com/pricing. Agree a bounded input/request count before generating, and do not retry uncertain billable submissions blindly. Create a key in the console (it is shown once) and send it as a bearer token:


    ```

    Authorization: Bearer pyai_live_... ```


    Keys are environment-scoped: `pyai_live_...` (production) and `pyai_test_...` (sandbox). `POST /v1/sandbox/keys` creates an instant, short-lived test key without login or billing. Account signup also creates a sandbox key. Live keys consume prepaid credit; phone verification may unlock promotional credit under graduated-signup rules, but credit is not guaranteed at signup. Keys are self-validating signed tokens: they work on every PyAI surface the instant they are created, no activation or propagation delay. Treat them as opaque strings (up to 512 chars) and never parse their contents. Keep long-lived keys on trusted servers. For Omni browsers, mint an origin-locked short-lived token on your backend with POST /v1/omni/sessions; never expose a live or test API key in browser code. Offer the protocol marker and session token:


    ```

    Sec-WebSocket-Protocol: pyai.v1, pyai-key. ```


    (server-side clients may instead append `?api_key=...` to the URL). Your key is authenticated on the upgrade and never reaches the model. ## Quickstart, Hear (speech-to-text)


    ```

    curl https://api.pyai.com/v1/audio/transcriptions \

    -H "Authorization: Bearer $PYAI_API_KEY" \

    -F file=@audio.wav -F model=pyai-hear

    # -> { "text": "..." }

    ```


    ## Quickstart, Speak (text-to-speech)


    ```

    curl https://api.pyai.com/v1/audio/speech \

    -H "Authorization: Bearer $PYAI_API_KEY" \

    -H "Content-Type: application/json" \

    -d ''{"model":"pyai-speak","input":"Hello from PyAI.","voice":"voice_abc"}'' \

    --output speech.wav

    ```


    `voice` is a stock voice id from `GET /v1/voices` (the curated prebuilt catalog with personas and avatars) or a cloned voice id from `/v1/voice/clones`. Omit it to use the platform default voice (`stock_dorit_en_us`).'
  contact:
    name: PyAI
    url: https://pyai.com
servers:
- url: https://api.pyai.com
  description: Production
security:
- apiKey: []
- xApiKey: []
tags:
- name: Dub
  description: 'Asynchronous dubbing: submit a recording, choose the languages, poll the job and download the output.'
paths:
  /v1/dub/jobs/{job_id}/editor:
    get:
      tags:
      - Dub
      operationId: getDubEditor
      summary: Read editable dubbing passages
      parameters:
      - name: job_id
        in: path
        required: true
        schema:
          type: string
      description: Requires dub:render. Read source transcript, displayed translation, optional spoken pronunciation text, and source/output times. rendered holds the text matching the current audio; changed marks saved edits awaiting regeneration. Available when job.editable is true. No delivery units are charged.
      responses:
        '200':
          description: Saved editor snapshot.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DubEditor'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          description: The product key lacks dub:render.
        '404':
          description: 'unknown_job: no matching job in the calling organization.'
        '409':
          description: 'job_not_done: poll the status endpoint before downloading.'
        '429':
          description: Rate/concurrency limit or dub_busy. Retry with backoff.
        '503':
          description: Dubbing is unavailable. Retry with backoff.
    patch:
      tags:
      - Dub
      operationId: saveDubEdits
      summary: Save transcript, translation and pronunciation edits
      parameters:
      - name: job_id
        in: path
        required: true
        schema:
          type: string
      description: Save draft text without generating audio or changing current subtitles. Include the latest revision to prevent overwriting another tab. A revision mismatch returns 409 dub_edit_conflict. No delivery units are charged.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DubEdits'
      responses:
        '200':
          description: Updated saved editor with a new revision number.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DubEditor'
        '400':
          description: 'dub_invalid_edit: invalid text or passage.'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          description: The product key lacks dub:render.
        '404':
          description: 'unknown_job: no matching job in the calling organization.'
        '409':
          description: dub_edit_conflict or dub_editor_unavailable.
        '429':
          description: Rate/concurrency limit or dub_busy. Retry with backoff.
        '503':
          description: Dubbing is unavailable. Retry with backoff.
  /v1/dub/jobs/{job_id}/revisions:
    post:
      tags:
      - Dub
      operationId: createDubRevision
      summary: Regenerate selected passages as a new dub
      parameters:
      - name: job_id
        in: path
        required: true
        schema:
          type: string
      - name: Idempotency-Key
        in: header
        required: true
        schema:
          type: string
          pattern: ^[A-Za-z0-9_-]{16,128}$
      description: Create a new asynchronous job using saved edits for 1–50 selected passages and the existing rendered audio for all other passages. The previous job is unchanged. If only a passage's source text changed, its translation is refreshed. A supplied pronunciation_text is the full spoken passage and does not appear in subtitles. Reuse the same Idempotency-Key and body after a lost response. A completed revision counts only the source time covered by selected passages, with overlapping time counted once. Exports carry no additional usage.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DubRevisionInput'
      responses:
        '202':
          description: Revision accepted, or the same previously accepted revision on retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DubRevisionCreated'
        '400':
          description: 'dub_invalid_revision: invalid selection or retry key.'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          description: The product key lacks dub:render.
        '404':
          description: 'unknown_job: no matching job in the calling organization.'
        '409':
          description: dub_edit_conflict, dub_revision_conflict, or dub_editor_unavailable.
        '429':
          description: Rate/concurrency limit or dub_busy. Retry with backoff.
        '503':
          description: Dubbing is unavailable. Retry with backoff.
  /v1/dub/jobs/{job_id}/subtitles.{format}:
    get:
      tags:
      - Dub
      operationId: downloadDubSubtitles
      summary: Export original or translated subtitles
      parameters:
      - name: job_id
        in: path
        required: true
        schema:
          type: string
      - name: format
        in: path
        required: true
        schema:
          type: string
          enum:
          - srt
          - vtt
      - name: track
        in: query
        schema:
          type: string
          enum:
          - source
          - translation
          default: translation
      description: Requires dub:render. Exports text matching the current rendered audio. Source subtitles use source timings; translated subtitles use actual dubbed passage placements and durations. Pending draft edits and pronunciation spellings are excluded. Regenerate edited passages first to export those changes. No delivery units are charged.
      responses:
        '200':
          description: UTF-8 subtitle file.
          content:
            text/vtt:
              schema:
                type: string
            application/x-subrip:
              schema:
                type: string
        '400':
          description: dub_invalid_export.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          description: The product key lacks dub:render.
        '404':
          description: 'unknown_job: no matching job in the calling organization.'
        '409':
          description: 'job_not_done: poll the status endpoint before downloading.'
        '429':
          description: Rate/concurrency limit or dub_busy. Retry with backoff.
        '503':
          description: Dubbing is unavailable. Retry with backoff.
  /v1/dub/jobs/{job_id}/source:
    get:
      tags:
      - Dub
      operationId: downloadDubOriginal
      summary: Load the original audio for comparison
      parameters:
      - name: job_id
        in: path
        required: true
        schema:
          type: string
      description: Requires dub:render and ownership of the completed job. Returns the original audio for comparison, including extracted audio for video sources. No delivery units are charged. Retention matches the job's media retention.
      responses:
        '200':
          description: Original audio.
          content:
            audio/wav:
              schema:
                type: string
                format: binary
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          description: The product key lacks dub:render.
        '404':
          description: 'unknown_job: no matching job in the calling organization.'
        '409':
          description: 'job_not_done: poll the status endpoint before downloading.'
        '410':
          description: media_expired.
        '429':
          description: Rate/concurrency limit or dub_busy. Retry with backoff.
        '503':
          description: Dubbing is unavailable. Retry with backoff.
  /healthz/dub:
    get:
      tags:
      - Dub
      operationId: getDubCapabilities
      summary: Dubbing availability and languages
      security: []
      description: Read the intersection of adapter and worker capabilities. Source and target language lists are independent. No API key is needed.
      responses:
        '200':
          description: Current dubbing capabilities
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DubCapabilities'
        '503':
          description: Dubbing is unavailable
  /v1/dub:
    post:
      tags:
      - Dub
      operationId: createDubJob
      summary: Create a dubbing job
      description: 'Submit exactly one file or source_url as multipart form data. Requires dub:render. Choose a supported source and target language. GET /healthz/dub reports the currently available languages. Processing is asynchronous: keep the returned job_id and poll status_url until done or error.'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/DubJobInput'
      responses:
        '202':
          description: Dubbing job queued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DubJobCreated'
        '400':
          description: Invalid input, unsupported_target_lang, or missing_source (provide exactly one source).
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          description: The product key lacks dub:render.
        '413':
          description: 'file_too_large: upload exceeds the service limit.'
        '415':
          description: 'unsupported_media_type: use an audio or video file.'
        '429':
          description: Rate/concurrency limit or dub_busy. Retry with backoff.
        '503':
          description: Dubbing is unavailable. Retry with backoff.
  /v1/dub/jobs/{job_id}:
    get:
      tags:
      - Dub
      operationId: getDubJob
      summary: Get dubbing job status
      description: Requires dub:render. Jobs belong to the calling organization. queued and running are nonterminal; done and error are terminal. Download outputs only after done. A failed job is returned as HTTP 200 with status error and error_code.
      parameters:
      - name: job_id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Current job state.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DubJob'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          description: The product key lacks dub:render.
        '404':
          description: 'unknown_job: no matching job in the calling organization.'
        '429':
          description: Rate/concurrency limit or dub_busy. Retry with backoff.
        '503':
          description: Dubbing is unavailable. Retry with backoff.
  /v1/dub/jobs/{job_id}/audio:
    get:
      tags:
      - Dub
      operationId: downloadDubAudio
      summary: Download dubbed audio
      description: Requires dub:render. Returns the completed job's WAV audio. Save the output in your application; an expired result must be rendered again. Downloads are included and never create a new generation charge. Job billing uses source-audio duration, not output duration.
      parameters:
      - name: job_id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Dubbed WAV.
          content:
            audio/wav:
              schema:
                type: string
                format: binary
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          description: The product key lacks dub:render.
        '404':
          description: 'unknown_job: no matching job in the calling organization.'
        '409':
          description: 'job_not_done: poll the status endpoint before downloading.'
        '410':
          description: 'audio_expired: the result has expired; submit a new job.'
        '429':
          description: Rate/concurrency limit or dub_busy. Retry with backoff.
        '503':
          description: Dubbing is unavailable. Retry with backoff.
  /v1/dub/jobs/{job_id}/video:
    get:
      tags:
      - Dub
      operationId: downloadDubVideo
      summary: Download a dubbed video output
      description: Requires dub:render. Use only when the completed job includes video_url or outputs.video. Audio-source jobs have no video output. The source picture is retained with a dubbed audio track; this is not lip synchronization. Video and audio exports are included in the same generation job.
      parameters:
      - name: job_id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Video with the dubbed audio track. Inspect Content-Type for the returned container.
          content:
            video/mp4:
              schema:
                type: string
                format: binary
            video/webm:
              schema:
                type: string
                format: binary
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '403':
          description: The product key lacks dub:render.
        '404':
          description: unknown_job, or no_video_output when this job was created from audio.
        '409':
          description: 'job_not_done: poll the status endpoint before downloading.'
        '410':
          description: 'video_expired: the result has expired; submit a new job.'
        '429':
          description: Rate/concurrency limit or dub_busy. Retry with backoff.
        '503':
          description: Dubbing is unavailable. Retry with backoff.
components:
  schemas:
    DubRevisionCreated:
      type: object
      required:
      - job_id
      - status
      - status_url
      - parent_job_id
      properties:
        job_id:
          type: string
        parent_job_id:
          type: string
        status:
          type: string
          enum:
          - queued
          - running
          - done
          - error
        status_url:
          type: string
    DubEditor:
      type: object
      required:
      - job_id
      - revision
      - segments
      - parent_job_id
      properties:
        job_id:
          type: string
        revision:
          type: integer
          minimum: 1
        parent_job_id:
          type:
          - string
          - 'null'
        segments:
          type: array
          maxItems: 2000
          items:
            $ref: '#/components/schemas/DubPassage'
    ErrorCode:
      type: string
      description: Stable, machine-readable error code. Branch on this rather than the human `message`.
      enum:
      - invalid_request_error
      - invalid_session_label
      - unauthorized
      - forbidden
      - origin_not_allowed
      - credit_exhausted
      - key_budget_exceeded
      - child_budget_exceeded
      - insufficient_quota
      - rate_limit_exceeded
      - concurrency_limit_exceeded
      - daily_cap_exceeded
    DubJob:
      type: object
      required:
      - job_id
      - status
      properties:
        job_id:
          type: string
        status:
          type: string
          enum:
          - queued
          - running
          - done
          - error
        billing:
          type: object
          required:
          - status
          properties:
            status:
              type: string
              enum:
              - pending
              - charged
              - not_charged
            charged_usd:
              type: number
              minimum: 0
            source_seconds:
              type: number
              minimum: 0
              description: Source seconds counted for this generation, including only selected passages for a revision.
            pricing_version:
              type: string
        editable:
          type: boolean
          description: True when completed passages can be reviewed, edited and regenerated.
        parent_job_id:
          type:
          - string
          - 'null'
          description: Previous version for a passage revision.
        source_lang:
          type:
          - string
          - 'null'
        target_lang:
          type:
          - string
          - 'null'
        stage:
          type:
          - string
          - 'null'
          description: Current processing stage, such as transcribe, refs, render or done. Do not treat stage names as a closed enum.
        progress:
          type: object
          properties:
            done:
              type: integer
            total:
              type: integer
        source_seconds:
          type: number
          minimum: 0
        dubbed_seconds:
          type:
          - number
          - 'null'
          minimum: 0
        media_kind:
          type: string
          enum:
          - audio
          - video
        segments:
          type:
          - integer
          - 'null'
        audio_url:
          type: string
          description: Relative authenticated audio-download path; present after done.
        video_url:
          type: string
          description: Relative authenticated video-download path; only present when a video output exists.
        outputs:
          type: object
          properties:
            audio:
              type: object
              properties:
                url:
                  type: string
                format:
                  type: string
                  enum:
                  - wav
            video:
              type: object
              properties:
                url:
                  type: string
                container:
                  type:
                  - string
                  - 'null'
                media_type:
                  type:
                  - string
                  - 'null'
        error:
          type:
          - string
          - 'null'
          description: Failure detail when status is error.
        error_code:
          type: string
          description: Stable failure code when status is error.
    DubPassage:
      allOf:
      - $ref: '#/components/schemas/DubPassageText'
      - type: object
        required:
        - id
        - speaker
        - start
        - end
        - output_start
        - output_end
        - rendered
        - changed
        properties:
          id:
            type: string
            pattern: ^seg_[1-9][0-9]*$
          speaker:
            type: string
          start:
            type: number
            minimum: 0
          end:
            type: number
            minimum: 0
          output_start:
            type: number
            minimum: 0
          output_end:
            type: number
            minimum: 0
          rendered:
            $ref: '#/components/schemas/DubPassageText'
          changed:
            type: boolean
    DubPassageText:
      type: object
      required:
      - source_text
      - translated_text
      - pronunciation_text
      properties:
        source_text:
          type: string
          minLength: 1
          maxLength: 5000
        translated_text:
          type: string
          minLength: 1
          maxLength: 5000
        pronunciation_text:
          type: string
          maxLength: 5000
          description: Optional full spoken passage. Empty uses the translation. Subtitles retain the displayed translation.
    DubJobInput:
      type: object
      oneOf:
      - required:
        - file
      - required:
        - source_url
      properties:
        file:
          type: string
          format: binary
          description: Source audio or video. Provide this or source_url, never both. The multipart upload limit is 200 MiB.
        source_url:
          type: string
          format: uri
          description: A publicly reachable media URL. Provide this or file, never both.
        source_lang:
          type: string
          default: en
          enum:
          - en
          - es
          - fr
          - de
          - hi
          - it
          - pt
          - nl
          description: Canonical source-language code. These are accepted input codes, not output languages. Source recognition and output rendering have independent language catalogs.
        target_lang:
          type: string
          enum:
          - hi
          - en
          - es
          - fr
          - de
          - it
          - pt
          - zh
          - ja
          - ko
          - ru
          default: hi
          description: Output language. Read /healthz/dub for current availability.
        single_speaker:
          type: boolean
          description: Use when the recording contains one speaker. This does not establish a speaker's identity.
        timing:
          type: string
          enum:
          - natural
          - source
          description: 'natural uses conversational gaps; source preserves source starts and duration. Default: natural for audio, source for video or background-preserving requests.'
        preserve_background:
          type: boolean
          description: Request background preservation where available; unavailable processing is rejected rather than silently ignored.
        transcript:
          type: string
          description: 'Optional JSON object encoded as a form-field string: {segments:[{speaker,start,end,text}]}, with start/end in source seconds. Supplies transcription while Dub still translates and renders the speech.'
        speaker_map:
          type: string
          description: Optional JSON object encoded as a form-field string, mapping speaker IDs to voice IDs or male/female voice hints. Prefer speaker_voices for explicit registered voices; conflicting overrides are rejected.
        glossary:
          type: string
          description: Optional JSON object encoded as a form-field string, mapping source terms to their intended target-language form.
        speaker_voices:
          type: string
          description: Optional JSON object encoded as a form-field string, mapping speaker IDs to registered voice IDs. Unknown or unavailable voices are rejected.
        webhook_url:
          type: string
          format: uri
          maxLength: 2048
          description: Optional public HTTPS endpoint for completion notification. Keep polling as the status source of truth.
    DubJobCreated:
      type: object
      required:
      - job_id
      - status
      - status_url
      properties:
        job_id:
          type: string
          example: dub_example
        status:
          type: string
          enum:
          - queued
        status_url:
          type: string
          example: /v1/dub/jobs/dub_example
          description: Relative path on api.pyai.com. Requires the same product key.
    DubEdits:
      type: object
      additionalProperties: false
      required:
      - revision
      - edits
      properties:
        revision:
          type: integer
          minimum: 1
        edits:
          type: array
          minItems: 1
          maxItems: 2000
          items:
            type: object
            additionalProperties: false
            required:
            - id
            minProperties: 2
            properties:
              id:
                type: string
              source_text:
                type: string
                minLength: 1
                maxLength: 5000
              translated_text:
                type: string
                minLength: 1
                maxLength: 5000
              pronunciation_text:
                type: string
                maxLength: 5000
    Error:
      type: object
      description: OpenAI-compatible error envelope returned by the gateway data plane (401/402/403/429). Control-plane request/resource errors use Problem (application/problem+json) instead.
      required:
      - error
      properties:
        error:
          type: object
          required:
          - message
          properties:
            message:
              type: string
              description: Human-readable explanation.
            type:
              type: string
              description: Error category, e.g. rate_limit_error.
            code:
              $ref: '#/components/schemas/ErrorCode'
            param:
              type: string
              nullable: true
              description: Offending parameter when applicable, else null.
    DubCapabilities:
      type: object
      required:
      - status
      - source_langs
      - target_langs
      properties:
        original_voices:
          type: boolean
          description: Source-speaker matching is available without automatic substitution of another voice.
        status:
          type: string
          enum:
          - ok
        source_langs:
          type: array
          items:
            type: string
        target_langs:
          type: array
          items:
            type: string
        video:
          type: boolean
        preserve_background:
          type: boolean
    DubRevisionInput:
      type: object
      additionalProperties: false
      required:
      - revision
      - segment_ids
      properties:
        revision:
          type: integer
          minimum: 1
        segment_ids:
          type: array
          minItems: 1
          maxItems: 50
          uniqueItems: true
          items:
            type: string
            pattern: ^seg_[1-9][0-9]*$
  responses:
    Unauthorized:
      description: 'Missing or invalid API key (`code: unauthorized`)'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PaymentRequired:
      description: 'Billing gate: org out of prepaid credit, per-key budget hit, or plan quota exhausted (`code: credit_exhausted | key_budget_exceeded | insufficient_quota`). Do not retry; add credit or raise the limit. A brand-new key may see this on its first call until the account is funded.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    interpretationUpload:
      type: http
      scheme: bearer
      description: Short-lived write-only upload_capability returned by POST /v1/audio/interpretations/recordings. Never use it for reads.
    sessionCookie:
      type: apiKey
      in: cookie
      name: pyai_session
      description: Console session cookie. PyAI-admin routes also require the configured platform-admin email allowlist.
    apiKey:
      type: http
      scheme: bearer
      description: 'Use `Authorization: Bearer pyai_live_...` (or `pyai_test_...`).'
    xApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Header alias for bearer auth on HTTP endpoints. WebSocket auth uses the subprotocol pair `pyai.v1, pyai-key.<API_KEY>`.
x-pyai-agent-notes:
  guide: https://pyai.com/agents/speech-calling.md
  omni_frames: https://api.pyai.com/omni-frames.json
  discovery: Inspect live operation schemas; preserve IDs and required Idempotency-Key headers. SDK-first for realtime. Never infer a simulated PSTN call endpoint.