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

> ## Agent Instructions
> Follow the content contract in AGENTS.md.
> Treat text as the canonical explanation; video and screenshots enhance it.
> Do not publish unverified product behavior or duplicate an existing canonical article.

# Read the stored transcript of a Meta video by content hash

> Never transcribes. 404 transcript_not_found until a request has stored the row; a stored failure is served as `unavailable` with its reason.



## OpenAPI

````yaml /developers/openapi/stefanbrain-v1.json get /api/developers/v1/media/transcripts/{contentSha256}
openapi: 3.1.0
info:
  title: StefanBrain Developer API
  version: 1.0.0
  description: >-
    REST access to StefanBrain agent runs, tools, and jobs. Authenticate with an
    API key from Settings → Developers. REST usage bills your prepaid API wallet
    at the published per-token rates (see
    https://docs.stefanbrain.com/developers/pricing); the MCP endpoint
    (/api/developers/v1/mcp, not described here) is member pricing from your
    plan pool. Human documentation: https://docs.stefanbrain.com/developers
servers:
  - url: https://stefanbrain.com
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: tools
    description: Directly invocable StefanBrain tools.
  - name: jobs
    description: Long-running tool jobs (poll for results).
  - name: runs
    description: Agentic chat runs with event streams.
  - name: files
    description: Workspace files agent runs produced in a chat.
  - name: media
    description: 'Stored Meta ad media facts: video transcripts on demand.'
  - name: feedback
    description: >-
      Tell StefanBrain where the API got in your way, and read the team's
      replies.
paths:
  /api/developers/v1/media/transcripts/{contentSha256}:
    get:
      tags:
        - media
      summary: Read the stored transcript of a Meta video by content hash
      description: >-
        Never transcribes. 404 transcript_not_found until a request has stored
        the row; a stored failure is served as `unavailable` with its reason.
      operationId: getMediaTranscript
      parameters:
        - name: contentSha256
          in: path
          required: true
          schema:
            type: string
            pattern: ^[0-9a-f]{64}$
            description: >-
              SHA-256 of the stored video bytes
              (meta_ad_media_assets.content_sha256).
      responses:
        '200':
          description: >-
            The stored transcript (`ready`) or the stored verdict
            (`unavailable`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaTranscriptOutcome'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, invalid, or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Suspended key, missing plan access, or key scoped away from this
            surface (code api_key_scope_forbidden).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            No visible video for this hash (code video_not_found) or no stored
            transcript yet (code transcript_not_found).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            Rate limited (codes request_per_minute, request_per_minute_user,
            request_per_day, user_throttled, user_suspended; Retry-After header
            when the limit has a reset time, plus limits, observed counts, and
            reset_at in the body), the runtime has no capacity to start a turn
            right now (code runtime_capacity_busy, Retry-After: 5), wallet
            exhausted (code api_wallet_exhausted), key budget exhausted (code
            api_key_budget_exhausted), or the plan's monthly usage pool spent
            for OAuth-token traffic (code monthly_usage_limit_reached).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    MediaTranscriptOutcome:
      oneOf:
        - type: object
          required:
            - status
            - transcript
          properties:
            status:
              type: string
              const: ready
            transcript:
              $ref: '#/components/schemas/MediaTranscript'
        - type: object
          required:
            - status
            - jobId
            - contentSha256
          properties:
            status:
              type: string
              const: queued
            jobId:
              type: string
              format: uuid
            contentSha256:
              type: string
              pattern: ^[0-9a-f]{64}$
              description: >-
                SHA-256 of the stored video bytes
                (meta_ad_media_assets.content_sha256).
        - type: object
          required:
            - status
            - reason
            - contentSha256
            - retryAfter
          properties:
            status:
              type: string
              const: unavailable
            reason:
              type: string
            contentSha256:
              type:
                - string
                - 'null'
              pattern: ^[0-9a-f]{64}$
              description: >-
                SHA-256 of the stored video bytes
                (meta_ad_media_assets.content_sha256).
            retryAfter:
              type:
                - string
                - 'null'
              format: date-time
              description: Set while a stored provider failure is still inside its backoff.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - rate_limit_error
                - api_error
                - service_unavailable_error
            code:
              type: string
          additionalProperties: true
      additionalProperties: true
    MediaTranscript:
      type: object
      description: The stored transcript with the provenance the store records.
      properties:
        contentSha256:
          type: string
          pattern: ^[0-9a-f]{64}$
          description: >-
            SHA-256 of the stored video bytes
            (meta_ad_media_assets.content_sha256).
        provider:
          type: string
          const: assemblyai
        speechModel:
          type:
            - string
            - 'null'
        modelRevision:
          type:
            - string
            - 'null'
          description: The provider's transcript id.
        languageCode:
          type:
            - string
            - 'null'
        audioSource:
          type:
            - string
            - 'null'
          enum:
            - embedded
            - muxed
            - external
            - null
        durationSeconds:
          type:
            - number
            - 'null'
        costMinutes:
          type:
            - number
            - 'null'
        transcriptText:
          type: string
        words:
          type: array
          items:
            type: object
            properties:
              text:
                type: string
              startMs:
                type: integer
              endMs:
                type: integer
              confidence:
                type:
                  - number
                  - 'null'
        attemptCount:
          type: integer
        firstMediaAssetId:
          type:
            - string
            - 'null'
        firstAdAccountId:
          type:
            - string
            - 'null'
        requestedBySurface:
          type: string
          description: The surface whose request produced this row.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authorization: Bearer stefan_sk_... (API key — bills the API wallet) or
        stefan_oat_... (OAuth member token — bills your plan pool).
    apiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````

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