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

# Transcribe media

> Transcribe any media URL: source captions, built-in AI speech-to-text, or your own provider key; timestamped segments.

Without `provider`, Importly uses the video's own captions (\$0.003). Setting `provider` (or `providerOptions`) skips captions and always runs speech-to-text. For a walkthrough, see [Transcripts](/docs/features/transcripts.md).

## One call: mode and wait

Send `"mode": "auto"` and `"wait": true` to get a transcript for any video in a single request. Importly uses the captions when there are some and built-in speech-to-text when there aren't, and returns the finished transcript in the response, in the same shape as [`GET /transcribe/status`](/docs/endpoints/transcribe-status).

| `mode` | Source | When there are no captions |
| - | - | - |
| Omitted | Captions, or speech-to-text if you set `provider` or `providerOptions` | Fails with `TRANSCRIPTION_PROVIDER_REQUIRED` and a quote, at no charge |
| `auto` | Captions first, speech-to-text when there are none | Runs speech-to-text: `importly`, or the `provider` you set |
| `captions` | Captions only | Fails with `TRANSCRIPTION_PROVIDER_REQUIRED` and a quote, at no charge |
| `ai` | Always speech-to-text: `importly`, or the `provider` you set | Runs speech-to-text |

`maxCostDollars` caps the speech-to-text charge on the `auto` fallback too: if the estimate is over it, the job fails with `MAX_COST_EXCEEDED` instead of running.

`wait` holds the request for up to that many seconds (`true` means 30, the most is 60). Captions are usually ready in a few seconds. If the job is still running when the time is up, the response has the `jobId` and `status`, and you finish with the status endpoint or a webhook, as without `wait`. Leaving out `mode` keeps the behavior requests had before these options existed.

## Provider options

`providerOptions` (on Import: `transcriptOptions`) is passed to your provider, so it uses that provider's own option names. Use it with `assemblyai`, `deepgram`, or `openai`, and always set `provider` too: options alone skip captions without picking a provider, so the job fails with `TRANSCRIPTION_PROVIDER_REQUIRED` (on Import, the transcript is skipped).

| `provider` | Where the options go | Example |
| - | - | - |
| `assemblyai` | Fields of the transcript request body | `{ "speaker_labels": true }` |
| `deepgram` | Query parameters of `/v1/listen`; `model` defaults to `nova-2` | `{ "model": "nova-3", "diarize": true }` |
| `openai` | Only `model` (default `whisper-1`), `language`, `prompt`, and `temperature` | `{ "model": "whisper-1", "prompt": "Importly, MCP" }` |

The top-level `language` is sent under each provider's own name: Deepgram `language` (also for `importly`), AssemblyAI `language_code`, OpenAI `language`. If `providerOptions` already sets that name, or turns on the provider's language detection (Deepgram `detect_language`, AssemblyAI `language_detection`), your value is used and `language` isn't added.

Importly sets where the provider gets the audio and where it sends the result, so options that would change either are dropped (matched case-insensitively): `audio_url`, `webhook_url`, `webhook_auth_header_name`, and `webhook_auth_header_value` for AssemblyAI, and `callback` and `callback_method` for Deepgram. With `provider: "importly"`, `providerOptions` is ignored.

Poll the result with [`GET /transcribe/status`](/docs/endpoints/transcribe-status), or receive it by [webhook](/docs/endpoints/webhooks/transcribe.md).


## OpenAPI

````yaml openapi.yaml POST /transcribe
openapi: 3.1.0
info:
  title: Importly API
  version: 1.0.0
  summary: Download media, get transcripts, and read metadata from a URL.
  description: >
    Importly turns a public media URL (YouTube, TikTok, podcasts and more) into
    a downloadable file,

    a transcript, or metadata.


    Every job is asynchronous. A `POST` returns a `jobId` right away. Then
    either poll the matching

    `/status` endpoint until `status` is `completed` or `failed`, or pass a
    `webhookUrl` and Importly

    posts to you once when the job finishes: the result when it succeeds, or
    `success: false` with

    `code` and `message` when it fails.


    Every response uses one envelope: `{ "success": true, "data": … }` on
    success and

    `{ "success": false, "error": "…" }` on failure. Responses carry
    `X-RateLimit-Limit`,

    `X-RateLimit-Remaining`, `X-RateLimit-Reset` (Unix time in ms) and
    `X-RateLimit-Window` headers.


    Billing is pay-as-you-go from a credit balance. New accounts get $3.00 in
    free credits, no card required.
  contact:
    name: Importly support
    email: support@importly.io
    url: https://www.importly.io/docs
servers:
  - url: https://api.importly.io
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Media
    description: Download video or audio from a URL.
  - name: Transcripts
    description: Turn a media URL into text with timestamped segments.
  - name: Metadata
    description: >-
      Read a URL's title, duration, thumbnail, formats and more without
      downloading the media.
  - name: Account
    description: Your credit balance.
  - name: Account settings
    description: >-
      Stored S3 credentials and speech-to-text provider keys. These calls carry
      secrets, so the docs playground is off for them.
  - name: Webhooks
    description: Requests Importly sends to your `webhookUrl` when a job succeeds or fails.
paths:
  /transcribe:
    post:
      tags:
        - Transcripts
      summary: Transcribe media
      description: >
        Turns a media URL into a transcript: plain text plus timestamped
        segments.


        - **Existing captions**: when the video has captions, including
        auto-generated ones. $0.003 per video.

        - **Built-in speech-to-text** (`importly`): no account needed. $0.01 per
        media minute (min $0.01), including the audio download.

        - **Your own provider key** (`assemblyai`, `deepgram`, `openai`): $0.005
        per media minute (min $0.01), including the audio download, plus your
        provider's own fees.


        `mode` picks the source. `"auto"` uses the captions and falls back to
        speech-to-text (built in, unless you set

        `provider`) when there are none, so one request gets a transcript for
        any video. `"captions"` never runs

        speech-to-text, and `"ai"` always does. Without `mode`, the request uses
        captions, or speech-to-text when you set

        `provider` or `providerOptions`; a video with no captions then fails
        with `TRANSCRIPTION_PROVIDER_REQUIRED` and a

        `quote` for built-in speech-to-text.


        Set `wait` to get the transcript in this response: the request waits up
        to that many seconds (30 for `true`) and

        returns the finished (or failed) job in the same shape as `GET
        /transcribe/status`. Captions are usually ready in a

        few seconds. If the job is still running when the time is up, you get
        the `jobId` and finish with the status

        endpoint or a webhook, as without `wait`. Failed transcriptions are
        refunded automatically.
      operationId: transcribeMedia
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TranscribeRequest'
            examples:
              oneCall:
                summary: Captions or speech-to-text, result in the response
                value:
                  url: https://www.youtube.com/watch?v=jNQXAC9IVRw
                  mode: auto
                  wait: true
                  maxCostDollars: 0.5
              captions:
                summary: From existing captions
                value:
                  url: https://www.youtube.com/watch?v=jNQXAC9IVRw
                  webhookUrl: https://example.com/api/importly-webhook
              builtIn:
                summary: Built-in speech-to-text with a cost cap
                value:
                  url: https://example.com/conference-talk.mp4
                  provider: importly
                  maxCostDollars: 0.5
              ownKey:
                summary: Your Deepgram key
                value:
                  url: https://example.com/podcast-episode.mp3
                  provider: deepgram
                  apiKey: YOUR_DEEPGRAM_KEY
                  language: en
      responses:
        '200':
          description: >
            The transcription job was queued. With `wait`, the finished or
            failed job when it ended in time

            (the same `data` as `GET /transcribe/status`), otherwise its `jobId`
            and current `status`.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - data
                properties:
                  success:
                    type: boolean
                    const: true
                  data:
                    $ref: '#/components/schemas/TranscriptionStatus'
              examples:
                queued:
                  summary: Queued
                  value:
                    success: true
                    data:
                      jobId: 95be812f-4a2c-410a-9fcb-3ca5b445cc44
                      status: queued
                      message: Transcription has been queued for processing.
                completed:
                  summary: Finished within wait
                  value:
                    success: true
                    data:
                      jobId: 95be812f-4a2c-410a-9fcb-3ca5b445cc44
                      status: completed
                      result:
                        text: >-
                          All right, so here we are, in front of the elephants

                          the cool thing about these guys is that they have
                          really...

                          really really long trunks

                          and that's cool

                          (baaaaaaaaaaahhh!!)

                          and that's pretty much all there is to say
                        source: platform_captions
                        captionKind: manual
                        language: en
                        duration: 19
                        data:
                          segments:
                            - start: 1.2
                              end: 3.36
                              text: >-
                                All right, so here we are, in front of the
                                elephants
                            - start: 5.318
                              end: 7.974
                              text: >-
                                the cool thing about these guys is that they
                                have really...
                        costInDollars: 0.003
                stillRunning:
                  summary: Still running when wait ran out
                  value:
                    success: true
                    data:
                      jobId: 95be812f-4a2c-410a-9fcb-3ca5b445cc44
                      status: running
                      message: >-
                        Transcription is still running. Poll GET
                        /transcribe/status?id=95be812f-4a2c-410a-9fcb-3ca5b445cc44.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    TranscribeRequest:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          format: uri
          description: Public media URL to transcribe.
          example: https://www.youtube.com/watch?v=jNQXAC9IVRw
        mode:
          type: string
          enum:
            - auto
            - captions
            - ai
          description: >
            Where the transcript comes from. `auto`: the media's captions, or
            speech-to-text when it has none.

            `captions`: captions only; with none the job fails with
            `TRANSCRIPTION_PROVIDER_REQUIRED` and a quote, at

            no charge. `ai`: always speech-to-text. With `auto` and `ai`,
            speech-to-text is the built-in `importly`

            unless you set `provider`. When omitted: captions, or speech-to-text
            if you set `provider` or `providerOptions`.
          example: auto
        wait:
          oneOf:
            - type: boolean
            - type: number
              exclusiveMinimum: 0
              maximum: 60
          description: >
            Return the finished transcript in this response when it's ready
            within this many seconds (`true` waits 30,

            at most 60). If it isn't, the response has the `jobId` as usual.
            Omit it to get the `jobId` right away.
          example: true
        language:
          type: string
          description: >
            Spoken language as a two-letter code, e.g. `es`. For captions it
            picks the track (English if present

            when omitted). For speech-to-text it's sent to the provider; when
            omitted, `importly`, `deepgram` and

            `assemblyai` transcribe as English and `openai` auto-detects.
          example: en
        provider:
          $ref: '#/components/schemas/TranscriptionProvider'
        apiKey:
          type: string
          description: >-
            Your key for the chosen provider. Not needed for `importly`, or if
            you saved one with `POST /transcription-provider`.
        providerOptions:
          type: object
          additionalProperties: true
          description: >
            Options passed through to your provider under its own option names,
            e.g. `{ "speaker_labels": true }`

            for AssemblyAI or `{ "model": "nova-3" }` for Deepgram. Options that
            change where the provider reads audio

            or sends results are dropped. Ignored with `importly`. Always set
            `provider` too.
        maxCostDollars:
          type: number
          exclusiveMinimum: 0
          description: >
            Cap for speech-to-text, built in or with your own key, including the
            `auto` fallback. If the estimated charge exceeds it, the job fails
            with

            `MAX_COST_EXCEEDED` and the estimate instead of running. With
            built-in speech-to-text, if the duration

            can't be determined up front, the cap is charged and the unused part
            refunded afterward. The charge is all-in, so the cap covers the
            audio download too.
        webhookUrl:
          $ref: '#/components/schemas/WebhookUrl'
    TranscriptionStatus:
      type: object
      required:
        - jobId
        - status
      properties:
        jobId:
          type: string
          format: uuid
        status:
          $ref: '#/components/schemas/JobStatusValue'
        result:
          $ref: '#/components/schemas/TranscriptFields'
        message:
          type: string
          description: >-
            When `failed`, why the job failed. In a `POST /transcribe` response
            for a job still queued or running, what to do next.
        code:
          type: string
          description: >-
            Only when `failed`, usually. A stable error code, e.g.
            `TRANSCRIPTION_PROVIDER_REQUIRED` or `MAX_COST_EXCEEDED`.
        documentationUrl:
          type: string
          format: uri
          description: >-
            Only when `failed` with a known `code`. A page explaining the error
            and how to fix it, e.g.
            `https://www.importly.io/docs/errors/media-unavailable`.
        quote:
          type: object
          description: >-
            With `TRANSCRIPTION_PROVIDER_REQUIRED`, when the duration is known.
            What built-in speech-to-text would cost for this media.
          properties:
            provider:
              type: string
              const: importly
            estimatedMinutes:
              type: integer
            estimatedCostDollars:
              type: number
    TranscriptionProvider:
      type: string
      enum:
        - importly
        - assemblyai
        - deepgram
        - openai
      description: >
        Speech-to-text provider. `importly` is built in and needs no key.
        Without `mode`, setting a provider skips

        captions and always runs speech-to-text; with `mode: "auto"` it's the
        fallback when there are no captions.
    WebhookUrl:
      type: string
      format: uri
      description: >
        HTTPS URL that receives the result when the job finishes. It must not
        point to a private or

        internal address. A job that fails for good sends one webhook with
        `success: false`, `code`

        and `message`.
      example: https://example.com/webhooks/importly
    JobStatusValue:
      type: string
      enum:
        - queued
        - running
        - completed
        - failed
      description: >-
        `queued` and `running` mean keep polling; `completed` and `failed` are
        final.
    TranscriptFields:
      type: object
      description: The same shape whichever source produced the transcript.
      required:
        - text
        - source
        - language
        - duration
        - data
      properties:
        text:
          type: string
          description: The full transcript as plain text.
        source:
          type: string
          enum:
            - platform_captions
            - importly
            - assemblyai
            - deepgram
            - openai
          description: Where the transcript came from.
        captionKind:
          type:
            - string
            - 'null'
          enum:
            - manual
            - auto
            - null
          description: >
            Only when `source` is `platform_captions`: `manual` for captions
            uploaded with the media, `auto` for

            captions the platform generated automatically (such as YouTube's
            auto-captions). `null` for

            transcripts made before this field existed.
        language:
          type:
            - string
            - 'null'
          description: >
            Language code of the transcript, such as `en` or `pt-BR`: the
            caption track's language, the language

            speech-to-text detected, or the `language` you sent. `null` when
            none of these is known.
        duration:
          type:
            - number
            - 'null'
          description: Media length in seconds.
        data:
          type: object
          description: >-
            Timestamped segments, sentence by sentence for speech-to-text and
            line by line for captions.
          required:
            - segments
          properties:
            segments:
              type: array
              items:
                $ref: '#/components/schemas/TranscriptSegment'
        costInDollars:
          type: number
          description: What the transcription cost, including the media download.
    Error:
      type: object
      required:
        - success
        - error
        - code
      properties:
        success:
          type: boolean
          const: false
        error:
          type: string
          description: What went wrong, in plain English.
        code:
          type: string
          description: >
            A stable, machine-readable error code: `UNAUTHORIZED`,
            `INSUFFICIENT_BALANCE`, `RATE_LIMITED`,

            `INVALID_URL`, `INVALID_REQUEST`, `NOT_FOUND` or `INTERNAL_ERROR`.
          examples:
            - INVALID_URL
        documentationUrl:
          type: string
          format: uri
          description: A page explaining this error and how to fix it.
          examples:
            - https://www.importly.io/docs/errors/invalid-url
    InsufficientBalanceError:
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          required:
            - code
          properties:
            code:
              type: string
              const: INSUFFICIENT_BALANCE
            endpoint:
              type: string
              description: The rate-limit bucket the request counted against.
            balanceRequired:
              type: number
              description: Minimum balance in US dollars needed to start the job.
    RateLimitError:
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            limit:
              type: integer
              description: Requests allowed per window.
            remaining:
              type: integer
              description: Requests left in the window.
            reset:
              type: integer
              description: When the window resets, as Unix time in milliseconds.
            retryAfter:
              type: integer
              description: Seconds to wait before retrying.
            endpoint:
              type: string
              description: The rate-limit bucket the request counted against.
            outstandingLimit:
              type: integer
              description: >-
                Present instead of `limit` when too many of your jobs of this
                kind are queued or running; the most allowed at once.
            outstanding:
              type: integer
              description: >-
                Present with `outstandingLimit`. How many of your jobs of this
                kind are queued or running.
    TranscriptSegment:
      type: object
      properties:
        start:
          type: number
          description: Start time in seconds.
        end:
          type: number
          description: End time in seconds.
        text:
          type: string
  responses:
    BadRequest:
      description: A parameter is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missingUrl:
              summary: Missing url
              value:
                success: false
                error: 'Missing required parameter: url'
                code: INVALID_URL
                documentationUrl: https://www.importly.io/docs/errors/invalid-url
            invalidUrl:
              summary: Invalid url
              value:
                success: false
                error: Invalid URL format - must be a valid HTTP or HTTPS URL
                code: INVALID_URL
                documentationUrl: https://www.importly.io/docs/errors/invalid-url
            webhookNotHttps:
              summary: Webhook URL isn't HTTPS
              value:
                success: false
                error: Webhook URL must use HTTPS
                code: INVALID_REQUEST
                documentationUrl: https://www.importly.io/docs/errors/invalid-request
    Unauthorized:
      description: The API key is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            missingHeader:
              summary: No Authorization header
              value:
                success: false
                error: >-
                  Missing or invalid Authorization header. Must be in format:
                  Bearer YOUR_API_KEY
                code: UNAUTHORIZED
                documentationUrl: https://www.importly.io/docs/errors/unauthorized
            invalidKey:
              summary: Unknown key
              value:
                success: false
                error: Invalid API key
                code: UNAUTHORIZED
                documentationUrl: https://www.importly.io/docs/errors/unauthorized
    PaymentRequired:
      description: >-
        Your balance is below what the job needs to start ($0.01 for an import
        or transcription, $0.003 for metadata). Add credits on the Billing page.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/InsufficientBalanceError'
          example:
            success: false
            error: Insufficient balance. Please add credits to your account.
            code: INSUFFICIENT_BALANCE
            endpoint: /import
            balanceRequired: 0.01
            documentationUrl: https://www.importly.io/docs/errors/insufficient-credits
    TooManyRequests:
      description: >-
        You hit the hourly rate limit for this endpoint, or have too many jobs
        queued or running (`outstanding` and `outstandingLimit` are set). Wait
        `retryAfter` seconds and retry.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-RateLimit-Window:
          $ref: '#/components/headers/X-RateLimit-Window'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitError'
          example:
            success: false
            error: 'Rate limit exceeded. Limit: 240 requests per 1 h'
            code: RATE_LIMITED
            limit: 240
            remaining: 0
            reset: 1763200000000
            retryAfter: 1800
            endpoint: /import
            documentationUrl: https://www.importly.io/docs/errors/rate-limited
    InternalError:
      description: Unexpected server error. Retry with exponential backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            error: Internal server error
            code: INTERNAL_ERROR
            documentationUrl: https://www.importly.io/docs/errors/server-error
  headers:
    X-RateLimit-Limit:
      description: Requests allowed in the current window.
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests left in the current window.
      schema:
        type: integer
    X-RateLimit-Reset:
      description: When the window resets, as Unix time in milliseconds.
      schema:
        type: integer
    X-RateLimit-Window:
      description: Window length, e.g. `1 h`.
      schema:
        type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your API key from the dashboard, sent as `Authorization: Bearer <api
        key>`.

````

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