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

# Transcription Price Calculation

> Estimate the price of a transcription request. Provide one of: source_url, source_file, or duration_seconds.

Estimate the cost of an audio/video transcription job before submitting it.

Quote from one of three inputs: `source_url`, `source_file`, or a bare `duration_seconds`.

> [!WARNING]
>
> **Pass the same flags you will pass to the job.** `ts_level: "word"`, `diarize` (which implies `include_ts`) and `include_metadata` can all raise the price. A quote that omits them comes in **under** what you are actually charged. `include_ts` on its own does not: segment-level timing is included in the base price.

### Quoting from `duration_seconds`

This mode never fetches the source, so it cannot see which platform the media comes from. On models that price per platform — and on TikTok, which is priced from a fixed [length-band card](https://docs.deapi.ai/pricing.md) rather than by the hour — pass `platform` alongside the duration:

```bash theme={null}
curl -X POST "https://api.deapi.ai/api/v2/audio/transcriptions/price" \
  -H "Authorization: Bearer $DEAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "duration_seconds": 240,
    "platform": "tiktok",
    "model": "WhisperLargeV3Ct2",
    "include_ts": true,
    "ts_level": "word",
    "include_metadata": true
  }'
```

Without `platform`, the quote uses the model base rate with no duration-band rounding.

> [!NOTE]
>
> `platform: "tiktok"` is only valid with `model: "WhisperLargeV3Ct2"` — that is the only model that transcribes TikTok. Paired with any other model it is rejected with `422`, the same way the job itself would be. See [Audio/Video Transcription](https://docs.deapi.ai/api/v2/audio/transcriptions.md).

## What `WhisperLargeV3Ct2` costs

The quote is built in three steps, in this order:

1. **Base amount** — the TikTok [length band](https://docs.deapi.ai/pricing.md) for TikTok sources, otherwise the duration rate.
2. **Timestamps** — segment-level timing is included in the base amount, so `include_ts: true` with the default `ts_level: "segment"` does not change the quote. The base amount is multiplied by 1.5 only when `ts_level` is `word`, or when `diarize` is set — diarization carries the surcharge at any granularity, `segment` included.
3. **Metadata** — if `include_metadata` is set on a source that can return it, a flat `0.005` is added *after* the multiplication.


## OpenAPI

````yaml openapi.json POST /api/v2/audio/transcriptions/price
openapi: 3.1.0
info:
  title: deAPI REST API
  description: >-
    Decentralized AI inference API for image generation, video processing, audio
    transcription, and more.


    ## Rate limits


    Two windows can apply to a request: a per-minute one (RPM) and a per-day one
    (RPD). Every

    throttled response — success or 429 — carries the `X-RateLimit-*` headers,
    so you can pace

    traffic without waiting to be rejected. Each header documents itself: see
    `components/headers`,

    or the headers listed on any response. What follows is only what a header
    cannot say about

    itself.


    Windows open on your first request into a bucket and run their full length
    from that second —

    never to a calendar boundary, in any timezone. That is deliberate: a
    boundary every account

    shares is a boundary every account can double up on.


    **The headers describe the pool *this* request landed in, and
    `X-RateLimit-Source` is what

    identifies it — not `X-RateLimit-Limit` alone.** A per-model limit is keyed
    to the model you

    named, so a request that carried no recognised `model` — rejected at
    validation, an unknown

    slug, an empty body — was counted against your tier pool, and it is the tier
    pool the headers

    then describe. The two pools are fully independent: separate minute window,
    separate day,

    separate `X-RateLimit-Daily-Reset`. This is a consequence of rate limiting
    running *before*

    validation, which is what keeps malformed traffic from reaching the rest of
    the API

    uncounted. Compare headers only across responses carrying the same
    `X-RateLimit-Source`.


    **Buckets are shared in ways worth knowing.** API **v1 and v2 count against
    the same bucket**,

    so migrating grants no fresh allowance and mixed traffic behaves as one
    stream. All `*/price`

    and `*/price-calculation` endpoints share a single quote bucket, separate
    from generation.

    Prompt enhancement (`/v2/prompts/enhancements`) has its own bucket as well,
    so heavy prompt

    work no longer eats into your image throughput.


    **Counting is exact in sequence, best-effort in parallel.** Sent one after
    another, your

    requests are counted precisely: the one that crosses the limit is the one
    that gets 429. Sent

    in parallel, a few beyond the limit can slip through, because the counter is
    read and then

    incremented as two steps and requests already in flight are not yet visible
    to one another.

    The excess is bounded by how many of your own requests are in flight at
    once, and it only

    ever runs in your favour — you are never rejected while below your limit. So
    do not treat

    `X-RateLimit-Remaining` as a reservation: it is a snapshot, and a request
    you sent a

    millisecond ago may already have spent what it shows.


    **Not every 429 comes from the request rate.** Creating API keys has its own
    hourly bucket,

    and a key with an IP whitelist has one for calls from addresses it refuses.
    A 429 always

    describes the bucket that actually refused it — `X-RateLimit-Type` names
    that bucket, and

    every other `X-RateLimit-*` header on the response belongs to it. So back
    off on the headers

    you were sent, and do not carry figures from one 429 over to the next.


    **A call refused by a key's IP whitelist does not spend the account's
    request allowance.**

    It is counted against the address it came from instead, on a much tighter
    window — so a

    whitelist cannot be turned against the owner it protects, and being refused
    still does not

    come free.


    Requests rejected before authentication (HTTP 401) never reach the limiter
    and carry no

    rate-limit headers at all.
  contact:
    name: deAPI Support
    url: https://deapi.ai
    email: support@deapi.ai
  version: 0.0.1
servers:
  - url: https://api.deapi.ai
    description: Production API Server base URL
security:
  - bearerAuth: []
tags:
  - name: Client API v2
    description: Current client endpoints (OpenAI-aligned noun-based paths)
paths:
  /api/v2/audio/transcriptions/price:
    post:
      tags:
        - Client API v2
      summary: Estimate the price of a transcription request
      description: >-
        Estimate the price of a transcription request. Provide one of:
        source_url, source_file, or duration_seconds.
      operationId: estimateTranscriptionPrice
      parameters:
        - $ref: '#/components/parameters/AcceptHeader'
      requestBody:
        description: Transcription price calculation parameters
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TranscribePriceRequestBody'
      responses:
        '200':
          description: Calculated price for transcription.
          headers:
            X-RateLimit-Policy:
              $ref: '#/components/headers/X-RateLimit-Policy'
            X-RateLimit-Source:
              $ref: '#/components/headers/X-RateLimit-Source'
            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-Daily-Limit:
              $ref: '#/components/headers/X-RateLimit-Daily-Limit'
            X-RateLimit-Daily-Remaining:
              $ref: '#/components/headers/X-RateLimit-Daily-Remaining'
            X-RateLimit-Daily-Reset:
              $ref: '#/components/headers/X-RateLimit-Daily-Reset'
          content:
            application/json:
              schema:
                properties:
                  data:
                    properties:
                      price:
                        description: Calculated price for the transcription
                        type: number
                        format: float
                        example: 0.25
                    type: object
                type: object
        '401':
          description: Unauthorized user.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/response_error_default'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
      security:
        - bearerAuth: []
components:
  parameters:
    AcceptHeader:
      name: Accept
      in: header
      required: true
      schema:
        type: string
        default: application/json
        enum:
          - application/json
  schemas:
    TranscribePriceRequestBody:
      description: >-
        Exactly ONE input source per request — `source_url`, `source_file` or
        `duration_seconds` — hence the three variants below. They are mutually
        exclusive, not a menu of optional fields: sending two of them is a 422.
        `platform` belongs to the `duration_seconds` variant alone; with a URL
        or an upload the platform is derived from the source itself and passing
        it is rejected. Everything else (`include_ts`, `ts_level`,
        `include_metadata`, `diarize`, `lang`, `model`) applies to all three.
      oneOf:
        - title: From a source URL
          required:
            - source_url
            - model
          properties:
            source_url:
              description: >-
                URL of video/audio to estimate price for. Mutually exclusive
                with `source_file` and `duration_seconds`; `platform` must NOT
                be sent with it, as it is derived from the URL.
              type: string
              example: https://www.youtube.com/watch?v=jNQXAC9IVRw
            include_ts:
              description: >-
                Should transcription include timestamps. Implied when `diarize`
                is true. Whether it raises the quote depends on `ts_level` —
                segment-level timing is included in the base price. Pass it
                exactly as you will pass it to POST
                /api/v2/audio/transcriptions.
              type:
                - boolean
                - 'null'
              example: false
              default: false
            ts_level:
              description: >-
                Timestamp granularity. Validated against the model exactly as on
                POST /api/v2/audio/transcriptions, so a price quote is never
                returned for a combination the job request would reject.
                Granularity affects the price on models that price timestamps
                separately: `segment` is included in the base price, while
                `word` and `char` carry a surcharge.
              type:
                - string
                - 'null'
              example: word
              default: segment
              enum:
                - segment
                - word
                - char
                - null
            include_metadata:
              description: >-
                Whether the job will be asked to attach source metadata. Carries
                a flat surcharge on models that price it, so pass it exactly as
                you will pass it to POST /api/v2/audio/transcriptions or the
                quote will come in under the amount charged. The surcharge
                applies only to sources that can actually return metadata:
                uploads always return null and are never charged for it. Every
                recognised platform, YouTube included, does return metadata and
                is charged the surcharge.
              type:
                - boolean
                - 'null'
              example: false
              default: false
            diarize:
              description: >-
                Label each timed unit with a detected speaker. Requires a model
                that supports diarization. Implies `include_ts` and carries the
                timestamp surcharge at ANY granularity, including `segment`.
              type:
                - boolean
                - 'null'
              example: false
              default: false
            lang:
              description: >-
                Language hint for the transcription. Does not affect the price,
                but is validated against the model the same way as on the job
                request: a language outside a model's published
                `info.limits.languages` is rejected.
              type:
                - string
                - 'null'
              example: en
              maxLength: 16
            model:
              description: The model to use for transcription.
              type: string
              example: WhisperLargeV3
          type: object
        - title: From an uploaded file
          required:
            - source_file
            - model
          properties:
            source_file:
              description: >-
                Audio or video file to estimate price for. Mutually exclusive
                with `source_url` and `duration_seconds`; `platform` must NOT be
                sent with it, as an upload belongs to no platform.
              type: string
              format: binary
            include_ts:
              description: >-
                Should transcription include timestamps. Implied when `diarize`
                is true. Whether it raises the quote depends on `ts_level` —
                segment-level timing is included in the base price. Pass it
                exactly as you will pass it to POST
                /api/v2/audio/transcriptions.
              type:
                - boolean
                - 'null'
              example: false
              default: false
            ts_level:
              description: >-
                Timestamp granularity. Validated against the model exactly as on
                POST /api/v2/audio/transcriptions, so a price quote is never
                returned for a combination the job request would reject.
                Granularity affects the price on models that price timestamps
                separately: `segment` is included in the base price, while
                `word` and `char` carry a surcharge.
              type:
                - string
                - 'null'
              example: word
              default: segment
              enum:
                - segment
                - word
                - char
                - null
            include_metadata:
              description: >-
                Whether the job will be asked to attach source metadata. An
                upload always returns null metadata and is never charged the
                surcharge, so this flag does not move the quote on this variant.
                Pass it exactly as you will pass it to POST
                /api/v2/audio/transcriptions.
              type:
                - boolean
                - 'null'
              example: false
              default: false
            diarize:
              description: >-
                Label each timed unit with a detected speaker. Requires a model
                that supports diarization. Implies `include_ts` and carries the
                timestamp surcharge at ANY granularity, including `segment`.
              type:
                - boolean
                - 'null'
              example: false
              default: false
            lang:
              description: >-
                Language hint for the transcription. Does not affect the price,
                but is validated against the model the same way as on the job
                request: a language outside a model's published
                `info.limits.languages` is rejected.
              type:
                - string
                - 'null'
              example: en
              maxLength: 16
            model:
              description: The model to use for transcription.
              type: string
              example: WhisperLargeV3
          type: object
        - title: From a known duration
          required:
            - duration_seconds
            - model
          properties:
            duration_seconds:
              description: >-
                Duration in seconds for direct price estimation. Mutually
                exclusive with `source_url` and `source_file`. This mode never
                fetches the source, so pass `platform` alongside it on models
                that price per platform — without it the quote uses the model
                base rate and no duration rounding, and can come in under the
                amount charged.
              type: number
              example: 3600
              minimum: 0.1
            platform:
              description: >-
                The platform the source comes from. Valid ONLY on this variant,
                where there is no URL to derive it from — with `source_url` or
                `source_file` it is rejected, because the platform is taken from
                the source itself. Some models price per platform, and TikTok is
                priced from a length-band card, so a duration-only quote that
                omits this is priced at the model base rate and can come in
                under the amount charged. Pass the platform you will actually
                submit.
              type:
                - string
                - 'null'
              example: tiktok
              enum:
                - youtube
                - twitter
                - twitch
                - kick
                - tiktok
                - null
            include_ts:
              description: >-
                Should transcription include timestamps. Implied when `diarize`
                is true. Whether it raises the quote depends on `ts_level` —
                segment-level timing is included in the base price. Pass it
                exactly as you will pass it to POST
                /api/v2/audio/transcriptions.
              type:
                - boolean
                - 'null'
              example: false
              default: false
            ts_level:
              description: >-
                Timestamp granularity. Validated against the model exactly as on
                POST /api/v2/audio/transcriptions, so a price quote is never
                returned for a combination the job request would reject.
                Granularity affects the price on models that price timestamps
                separately: `segment` is included in the base price, while
                `word` and `char` carry a surcharge.
              type:
                - string
                - 'null'
              example: word
              default: segment
              enum:
                - segment
                - word
                - char
                - null
            include_metadata:
              description: >-
                Whether the job will be asked to attach source metadata. Carries
                a flat surcharge on models that price it, so pass it exactly as
                you will pass it to POST /api/v2/audio/transcriptions or the
                quote will come in under the amount charged. The surcharge
                applies only to sources that can actually return metadata:
                uploads always return null and are never charged for it. Every
                recognised platform, YouTube included, does return metadata and
                is charged the surcharge.
              type:
                - boolean
                - 'null'
              example: false
              default: false
            diarize:
              description: >-
                Label each timed unit with a detected speaker. Requires a model
                that supports diarization. Implies `include_ts` and carries the
                timestamp surcharge at ANY granularity, including `segment`.
              type:
                - boolean
                - 'null'
              example: false
              default: false
            lang:
              description: >-
                Language hint for the transcription. Does not affect the price,
                but is validated against the model the same way as on the job
                request: a language outside a model's published
                `info.limits.languages` is rejected.
              type:
                - string
                - 'null'
              example: en
              maxLength: 16
            model:
              description: The model to use for transcription.
              type: string
              example: WhisperLargeV3
          type: object
    response_error_default:
      properties:
        data:
          description: Information from success endpoint
          type: object
        message:
          description: Error general message
          type: string
        errors:
          description: Information about errors
          type: array
          items: {}
        statusCode:
          description: Status code
          type: integer
        code:
          description: >-
            A stable, machine-readable reason, on the responses that publish
            one. Refused credentials (401): `missing_key` — no Bearer
            credentials arrived at all; `invalid_key` — a key was presented but
            is unknown, carries the wrong secret, or is malformed; `key_expired`
            — past its expiry date; `key_revoked` — deactivated. Refused
            requests: `insufficient_permissions` (403), `ip_not_allowed` (403),
            `active_key_limit_reached` (422), `insufficient_balance` (422),
            `key_limit_exceeded` (402), `rate_limited` (429). Absent wherever a
            response publishes no code, so treat an unknown value as the status
            code alone — the list grows.
          type: string
          enum:
            - missing_key
            - invalid_key
            - key_expired
            - key_revoked
            - insufficient_permissions
            - ip_not_allowed
            - active_key_limit_reached
            - insufficient_balance
            - key_limit_exceeded
            - rate_limited
      type: object
    response_error_rate_limit:
      description: Rate limit exceeded response
      properties:
        message:
          description: Error message
          type: string
          example: Too Many Attempts.
      type: object
  headers:
    X-RateLimit-Policy:
      description: >-
        Every window that applies, as `<limit>;w=<seconds>` elements. Always
        present on a throttled response, so a single element means there is no
        daily limit — do not infer that from the absence of the Daily-* headers.
        `300;w=60` is minute-only; `3;w=60, 100;w=86400` is both.
      schema:
        type: string
        example: 3;w=60, 100;w=86400
    X-RateLimit-Source:
      description: >-
        Where the limit came from, so you know what would change it:

        `tier` — your account tier's rate for this endpoint;

        `fallback` — no rate configured for this tier and endpoint, degraded
        default in force;

        `model` — a per-model override for the model in the request, unaffected
        by your tier

        (only when the request carried a recognised `model`, otherwise the tier
        pool applies);

        `static` — a flat limit outside the tier system, identical for every
        account.


        If you ever see `fallback`, tell us: it means no rate is configured for
        that tier and endpoint.
      schema:
        type: string
        example: tier
        enum:
          - tier
          - fallback
          - model
          - static
    X-RateLimit-Limit:
      description: >-
        Maximum requests allowed per minute (RPM) — including on a `daily`
        rejection, where the day is reported by the Daily-* pair beside it. On a
        429 whose `X-RateLimit-Type` names a bucket outside the request rate
        (`key-creation`, `ip-not-allowed`) it is that bucket's allowance
        instead, over the window `X-RateLimit-Policy` gives.
      schema:
        type: integer
        example: 3
    X-RateLimit-Remaining:
      description: >-
        Requests left in the window `X-RateLimit-Limit` describes — so on a
        `daily` rejection it is the minute window and can still be non-zero;
        `X-RateLimit-Daily-Remaining` is the one at 0 there.
      schema:
        type: integer
        example: 2
    X-RateLimit-Reset:
      description: >-
        Epoch second at which the window described by `X-RateLimit-Limit`
        refills — the minute (RPM) one unless `X-RateLimit-Type` names another
        bucket. Fixed window: the value does not drift as you spend the quota.
        Describes the same window as X-RateLimit-Limit, including on a daily
        rejection.
      schema:
        type: integer
        example: 1755800460
    X-RateLimit-Daily-Limit:
      description: Maximum requests allowed per day (RPD)
      schema:
        type: integer
        example: 100
    X-RateLimit-Daily-Remaining:
      description: Remaining requests in current day window
      schema:
        type: integer
        example: 95
    X-RateLimit-Daily-Reset:
      description: >-
        Epoch second at which the daily (RPD) window refills — 86400 s after the
        first request that opened this bucket's window, not a calendar midnight.
        Present only when a daily limit applies.
      schema:
        type: integer
        example: 1755846000
    X-RateLimit-Type:
      description: >-
        Which limit rejected the request. Sent only on 429. Read it before
        anything else

        on the response: it decides what the other `X-RateLimit-*` headers are
        counting.


        `minute` — the per-request RPM window.
        `X-RateLimit-Limit`/`-Remaining`/`-Reset`

        describe it, and the Daily-* pair describes the day next to it when one
        applies.


        `daily` — the per-request RPD window. The Daily-* pair is the one at 0;
        the

        unprefixed trio keeps describing the minute window, so it can be
        non-zero.


        `key-creation` — the hourly cap on keys created over the API (`POST
        /v2/keys`),

        per account and shared by its ADMIN keys, counted separately from the
        request

        rate. The whole `X-RateLimit-*` set describes that bucket and there are
        no

        Daily-* headers, so `Retry-After` can be an hour while your request rate
        is

        barely touched. That is not a contradiction — it is a different bucket.


        `ip-not-allowed` — too many calls from an address your key's IP
        whitelist

        refuses. Counted against that address, never against your account: a
        call from a

        blocked address does not spend your request allowance, which is why it
        cannot be

        used to exhaust it. Fix the whitelist or call from a listed address.


        The buckets are independent, so do not compare figures across responses
        that

        report different types — and do not assume the minute window when a 429
        names

        another one, or you will retry straight into the same refusal.
      schema:
        type: string
        example: minute
        enum:
          - minute
          - daily
          - key-creation
          - ip-not-allowed
    Retry-After:
      description: >-
        Seconds until the window that rejected you frees up — the one
        `X-RateLimit-Type` names (up to 60 for minute, 3600 for key-creation,
        86400 for daily). Counted from when that window opened, not to a
        calendar boundary. Sent only on 429.
      schema:
        type: integer
        example: 60
  responses:
    ValidationError:
      description: >-
        Validation failed. Common errors include: model does not exist, model
        does not support the inference type for this endpoint, the model is not
        available on your plan (it requires a higher tier than your account has
        — upgrade to use it), or invalid request parameters.


        An account without the funds for the request is refused here too,
        reported on the `balance` field and carrying `code:
        insufficient_balance`. It is the one validation failure worth branching
        on: nothing about the request is wrong, so retrying it unchanged
        succeeds once the account is topped up. The code is present only when
        `balance` is the sole failure — a request that is also malformed is not
        a money problem.
      content:
        application/json:
          schema:
            properties:
              message:
                description: General error message
                type: string
                example: The selected model does not support Text To Image.
              code:
                description: >-
                  Only on a refusal for want of funds: `insufficient_balance`.
                  Absent on every other validation failure.
                type: string
                example: insufficient_balance
                enum:
                  - insufficient_balance
              errors:
                description: >-
                  Detailed validation errors by field. A model your plan does
                  not cover is reported on the "model" field with the message
                  "This model is not available on your plan. Please upgrade to
                  access it." Such a model is also omitted from GET /models.
                type: object
                example:
                  model:
                    - >-
                      This model is not available on your plan. Please upgrade
                      to access it.
            type: object
    RateLimitExceeded:
      description: >-
        Rate limit exceeded. `X-RateLimit-Type` says which bucket refused you
        and which bucket the other `X-RateLimit-*` headers describe: the minute
        (RPM) or daily (RPD) request window, or — on a key carrying an IP
        whitelist — `ip-not-allowed`, the separate allowance for calls from an
        address the list refuses. That last one is counted against the calling
        address rather than the account, so being refused from a blocked address
        never spends the owner's request allowance.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Daily-Limit:
          $ref: '#/components/headers/X-RateLimit-Daily-Limit'
        X-RateLimit-Daily-Remaining:
          $ref: '#/components/headers/X-RateLimit-Daily-Remaining'
        X-RateLimit-Type:
          $ref: '#/components/headers/X-RateLimit-Type'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        X-RateLimit-Daily-Reset:
          $ref: '#/components/headers/X-RateLimit-Daily-Reset'
        X-RateLimit-Source:
          $ref: '#/components/headers/X-RateLimit-Source'
        X-RateLimit-Policy:
          $ref: '#/components/headers/X-RateLimit-Policy'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/response_error_rate_limit'
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        Sanctum personal access token, sent as `Authorization: Bearer <token>`.
        The token is opaque — it carries no claims and no embedded expiry, so do
        not attempt to decode it. Issue and revoke tokens from your account
        dashboard.
      scheme: bearer

````

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