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

# Poll job status, progress, and (once completed) the transcript

> Polls a job. Unlike the synchronous create and episode-read operations, `format` has **no default** here — omitting it and passing `?format=json` are different requests. Without `?format=` the response is `application/json` status only: the job status object, and `artifact` is never present, regardless of `status`. `?format=json` must be given explicitly to also receive the transcript: the same status object, now carrying `artifact` once `status` is `completed` — `artifact` is never implied by `completed` alone, so a caller polling for state does not repeatedly ship a whole transcript (see `JobStatus`).

**Delivery format.** `format: text|srt|vtt|md` on a `completed` job returns the raw artifact under its own media type (`text/plain`, `application/x-subrip`, `text/vtt`, `text/markdown`) rather than a JSON envelope, with provenance carried in headers — `X-Transcript-Episode-Id`, `X-Transcript-Source`, and `X-Transcript-Timing-Precision` — so every delivery format carries the same provenance. **The single content-type switch:** a payload over the ~5 MB inline limit returns `200 application/json` with `{ transcript_url, expires_at }` in *every* format, including the raw ones.

A non-`json` `format` against a job that is **not** `completed` is `409 job_not_completed` — there is no artifact to render yet, and the answer is to keep polling with no `format` (or with `format=json`) until the job is terminal. It is not a reason to wrap the status object in a different media type.



## OpenAPI

````yaml /openapi.yaml get /v1/transcripts/{job_id}
openapi: 3.1.0
info:
  title: Audivo API
  version: 0.11.0
  description: >-
    The Audivo API turns a public podcast episode into a clean, timed
    transcript. Name an episode by an Apple Podcasts link, by its RSS feed URL
    and GUID, or by the episode id an earlier answer gave you; get back
    structured, timed text — at once for an episode already transcribed, or as a
    job you poll for fresh audio.


    Two authentication schemes, and which an operation takes is part of what it
    is: `apiKeyBearer` — an `hk_live_` key sent as `Authorization: Bearer` —
    authenticates the public API, and `dashboardJwt` authenticates the
    dashboard's own operations. No operation that takes one accepts the other in
    its place. An API-key caller reads its balance and reservations from any
    quote response.


    Deferred on purpose, and absent from this document rather than hidden:
    webhooks, subscriptions, speaker labels beyond the frozen `diarized: false`
    shape, custom vocabulary, caller-selected engines, raw-audio URLs and
    uploads, SDKs, translation, and cross-corpus search. What changed in each
    version is on the documentation site's changelog.
  license:
    name: Proprietary
    url: https://docs.audivo.dev/legal/terms
servers:
  - url: https://k8mfogcvz4.execute-api.us-east-1.amazonaws.com/prod
    description: Production API. Append the operation path, including /v1.
security: []
tags:
  - name: Transcripts
    description: Create, poll, retrieve, and cancel transcription jobs.
  - name: Catalog
    description: >-
      Public podcast show/episode search, charts, detail, and resolution. Every
      metadata/search/list call in this tag costs 1 credit; no catalog response
      echoes `credits_charged`, so the charge is stated here rather than
      per-response. Not yet applied: the discovery operations shipped in 0.2.0
      (`GET /v1/search/shows`, `GET /v1/charts`) are metered by request rate
      only and write no credit-bearing row; the per-call charge lands with the
      catalog reads that bill.
  - name: Quotes
    description: >-
      Price a selection before spending. A quote resolves every episode in it,
      records what it resolved under a short TTL, and reserves nothing; the
      confirm that follows is the operation that spends, and it answers with a
      job group.
  - name: Groups
    description: >-
      The job group: what one confirm created. A group holds N ≥ 1 members, each
      a transcription job or a settled cache read; a single-episode `POST
      /v1/transcripts` is a group of one. A caller reads a group's rollup, lists
      their own groups newest first, and cancels a group, which cancels every
      member not yet started and releases each reservation exactly once.
  - name: Session
    description: >-
      Dashboard-JWT session establishment. One operation, called by the
      dashboard's backend-for-frontend whenever it turns a Cognito sign-in into
      a Audivo session, and the one place a caller who does not yet have an
      account is served.
  - name: Account
    description: Usage, limits, and supported languages for the calling account.
  - name: API Keys
    description: Dashboard-JWT key lifecycle management.
  - name: Billing
    description: Dashboard-JWT Stripe Checkout, Customer Portal, invoices, and refunds.
  - name: Data
    description: Dashboard-JWT portable export and account deletion.
paths:
  /v1/transcripts/{job_id}:
    get:
      tags:
        - Transcripts
      summary: Poll job status, progress, and (once completed) the transcript
      description: >-
        Polls a job. Unlike the synchronous create and episode-read operations,
        `format` has **no default** here — omitting it and passing
        `?format=json` are different requests. Without `?format=` the response
        is `application/json` status only: the job status object, and `artifact`
        is never present, regardless of `status`. `?format=json` must be given
        explicitly to also receive the transcript: the same status object, now
        carrying `artifact` once `status` is `completed` — `artifact` is never
        implied by `completed` alone, so a caller polling for state does not
        repeatedly ship a whole transcript (see `JobStatus`).


        **Delivery format.** `format: text|srt|vtt|md` on a `completed` job
        returns the raw artifact under its own media type (`text/plain`,
        `application/x-subrip`, `text/vtt`, `text/markdown`) rather than a JSON
        envelope, with provenance carried in headers —
        `X-Transcript-Episode-Id`, `X-Transcript-Source`, and
        `X-Transcript-Timing-Precision` — so every delivery format carries the
        same provenance. **The single content-type switch:** a payload over the
        ~5 MB inline limit returns `200 application/json` with `{
        transcript_url, expires_at }` in *every* format, including the raw ones.


        A non-`json` `format` against a job that is **not** `completed` is `409
        job_not_completed` — there is no artifact to render yet, and the answer
        is to keep polling with no `format` (or with `format=json`) until the
        job is terminal. It is not a reason to wrap the status object in a
        different media type.
      operationId: getTranscriptJob
      parameters:
        - $ref: '#/components/parameters/JobIdPathParam'
        - $ref: '#/components/parameters/PollFormatQueryParam'
      responses:
        '200':
          description: >-
            Job status — status only when `format` is omitted, `artifact`
            included when `status` is `completed` **and** `format=json` was
            explicitly requested — or the completed raw artifact
            (`format=text|srt|vtt|md`), or, for an oversized payload in any
            format, the `transcript_url` reference.
          headers:
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-RateLimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-Transcript-Episode-Id:
              $ref: '#/components/headers/XTranscriptEpisodeId'
            X-Transcript-Source:
              $ref: '#/components/headers/XTranscriptSource'
            X-Transcript-Timing-Precision:
              $ref: '#/components/headers/XTranscriptTimingPrecision'
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/JobStatus'
                  - $ref: '#/components/schemas/TranscriptUrlRef'
              examples:
                terminalFailure:
                  $ref: '#/components/examples/TerminalFailure'
                inProgress:
                  $ref: '#/components/examples/JobInProgress'
                bareCompleted:
                  $ref: '#/components/examples/TestModeCompletedStatusOnly'
                completedWithArtifact:
                  $ref: '#/components/examples/TestModeCompleted'
                oversizedArtifact:
                  $ref: '#/components/examples/OversizedArtifactRef'
            text/plain:
              schema:
                $ref: '#/components/schemas/RawTranscriptArtifact'
            application/x-subrip:
              schema:
                $ref: '#/components/schemas/RawTranscriptArtifact'
              examples:
                srt:
                  $ref: '#/components/examples/SrtArtifact'
            text/vtt:
              schema:
                $ref: '#/components/schemas/RawTranscriptArtifact'
            text/markdown:
              schema:
                $ref: '#/components/schemas/RawTranscriptArtifact'
        '400':
          $ref: '#/components/responses/BadRequestApiKey'
        '401':
          $ref: '#/components/responses/UnauthorizedApiKey'
        '404':
          $ref: '#/components/responses/NotFoundApiKey'
        '409':
          $ref: '#/components/responses/ConflictApiKeyJobNotCompleted'
        '429':
          $ref: '#/components/responses/TooManyRequestsApiKey'
        '500':
          $ref: '#/components/responses/InternalErrorApiKey'
      security:
        - apiKeyBearer: []
components:
  parameters:
    JobIdPathParam:
      name: job_id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/JobId'
    PollFormatQueryParam:
      name: format
      in: query
      required: false
      description: >-
        The derived output to return from `GET /v1/transcripts/{job_id}`. **No
        default** — deliberately not `FormatQueryParam`, which defaults to
        `json` on the operations where delivering content is the whole point of
        the call. Polling is different: the status-only option exists precisely
        so a caller can ask for state without shipping the transcript, and a
        default would make omitting `format` and passing `format=json` the same
        request, erasing that option. So: omit `format` entirely for status only
        — `application/json`, the job status object, `artifact` never present,
        whatever `status` is. Pass `format=json` explicitly to also receive the
        transcript once `status` is `completed` — the same status object, now
        with `artifact`. Pass `format=text|srt|vtt|md` to receive the raw
        artifact under its own media type (`text/plain`, `application/x-subrip`,
        `text/vtt`, `text/markdown`) once `completed`; against a job that has
        not reached `completed`, any non-status `format` is `409
        job_not_completed`.


        Delivery-only: never affects the cache key or the produced transcript
        content.
      schema:
        $ref: '#/components/schemas/TranscriptFormat'
  headers:
    XRequestId:
      description: >-
        Echoed on every response, success or error. A refusal generated at the
        edge (401, 429, and the unmetered-key 500) carries API Gateway's own
        hyphenated request id after the `req_` prefix; a response from a
        function carries the same id without hyphens.
      schema:
        type: string
        pattern: ^req_[A-Za-z0-9-]+$
        maxLength: 100
    XRateLimitLimit:
      description: >-
        The caller's requests-per-minute ceiling for the current tier. Present
        on every response for a resolved caller, success and error alike; absent
        from `401 unauthenticated`, which has no account to report a ceiling
        for, and from the edge's own `429`, which is emitted before any function
        runs.
      schema:
        type: integer
        minimum: 0
    XTranscriptEpisodeId:
      description: >-
        The canonical `episode_id` of the delivered transcript, so a raw
        artifact is not provenance-free. Absent on responses that carry no
        transcript.
      schema:
        $ref: '#/components/schemas/EpisodeId'
    XTranscriptSource:
      description: >-
        The delivered transcript's `source` — the pinned ASR engine, or
        `publisher` for passthrough. Absent on responses that carry no
        transcript.
      schema:
        $ref: '#/components/schemas/TranscriptSource'
    XTranscriptTimingPrecision:
      description: >-
        The delivered transcript's `timing_precision` (`word | segment | none`).
        every transcript exposes it, so it travels with every delivery format —
        a raw SRT body reports the same precision the canonical JSON would.
        Absent on responses that carry no transcript.
      schema:
        $ref: '#/components/schemas/TimingPrecision'
    RetryAfter:
      description: >-
        Seconds to wait before retrying. Sent with the edge's `rate_limited`
        throttle refusal. Not sent with `concurrency_limited`, which clears when
        one of the account's own jobs reaches a terminal state — a moment the
        API cannot put a number on.
      schema:
        type: integer
        minimum: 0
  schemas:
    JobStatus:
      type: object
      additionalProperties: false
      required:
        - job_id
        - status
        - episode_id
        - estimated_credits
        - reserved_credits
        - created_at
      description: >-
        Failure/cancellation objects report `reservation_released: true` and
        never imply a cash refund occurred — a cash refund is a separate,
        explicit Stripe refund via `POST /v1/billing/refund`.
      properties:
        job_id:
          $ref: '#/components/schemas/JobId'
        status:
          $ref: '#/components/schemas/JobState'
        episode_id:
          $ref: '#/components/schemas/EpisodeId'
        progress:
          $ref: '#/components/schemas/JobProgress'
        estimated_credits:
          $ref: '#/components/schemas/CreditAmount'
        reserved_credits:
          $ref: '#/components/schemas/CreditAmount'
        settled_credits:
          $ref: '#/components/schemas/CreditAmount'
          description: >-
            Present on terminal `completed` jobs; measured usage capped at the
            reservation.
        released_credits:
          $ref: '#/components/schemas/CreditAmount'
          description: >-
            Present on terminal states; the unused portion of the reservation
            released back to the account.
        reservation_released:
          type: boolean
          description: >-
            Present on terminal `failed`/`cancelled` jobs. Never implies a cash
            refund.
        ledger_event_ids:
          type: array
          maxItems: 20
          items:
            type: string
            minLength: 1
            maxLength: 80
          description: Immutable ledger event IDs, present on terminal states.
        error:
          $ref: '#/components/schemas/ErrorDetail'
          description: >-
            Present when `status` is `failed`; code `processing_failed` with
            retryability metadata.
        artifact:
          $ref: '#/components/schemas/TranscriptArtifact'
          description: >-
            The completed transcript, in JSON delivery. Present only when
            `status` is `completed` **and** the caller explicitly asked for it
            with `?format=json` on `GET /v1/transcripts/{job_id}` —
            `PollFormatQueryParam` has no default, so omitting `format` there is
            a real, distinct request that never carries `artifact`, whatever
            `status` is. It is deliberately *not* required by `completed`: a
            client polling a finished job would otherwise be forced to
            re-download the whole transcript on every call, with no status-only
            option.
        created_at:
          type: string
          format: date-time
        started_at:
          type: string
          format: date-time
        completed_at:
          type: string
          format: date-time
      allOf:
        - if:
            required:
              - status
            properties:
              status:
                const: failed
          then:
            required:
              - reservation_released
              - released_credits
              - error
          else:
            not:
              required:
                - error
        - if:
            required:
              - status
            properties:
              status:
                const: cancelled
          then:
            required:
              - reservation_released
              - released_credits
        - if:
            required:
              - status
            properties:
              status:
                enum:
                  - failed
                  - cancelled
          else:
            not:
              required:
                - reservation_released
        - if:
            required:
              - status
            properties:
              status:
                const: completed
          then:
            required:
              - settled_credits
              - released_credits
          else:
            allOf:
              - not:
                  required:
                    - settled_credits
              - not:
                  required:
                    - artifact
        - if:
            required:
              - status
            properties:
              status:
                enum:
                  - completed
                  - failed
                  - cancelled
          else:
            allOf:
              - not:
                  required:
                    - released_credits
              - not:
                  required:
                    - ledger_event_ids
    TranscriptUrlRef:
      type: object
      additionalProperties: false
      required:
        - transcript_url
        - expires_at
      description: >-
        The oversized-payload response — the single content-type switch in this
        API. A transcript above the ~5 MB inline limit is never sent inline in
        any format; instead the response is `200 application/json` with a
        presigned URL (24 h) and its expiry, even when `format` asked for
        `text`, `srt`, `vtt`, or `md`. For `format=json` the media type does not
        change, and the same two fields appear inside the JSON envelope
        (`TranscriptRead.transcript_url` / `TranscriptArtifact.transcript_url`)
        in place of the inline transcript — the behavior is identical in every
        format; only the raw formats also change media type.
      properties:
        transcript_url:
          type: string
          format: uri
          maxLength: 2048
        expires_at:
          type: string
          format: date-time
    RawTranscriptArtifact:
      type: string
      maxLength: 5000000
      description: >-
        A derived transcript artifact delivered as a raw body under its own
        media type: `text/plain` (`format=text`), `application/x-subrip`
        (`srt`), `text/vtt` (`vtt`), or `text/markdown` (`md`). Provenance
        travels in the `X-Transcript-Episode-Id`, `X-Transcript-Source`, and
        `X-Transcript-Timing-Precision` response headers, because a raw body has
        no field to carry it. Bodies above the ~5 MB inline limit are not sent
        here at all: that response switches to `application/json` carrying a
        `TranscriptUrlRef`.
    JobId:
      type: string
      pattern: ^job_[A-Za-z0-9]{16,32}$
      maxLength: 40
      description: Opaque, server-generated job identifier.
    TranscriptFormat:
      type: string
      enum:
        - json
        - text
        - srt
        - vtt
        - md
      description: >-
        Delivery-only: never affects the cache key or the produced transcript
        content. Every format is derived at read time from the one canonical
        transcript. Response media type per format: `json` → `application/json`,
        `text` → `text/plain`, `srt` → `application/x-subrip`, `vtt` →
        `text/vtt`, `md` → `text/markdown`. The one exception is an oversized
        payload, which is `application/json` in every format (see
        `TranscriptUrlRef`).
    EpisodeId:
      type: string
      pattern: ^ep_[a-z2-7]{16}$
      description: Canonical episode identifier.
    TranscriptSource:
      type: string
      enum:
        - qwen3-asr
        - whisper-large-v3-turbo
        - whisper-large-v3
        - publisher
      description: >-
        The ASR engine that produced this transcript, or `publisher` for
        passthrough.
    TimingPrecision:
      type: string
      enum:
        - word
        - segment
        - none
      description: >-
        How precisely segments/words are timed. ASR output targets `word`.
        Publisher-sourced transcripts report the precision the source actually
        provides and never claim word timing they do not have: plain text is
        `none`, segment-timed sources are `segment`, and only genuine word-timed
        sources are `word`.
    JobState:
      type: string
      enum:
        - validating
        - queued
        - downloading
        - transcribing
        - merging
        - completed
        - failed
        - cancelled
      description: >-
        Legal transitions: validating → queued|failed|cancelled; queued →
        downloading|failed|cancelled; downloading → transcribing|failed;
        transcribing → merging|failed; merging → completed|failed. Terminal
        states (completed, failed, cancelled) have no further transitions.
        Cancellation is legal only from validating/queued; every non-terminal
        state may fail.
    JobProgress:
      type: object
      additionalProperties: false
      required:
        - chunks_done
        - chunks_total
        - percent
        - realtime_factor
        - eta_seconds
      properties:
        chunks_done:
          type: integer
          minimum: 0
          maximum: 100000
        chunks_total:
          type: integer
          minimum: 0
          maximum: 100000
        percent:
          type: number
          minimum: 0
          maximum: 100
        realtime_factor:
          type: number
          minimum: 0
          maximum: 10000
        eta_seconds:
          description: >-
            Estimated wall-clock seconds remaining until this job reaches a
            terminal state, or `null` if not yet computable. Same quantity and
            same bound as `estimated_seconds`, measured later in the job's life
            — so it shares `EstimatedProcessingSeconds` rather than carrying its
            own copy of the audio-duration ceiling.
          anyOf:
            - $ref: '#/components/schemas/EstimatedProcessingSeconds'
            - enum:
                - null
    CreditAmount:
      type: integer
      minimum: 0
      maximum: 9007199254740991
      description: >-
        A non-negative JavaScript-safe integer credit amount. The upper bound
        matches `Number.MAX_SAFE_INTEGER`, which is enforced by the domain
        ledger so arithmetic and JSON round-trips cannot silently lose cents
        worth of credit precision.
    ErrorDetail:
      type: object
      additionalProperties: false
      required:
        - type
        - code
        - message
        - doc_url
        - request_id
        - retryable
      properties:
        type:
          $ref: '#/components/schemas/ErrorType'
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          minLength: 1
          maxLength: 1000
        doc_url:
          type: string
          format: uri
          maxLength: 300
        request_id:
          $ref: '#/components/schemas/RequestId'
        retryable:
          type: boolean
      oneOf:
        - required:
            - code
            - type
          properties:
            code:
              enum:
                - invalid_request
                - invalid_url
                - source_not_supported
                - unsafe_source
            type:
              const: invalid_request
        - required:
            - code
            - type
          properties:
            code:
              enum:
                - duration_exceeded
                - size_exceeded
                - unsupported_codec
                - unsupported_language
                - credits_not_refundable
            type:
              const: unprocessable_input
        - required:
            - code
            - type
          properties:
            code:
              const: unauthenticated
            type:
              const: unauthenticated
        - required:
            - code
            - type
          properties:
            code:
              enum:
                - idempotency_conflict
                - job_not_completed
                - quote_expired
                - quote_mismatch
                - quote_unverified
                - expected_total_mismatch
                - request_in_progress
                - account_suspended
                - account_closed
                - account_not_found
                - api_key_limit_reached
                - tier_unchanged
            type:
              const: conflict
        - required:
            - code
            - type
          properties:
            code:
              enum:
                - feed_dead
                - episode_not_found
                - show_not_found
                - job_not_found
                - quote_not_found
                - group_not_found
                - api_key_not_found
                - credit_lot_not_found
            type:
              const: not_found
        - required:
            - code
            - type
          properties:
            code:
              const: content_blocked
            type:
              const: content_blocked
        - required:
            - code
            - type
          properties:
            code:
              const: payment_required
            type:
              const: payment_required
        - required:
            - code
            - type
          properties:
            code:
              enum:
                - rate_limited
                - concurrency_limited
            type:
              const: rate_limited
        - required:
            - code
            - type
          properties:
            code:
              enum:
                - engine_unavailable
                - processing_failed
                - discovery_unavailable
                - internal_error
            type:
              const: unavailable
        - required:
            - code
            - type
          properties:
            code:
              const: nothing_to_quote
            type:
              const: unprocessable_input
    TranscriptArtifact:
      type: object
      additionalProperties: false
      required:
        - format
      description: >-
        The JSON delivery of a completed job's transcript, embedded in
        `JobStatus` when `status` is `completed` and JSON delivery was
        requested. `format` is always `json` here: the other formats are
        delivered as raw bodies (`RawTranscriptArtifact`), never wrapped in this
        envelope. Payloads above the ~5 MB inline limit carry `transcript_url`
        (presigned, 24 h) plus `expires_at` instead of an inline `transcript`.
      properties:
        format:
          const: json
        transcript:
          $ref: '#/components/schemas/CanonicalTranscript'
        transcript_url:
          type: string
          format: uri
          maxLength: 2048
        expires_at:
          type: string
          format: date-time
      oneOf:
        - required:
            - transcript
        - required:
            - transcript_url
            - expires_at
    Error:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
    EstimatedProcessingSeconds:
      type: integer
      minimum: 0
      maximum: 72000
      description: >-
        Estimated **wall-clock** seconds until the job reaches a terminal state
        — intended for choosing a poll interval. This is *not* audio duration:
        audio duration has its own field (`duration_sec` on the transcript,
        `duration_sec` on `EpisodeSummary`), and conflating the two silently
        misprices everything a caller derives from it. The committed examples
        only make sense under this reading: `estimated_seconds: 420` alongside
        `estimated_credits: 268` cannot be audio seconds, because 7 audio
        minutes bills 7 credits at `CREDITS_PER_AUDIO_MINUTE`, while 268 credits
        is about 4.5 hours of audio.


        The bound is derived from that meaning rather than copied from the audio
        cap: twice the published 10-hour `max_audio_duration_seconds` ceiling,
        an end-to-end envelope that still holds at a pathological 1× realtime
        factor. The real hard per-job timeout is duration-scaled and much
        shorter.
    ErrorType:
      type: string
      enum:
        - invalid_request
        - unprocessable_input
        - unauthenticated
        - conflict
        - not_found
        - content_blocked
        - payment_required
        - rate_limited
        - unavailable
      description: >-
        The family an error belongs to, for handling; `code` is the precise
        reason. `invalid_request`: something in the request is wrong — fix the
        integration. `unprocessable_input`: the request is well-formed but the
        episode or resource is outside published support. `unauthenticated`:
        missing, malformed, revoked or expired credential. `payment_required`:
        the account's credits cannot cover the ceiling. `conflict`: the
        resource's or the account's state refuses this request as sent — a
        lapsed quote, a reused idempotency key, a held account. `not_found`: the
        job, quote, group or key the request named does not exist for this
        account. `rate_limited`: over a plan limit; wait and retry.
        `unavailable`: a failure on our side or at a provider; retry, and quote
        `request_id` if it persists.
    ErrorCode:
      type: string
      enum:
        - invalid_request
        - invalid_url
        - unauthenticated
        - idempotency_conflict
        - job_not_completed
        - source_not_supported
        - feed_dead
        - episode_not_found
        - show_not_found
        - unsafe_source
        - unsupported_codec
        - unsupported_language
        - duration_exceeded
        - size_exceeded
        - content_blocked
        - payment_required
        - rate_limited
        - concurrency_limited
        - job_not_found
        - api_key_not_found
        - api_key_limit_reached
        - credit_lot_not_found
        - credits_not_refundable
        - engine_unavailable
        - processing_failed
        - discovery_unavailable
        - nothing_to_quote
        - internal_error
        - quote_not_found
        - group_not_found
        - quote_expired
        - quote_mismatch
        - quote_unverified
        - expected_total_mismatch
        - request_in_progress
        - account_suspended
        - account_closed
        - account_not_found
        - tier_unchanged
      description: >-
        Every code the API returns, and the HTTP status it comes with.
        `invalid_request`, `invalid_url` → 400. `unauthenticated` → 401.
        `payment_required` → 402. `job_not_found`, `quote_not_found`,
        `group_not_found`, `api_key_not_found`, `credit_lot_not_found` → 404.
        `idempotency_conflict`, `request_in_progress`, `job_not_completed`,
        `quote_expired`, `quote_mismatch`, `quote_unverified`,
        `expected_total_mismatch`, `account_suspended`, `account_closed`,
        `account_not_found`, `api_key_limit_reached`, `tier_unchanged` → 409.
        `source_not_supported`, `feed_dead`, `episode_not_found`,
        `show_not_found`, `unsafe_source`, `unsupported_codec`,
        `unsupported_language`, `duration_exceeded`, `size_exceeded`,
        `nothing_to_quote`, `credits_not_refundable` → 422. `content_blocked` →
        451. `rate_limited`, `concurrency_limited` → 429. `internal_error`,
        `processing_failed` → 500. `discovery_unavailable`, `engine_unavailable`
        → 503. `processing_failed` also appears inside a failed job's `error`
        field rather than as a live status. Each code has a heading on the
        documentation site's errors page, which is what `doc_url` links to.
    RequestId:
      type: string
      pattern: ^req_[A-Za-z0-9-]+$
      maxLength: 100
    CanonicalTranscript:
      type: object
      additionalProperties: false
      required:
        - episode_id
        - show_id
        - language
        - duration_sec
        - source
        - source_revision
        - model_version
        - pipeline_version
        - timing_precision
        - diarized
        - warnings
        - segments
        - created_at
      properties:
        episode_id:
          $ref: '#/components/schemas/EpisodeId'
        show_id:
          $ref: '#/components/schemas/ShowId'
        language:
          $ref: '#/components/schemas/Language'
          description: Resolved BCP-47 language code.
        duration_sec:
          type: number
          minimum: 0
          maximum: 129600
        source:
          $ref: '#/components/schemas/TranscriptSource'
        source_revision:
          type: string
          minLength: 1
          maxLength: 150
          description: >-
            e.g. `sha256:...` — the asset revision this transcript was produced
            from.
        model_version:
          type: string
          minLength: 1
          maxLength: 100
          description: Provider-pinned model version, or `publisher` for passthrough.
        pipeline_version:
          type: string
          minLength: 1
          maxLength: 60
        timing_precision:
          $ref: '#/components/schemas/TimingPrecision'
        diarized:
          const: false
          description: Always `false` in the MVP; diarization is post-MVP.
        warnings:
          type: array
          maxItems: 1000
          items:
            $ref: '#/components/schemas/TranscriptWarning'
        segments:
          type: array
          maxItems: 200000
          items:
            $ref: '#/components/schemas/TranscriptSegment'
        created_at:
          type: string
          format: date-time
    ShowId:
      type: string
      pattern: ^sh_[a-z2-7]{16}$
      description: Canonical show identifier.
    Language:
      type: string
      pattern: ^[A-Za-z]{2,3}(-[A-Za-z0-9]{1,8})*$
      maxLength: 35
      description: >-
        A BCP-47 language tag (general syntax check, not full IANA subtag
        validation).
    TranscriptWarning:
      type: object
      additionalProperties: false
      required:
        - segment
        - type
        - detail
      description: >-
        A quality warning from the pipeline's own checks, attached to the
        segment it concerns. Presented as a heuristic, not an accuracy
        guarantee; the transcript is delivered and charged as usual. `type` is
        an open string rather than a closed enum; the documentation's
        output-formats page lists the values in use.
      properties:
        segment:
          type: integer
          minimum: 0
          maximum: 1000000
        type:
          type: string
          minLength: 1
          maxLength: 60
        detail:
          type: string
          minLength: 1
          maxLength: 500
    TranscriptSegment:
      type: object
      additionalProperties: false
      required:
        - id
        - start
        - end
        - speaker
        - text
      properties:
        id:
          type: integer
          minimum: 0
          maximum: 1000000
        start:
          type: number
          minimum: 0
          maximum: 129600
          description: Start time in seconds.
        end:
          type: number
          minimum: 0
          maximum: 129600
          description: End time in seconds.
        speaker:
          enum:
            - null
          description: >-
            Always `null` in the MVP — diarization is post-MVP. A future
            diarized-speaker field is a deliberate, reviewed type change, not a
            silent widening.
        text:
          type: string
          maxLength: 20000
        words:
          type: array
          maxItems: 20000
          items:
            $ref: '#/components/schemas/TranscriptWord'
          description: Present when `timing_precision` is `word`; absent otherwise.
    TranscriptWord:
      type: object
      additionalProperties: false
      required:
        - w
        - s
        - e
      properties:
        w:
          type: string
          minLength: 1
          maxLength: 200
          description: The word text.
        s:
          type: number
          minimum: 0
          maximum: 129600
          description: Start time in seconds.
        e:
          type: number
          minimum: 0
          maximum: 129600
          description: End time in seconds.
  examples:
    TerminalFailure:
      summary: Terminal failure with a released reservation
      value:
        job_id: job_7bQ2vXpL9mZaK4tR
        status: failed
        episode_id: ep_unzqwwyevfss5jtb
        estimated_credits: 180
        reserved_credits: 225
        released_credits: 225
        reservation_released: true
        ledger_event_ids:
          - ledger_reserve_8f3a9c2b
          - ledger_release_1d4e9f2c
        error:
          type: unavailable
          code: processing_failed
          message: >-
            The ASR provider failed after 3 retries; the reservation was fully
            released.
          doc_url: https://docs.audivo.dev/errors#processing_failed
          request_id: req_8f3a9c2b1d4e
          retryable: true
        created_at: '2026-08-20T09:00:00Z'
        started_at: '2026-08-20T09:00:04Z'
        completed_at: '2026-08-20T09:14:22Z'
    JobInProgress:
      summary: A job mid-transcription, with progress
      value:
        job_id: job_9k2fA7bQ3xzM1LpN
        status: transcribing
        episode_id: ep_hbrpoigf3cbfnobm
        progress:
          chunks_done: 7
          chunks_total: 13
          percent: 54
          realtime_factor: 41.2
          eta_seconds: 118
        estimated_credits: 268
        reserved_credits: 335
        created_at: '2026-08-28T09:00:00Z'
        started_at: '2026-08-28T09:00:04Z'
    TestModeCompletedStatusOnly:
      summary: >-
        Test-mode key — bare poll (`format` omitted) on the same completed job —
        status only, no artifact
      description: >-
        The exact same job as `TestModeCompleted` (`job_test000000000001`),
        polled with no `format` — `PollFormatQueryParam` has no default, so this
        is a genuinely different request from `?format=json`, and the response
        never carries `artifact`, even though `status` is `completed`. Pair this
        with `TestModeCompleted` to see the same job answer two different ways.
      value:
        job_id: job_test000000000001
        status: completed
        episode_id: ep_2o4rak3vrjnvgfyg
        estimated_credits: 10
        reserved_credits: 13
        settled_credits: 1
        released_credits: 12
        ledger_event_ids:
          - ledger_test_reserve_0001
          - ledger_test_settle_0001
        created_at: '2026-08-28T08:59:00Z'
        started_at: '2026-08-28T08:59:01Z'
        completed_at: '2026-08-28T08:59:05Z'
    TestModeCompleted:
      summary: Test-mode key — completed job, deterministic fixture transcript
      value:
        job_id: job_test000000000001
        status: completed
        episode_id: ep_2o4rak3vrjnvgfyg
        estimated_credits: 10
        reserved_credits: 13
        settled_credits: 1
        released_credits: 12
        ledger_event_ids:
          - ledger_test_reserve_0001
          - ledger_test_settle_0001
        artifact:
          format: json
          transcript:
            episode_id: ep_2o4rak3vrjnvgfyg
            show_id: sh_k4n7qzvw2mtxyabc
            language: en
            duration_sec: 60
            source: qwen3-asr
            source_revision: sha256:testfixture00000000000000000000000000000000000000
            model_version: qwen3-asr-1.7b-test-fixture
            pipeline_version: 2026.08-vad4-fw1.2
            timing_precision: word
            diarized: false
            warnings: []
            segments:
              - id: 0
                start: 0
                end: 3.2
                speaker: null
                text: This is a deterministic test-mode transcript.
                words:
                  - w: This
                    s: 0
                    e: 0.2
            created_at: '2026-08-28T09:00:00Z'
        created_at: '2026-08-28T08:59:00Z'
        started_at: '2026-08-28T08:59:01Z'
        completed_at: '2026-08-28T08:59:05Z'
    OversizedArtifactRef:
      summary: Oversized payload — the single content-type switch
      description: >-
        A transcript above the ~5 MB inline limit is returned as `200
        application/json` carrying a presigned URL and its expiry, in *every*
        `format` — so a caller that asked for `srt` receives JSON here rather
        than `application/x-subrip`.
      value:
        transcript_url: https://cdn.hark.dev/transcripts/ep_f4tcqk2zmvbxyna7.srt?sig=abc
        expires_at: '2026-08-21T09:14:22Z'
    SrtArtifact:
      summary: '`?format=srt` on a completed transcript — a raw SRT body'
      description: >-
        Served as `application/x-subrip`, not as a JSON-wrapped string.
        Provenance travels alongside it in `X-Transcript-Episode-Id`,
        `X-Transcript-Source`, and `X-Transcript-Timing-Precision`.
      value: |
        1
        00:00:00,000 --> 00:00:06,480
        Welcome back to the show…

        2
        00:00:06,480 --> 00:00:12,500
        Today we are talking about podcasts.
  responses:
    BadRequestApiKey:
      description: >-
        Invalid request shape or an unrecognized pointer. Codes:
        `invalid_request`, `invalid_url`.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnauthorizedApiKey:
      description: >-
        Code `unauthenticated` — the API key is missing, malformed, revoked, or
        does not exist. Every operation in this document is authenticated, so
        this is the most common error path a client will hit; it is declared on
        all of them rather than left implicit. The response never distinguishes
        "no such key" from "revoked key". Unlike every other API-key response it
        carries no `X-RateLimit-Limit`: that is a per-account figure, and an
        unauthenticated request has no resolved account to report one for.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFoundApiKey:
      description: >-
        Codes: `feed_dead`, `episode_not_found`, `show_not_found`, or
        `job_not_found` (the job does not exist or belongs to another account —
        cross-account access is indistinguishable from nonexistence).
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ConflictApiKeyJobNotCompleted:
      description: >-
        Code `job_not_completed` — a non-`json` `?format=` was requested
        (`PollFormatQueryParam`) on a job that has not reached `completed`; keep
        polling with no `format` or with `format=json`.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequestsApiKey:
      description: >-
        Codes `rate_limited` or `concurrency_limited`, from two different limits
        and two different places. `rate_limited` is the per-account request
        rate, refused at the edge before the operation runs: it carries
        `Retry-After` and no `X-RateLimit-Limit`, because nothing that knows the
        caller's tier has run yet. `concurrency_limited` is the cap on jobs open
        at once, refused by the operation itself: it carries `X-RateLimit-Limit`
        like every other answered response, and no `Retry-After`, because it
        clears when one of the account's own jobs finishes rather than after a
        fixed wait.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-RateLimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalErrorApiKey:
      description: >-
        Code `internal_error` — a failure on our side that no other code
        describes. The message is fixed text and says nothing about the cause;
        `request_id` is what identifies it in our logs. Retryable.
      headers:
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKeyBearer:
      type: http
      scheme: bearer
      bearerFormat: hk_live_... or hk_test_...
      description: >-
        `Authorization: Bearer hk_live_...` for live keys or `Authorization:
        Bearer hk_test_...` for test-mode keys. `hk_test_` keys resolve real
        public catalog metadata but return deterministic committed fixtures,
        never call inference, and never mutate live credits. This is the *only*
        transport for the credential: the `x-api-key` alias once documented was
        removed in 0.2.0, because the edge authorizer reads `Authorization` as
        its single identity source and a request on any other header is refused
        before it is authenticated.


        Never accepted on a `dashboardJwt` operation, and there are no
        exceptions. `GET /v1/usage` and `GET /v1/limits` briefly declared both
        schemes (0.8.0); that was withdrawn in 0.8.1 because no deployed route
        could honor it — both operations are served by the control-plane API,
        whose authorizer verifies a Cognito token and refuses an `hk_live_`
        credential on shape, and the customer API does not route either path. An
        API-key holder reads its balance and reservation from `QuoteResponse`,
        which carries `balance_credits` and `reserved_credits` on every quote.
        Every operation in this document takes one scheme or the other and
        refuses the wrong one as `unauthenticated`.

````