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

# Transcribe audio

> Turns a recording of speech into text, with OpenAI's transcription request and reply. Send the recording as a WAV file of 16-bit PCM in a multipart form, at most 5 minutes long and 10 MiB. Each call costs a flat 200 micros, a fiftieth of a credit. A failed call costs nothing. whisper-large-v3-tee runs Whisper Large v3 on NEAR's attested hardware, and Morse sends the audio to it only over the TLS key its attestation report binds.



## OpenAPI

````yaml /openapi.json post /v1/audio/transcriptions
openapi: 3.1.1
info:
  title: Morse API
  version: '1'
  description: >-
    The Morse API serves chat, image, web search, page-reading, and
    transcription models through an OpenAI-compatible interface. Each request
    pays with your Morse account's credits.


    Send an API key from the Morse app with every request, in the Authorization
    header as Bearer sk_morse_.... A key acts for its account and always pays
    with credits, never with a plan's included use. One credit is $0.01. GET
    /v1/models lists prices in micro-dollars, 10,000 to the credit. Keep keys on
    your server. Browsers on other sites cannot call the API.


    All of an account's keys and its owner's use of the Morse app share one
    budget of requests per minute and one limit on requests in flight. The
    account's plan sets both. A request refused for either limit carries
    Retry-After, the number of seconds to wait. A retried POST is a new request,
    and the API charges it again.


    An error reply is JSON in the Error shape, with a stable code. A path the
    API does not serve returns 404 as plain text, and a wrong method returns 405
    as plain text.
servers:
  - url: https://api.trymorse.ai
security:
  - apiKey: []
paths:
  /v1/audio/transcriptions:
    post:
      summary: Transcribe audio
      description: >-
        Turns a recording of speech into text, with OpenAI's transcription
        request and reply. Send the recording as a WAV file of 16-bit PCM in a
        multipart form, at most 5 minutes long and 10 MiB. Each call costs a
        flat 200 micros, a fiftieth of a credit. A failed call costs nothing.
        whisper-large-v3-tee runs Whisper Large v3 on NEAR's attested hardware,
        and Morse sends the audio to it only over the TLS key its attestation
        report binds.
      operationId: transcribe
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TranscriptionRequest'
            example:
              model: whisper-large-v3-tee
              file: (the recording, as a 16-bit PCM WAV file)
              language: en
      responses:
        '200':
          description: The transcript.
          headers:
            X-Morse-Version:
              $ref: '#/components/headers/X-Morse-Version'
            X-Funding:
              $ref: '#/components/headers/X-Funding'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transcription'
              example:
                text: >-
                  And so, my fellow Americans, ask not what your country can do
                  for you.
                usage:
                  type: duration
                  seconds: 11
        '400':
          description: The request is malformed.
          x-error-codes:
            - code: invalid_parameter
              when: >-
                The body is not a multipart form with a model and a file, a
                field is unknown or sent twice, the file is not a WAV file of
                16-bit PCM, mono or stereo, at 8 to 48 kHz, or holds no audio,
                language is not a code Whisper transcribes, or response_format
                is not json. The message names the problem.
            - code: invalid_request
              when: The provider could not read the audio.
            - code: e2ee_unsupported_model
              when: >-
                The request carries end-to-end encryption headers, which no
                transcription model takes. An incomplete set gets the e2ee_ code
                that names what is wrong with it instead.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    file must be a WAV file of 16-bit PCM, mono or stereo, at 8
                    to 48 kHz.
                  type: invalid_request_error
                  param: null
                  code: invalid_parameter
          headers:
            X-Morse-Version:
              $ref: '#/components/headers/X-Morse-Version'
        '401':
          description: The key is missing or wrong.
          x-error-codes:
            - code: invalid_api_key
              when: >-
                The Authorization header is missing or not Bearer, the key is
                unknown or revoked, or a token that starts with sk_ is not a
                whole sk_morse_ key.
            - code: api_key_expired
              when: >-
                The key is past the expiry set on it. Make a new key, or set a
                later expiry before a key expires.
            - code: invalid_token
              when: >-
                The bearer token is not a Morse API key. Send the whole
                sk_morse_ key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Incorrect API key provided.
                  type: invalid_request_error
                  param: null
                  code: invalid_api_key
          headers:
            X-Morse-Version:
              $ref: '#/components/headers/X-Morse-Version'
        '402':
          description: >-
            The account's credits, or what the key's spend limit has left, do
            not cover the request.
          x-error-codes:
            - code: insufficient_balance
              when: >-
                The balance is below the amount the request must hold. While the
                balance is negative, the API refuses every metered request.
            - code: key_spend_limit_reached
              when: >-
                What the key's spend limit has left in its window is below the
                amount the request must hold. A limit that resets daily, weekly,
                or monthly sends Retry-After, the seconds until it resets. A
                limit that never resets sends none. Raise or remove the limit in
                the dashboard, and the next request is served.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: The account balance does not cover this request. Add credit.
                  type: insufficient_balance
                  param: null
                  code: insufficient_balance
          headers:
            X-Morse-Version:
              $ref: '#/components/headers/X-Morse-Version'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
        '403':
          description: The key's account may not make this request.
          x-error-codes:
            - code: account_disabled
              when: Morse has disabled the key's account.
            - code: account_deleted
              when: The key's account has been deleted.
            - code: account_under_18
              when: The account's owner said they are under 18.
            - code: ip_not_allowed
              when: >-
                The key allows requests only from its allowed IPs, and the
                request came from another address. The message names the address
                the proxy saw.
            - code: model_tier_not_allowed
              when: >-
                The model's tier is below the key's minimum tier. GET /v1/models
                lists only the models the key may call.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: This account has been disabled. Contact support.
                  type: invalid_request_error
                  param: null
                  code: account_disabled
          headers:
            X-Morse-Version:
              $ref: '#/components/headers/X-Morse-Version'
        '404':
          description: The model does not exist, or it is not a model for this endpoint.
          x-error-codes:
            - code: model_not_found
              when: No model of this endpoint's type has that name.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: The requested model does not exist.
                  type: invalid_request_error
                  param: null
                  code: model_not_found
          headers:
            X-Morse-Version:
              $ref: '#/components/headers/X-Morse-Version'
        '408':
          description: The request body arrived too slowly.
          x-error-codes:
            - code: request_timeout
              when: The request body did not arrive within one minute.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: The request body did not arrive in time.
                  type: invalid_request_error
                  param: null
                  code: request_timeout
          headers:
            X-Morse-Version:
              $ref: '#/components/headers/X-Morse-Version'
        '413':
          description: The request body is too large.
          x-error-codes:
            - code: request_too_large
              when: >-
                The body is over 10 MiB, or the recording is longer than 5
                minutes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Request body is too large.
                  type: invalid_request_error
                  param: null
                  code: request_too_large
          headers:
            X-Morse-Version:
              $ref: '#/components/headers/X-Morse-Version'
        '429':
          description: >-
            The account is over its rate limit or its concurrency limit.
            Transcription also allows 30 calls a minute per account. Wait the
            number of seconds in Retry-After, then retry.
          x-error-codes:
            - code: rate_limit_exceeded
              when: >-
                The account used up its requests per minute. All of the
                account's keys and its owner's use of the Morse app share one
                budget.
            - code: concurrency_limit_exceeded
              when: >-
                The account already has its maximum number of requests in
                flight. Retry-After is 1.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    Rate limit reached for this account. Retry after the time in
                    the Retry-After header.
                  type: requests
                  param: null
                  code: rate_limit_exceeded
          headers:
            X-Morse-Version:
              $ref: '#/components/headers/X-Morse-Version'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
        '502':
          description: The transcription provider failed.
          x-error-codes:
            - code: upstream_error
              when: The provider failed or did not answer.
            - code: upstream_unavailable
              when: The provider is unavailable right now. Retry later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: The transcription provider failed.
                  type: upstream_error
                  param: null
                  code: upstream_error
          headers:
            X-Morse-Version:
              $ref: '#/components/headers/X-Morse-Version'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
        '503':
          description: >-
            Morse or the provider is busy or unavailable. Retry the request
            later.
          x-error-codes:
            - code: service_unavailable
              when: Morse could not start the request. Retry it.
            - code: server_busy
              when: Morse is busy. Retry-After is 1.
            - code: upstream_busy
              when: >-
                The transcription provider is busy for every Morse account, or
                busy itself. Retry later.
            - code: upstream_unattested
              when: Morse could not verify the attested endpoint. Try again shortly.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: The transcription provider is busy. Try again shortly.
                  type: upstream_error
                  param: null
                  code: upstream_busy
          headers:
            X-Morse-Version:
              $ref: '#/components/headers/X-Morse-Version'
            X-Request-Id:
              $ref: '#/components/headers/X-Request-Id'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
components:
  schemas:
    TranscriptionRequest:
      type: object
      required:
        - model
        - file
      additionalProperties: false
      properties:
        model:
          type: string
          description: A transcription model's id, such as whisper-large-v3-tee.
        file:
          type: string
          format: binary
          description: >-
            The recording, as a WAV file of 16-bit PCM, mono or stereo, at 8 to
            48 kHz, read from its bytes whatever its file name or Content-Type.
            At most 5 minutes long, and 10 MiB with the other fields.
        language:
          type: string
          description: >-
            The spoken language as an ISO-639-1 code Whisper transcribes, such
            as en. Without it, Whisper detects the language.
        response_format:
          const: json
          description: Only json, the default.
    Transcription:
      type: object
      required:
        - text
        - usage
      additionalProperties: false
      properties:
        text:
          type: string
          description: The transcript, without surrounding whitespace.
        usage:
          type: object
          required:
            - type
            - seconds
          additionalProperties: false
          properties:
            type:
              const: duration
            seconds:
              type: integer
              description: >-
                The length of the audio, rounded up to a whole second. A flat
                price per call does not depend on it.
    Error:
      type: object
      description: >-
        Every JSON error reply has this shape. Branch on code, which is stable.
        The message is for people and can change.
      additionalProperties: false
      required:
        - error
      properties:
        error:
          type: object
          additionalProperties: false
          required:
            - message
            - type
            - param
            - code
          properties:
            message:
              type: string
              description: A sentence that says what went wrong and what to do.
            type:
              type: string
              description: >-
                The error's family, such as invalid_request_error,
                insufficient_balance, plan, requests, upstream_error, or
                server_error. plan means the account's plan does not allow the
                model, even when credits pay for the request.
            param:
              type:
                - string
                - 'null'
              description: Always null on the endpoints documented here.
            code:
              type: string
              description: >-
                The specific error. Each operation lists the codes it can
                return.
  headers:
    X-Morse-Version:
      description: The running build. Every reply carries it.
      schema:
        type: string
    X-Funding:
      description: >-
        What pays for the request. With a key, the value is always credits. A
        request that Morse refuses before it bills anything has no X-Funding.
      schema:
        type: string
        enum:
          - credits
          - included
    X-Request-Id:
      description: >-
        An id for this request. Quote it when you contact support about the
        request. An error that arrives after the request starts carries it too.
        A request that Morse refuses before it bills anything has no
        X-Request-Id.
      schema:
        type: string
    Retry-After:
      description: Whole seconds to wait before retrying, at least 1.
      schema:
        type: integer
        minimum: 1
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: sk_morse_...
      description: An API key from the Morse app. It starts with sk_morse_.

````

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