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

# Create a transcription

> Turn a recording into text or subtitles in the language spoken, with Whisper. Upload audio as multipart/form-data.

Turns a recording into text or subtitles in the language spoken, with one of the [Whisper models](https://docs.sharemy.ai/models.md#transcription-and-translation). Send the audio as `multipart/form-data` in a field named `file`.

## Audio

* **Formats:** WAV, MP3, M4A (MP4 audio), OGG, FLAC, WebM and AAC.
* **Size:** up to 25 MB (26,214,400 bytes).
* **Length:** up to 30 minutes.

The length is read from the file's header to set the price. WAV files are decoded on our side; other formats are decoded on the machine that runs the job.

## Formats

| `response_format` | `Content-Type` | What you get |
| - | - | - |
| `json` (default) | `application/json` | `{"text": "..."}` |
| `verbose_json` | `application/json` | `task`, `language`, `duration`, `text` and timed `segments` |
| `text` | `text/plain` | The transcript |
| `srt` | `application/x-subrip` | SubRip subtitles |
| `vtt` | `text/vtt` | WebVTT subtitles |

## Speakers

`diarize` is not part of OpenAI's API. Send `diarize=true` (or `1`) to label who spoke:

* In `verbose_json`, each segment has a `speaker`, and `speakers` lists them all.
* In `srt` and `vtt`, each cue starts with the speaker's name.

It costs 25% more.

```bash theme={null}
curl https://sharemy.ai/v1/audio/transcriptions \
  -H "Authorization: Bearer $SHAREMYAI_API_KEY" \
  -F file=@meeting.mp3 \
  -F model=whisper-base \
  -F response_format=srt \
  -F diarize=true
```

With the OpenAI Python SDK, send it with `extra_body={"diarize": "true"}`.

## Language

Send `language` as an ISO-639-1 code, such as `en` or `fr`, if you know it. Leave it out, or send `auto`, to detect it.

## Price

Priced per minute of audio, and never less than 15 seconds' worth. See [Credits and pricing](https://docs.sharemy.ai/credits-and-pricing.md#transcription-and-translation).

## Differences from OpenAI

* **`timestamp_granularities[]`:** only `segment`. `word` is refused.
* **`prompt`** and **`temperature`** are accepted and ignored.
* **`model`** defaults to `whisper-base`. `whisper-1` is taken as `whisper-base`.
* **Not supported:** `stream`, `include[]`, `chunking_strategy`. They are ignored.
* **Extra:** `diarize`, above.


## OpenAPI

````yaml api-reference/openapi.json POST /v1/audio/transcriptions
openapi: 3.1.0
info:
  title: ShareMyAI API
  version: 1.0.0
  description: >-
    OpenAI-shaped endpoints that run jobs on shared GPUs. Closing the connection
    cancels an unfinished synchronous job and returns its held credits. CORS
    allows any origin, echoes requested preflight headers and exposes Location,
    the request id, concurrency, retry, cost, balance, token cap and sample rate
    headers.
servers:
  - url: https://sharemy.ai
    description: ShareMyAI
security:
  - bearerAuth: []
tags:
  - name: Models
  - name: Chat
  - name: Images
  - name: Jobs
  - name: Audio
paths:
  /v1/audio/transcriptions:
    post:
      tags:
        - Audio
      summary: Create a transcription
      description: Turn a recording into text or subtitles, in the language spoken.
      operationId: createTranscription
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TranscriptionRequest'
      responses:
        '200':
          $ref: '#/components/responses/Transcript'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientCredits'
        '403':
          $ref: '#/components/responses/Suspended'
        '405':
          $ref: '#/components/responses/MethodNotAllowed'
        '413':
          $ref: '#/components/responses/TooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedAudio'
        '429':
          $ref: '#/components/responses/TooManyCalls'
        '499':
          $ref: '#/components/responses/Cancelled'
        '502':
          $ref: '#/components/responses/NetworkError'
        '503':
          $ref: '#/components/responses/NoProvider'
      x-codeSamples:
        - lang: bash
          label: curl
          source: |-
            curl https://sharemy.ai/v1/audio/transcriptions \
              -H "Authorization: Bearer $SHAREMYAI_API_KEY" \
              -F file=@meeting.mp3 \
              -F model=whisper-base \
              -F response_format=verbose_json \
              -F diarize=true
        - lang: python
          label: Python
          source: >-
            import os

            from openai import OpenAI


            client = OpenAI(api_key=os.environ["SHAREMYAI_API_KEY"],
            base_url="https://sharemy.ai/v1")


            with open("meeting.mp3", "rb") as audio:
                transcript = client.audio.transcriptions.create(model="whisper-base", file=audio)
            print(transcript.text)
        - lang: javascript
          label: Node
          source: >-
            import fs from "node:fs";

            import OpenAI from "openai";


            const client = new OpenAI({ apiKey: process.env.SHAREMYAI_API_KEY,
            baseURL: "https://sharemy.ai/v1" });


            const transcript = await client.audio.transcriptions.create({
              model: "whisper-base",
              file: fs.createReadStream("meeting.mp3"),
            });

            console.log(transcript.text);
components:
  schemas:
    TranscriptionRequest:
      type: object
      required:
        - file
      properties:
        file:
          type: string
          contentMediaType: application/octet-stream
          description: >-
            The recording: WAV, MP3, M4A, OGG, FLAC, WebM or AAC. Up to 25 MB
            and 30 minutes.
        model:
          type: string
          enum:
            - whisper-base
            - whisper-tiny-en
            - whisper-large-v3-turbo
            - whisper-1
          default: whisper-base
          description: '`whisper-1` is taken as `whisper-base`.'
        language:
          type: string
          description: >-
            The language spoken, as an ISO-639-1 code such as `en`. Leave it
            out, or send `auto`, to detect it.
        response_format:
          type: string
          enum:
            - json
            - text
            - verbose_json
            - srt
            - vtt
          default: json
        timestamp_granularities[]:
          type: array
          items:
            type: string
            enum:
              - segment
          description: Only `segment`. `word` is refused.
        diarize:
          type: string
          enum:
            - 'true'
            - 'false'
          description: >-
            Not part of OpenAI's API. `true` (or `1`) labels who spoke each
            segment, and costs 25% more.
        prompt:
          type: string
          description: Accepted and ignored.
        temperature:
          type: number
          description: Accepted and ignored.
    Transcript:
      type: object
      description: '`response_format` `json`.'
      required:
        - text
      properties:
        text:
          type: string
    VerboseTranscript:
      type: object
      description: '`response_format` `verbose_json`.'
      properties:
        task:
          type: string
          enum:
            - transcribe
            - translate
        language:
          type:
            - string
            - 'null'
          description: The language, when known. `en` for translations.
        duration:
          type: number
          description: Length of the recording in seconds.
        text:
          type: string
        segments:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
              start:
                type: number
                description: Seconds from the start.
              end:
                type: number
                description: Seconds from the start.
              text:
                type: string
              speaker:
                type: string
                description: Who spoke, with `diarize`.
        speakers:
          type: array
          items:
            type: string
          description: Every speaker found, with `diarize`.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorDetail'
    ErrorDetail:
      type: object
      required:
        - message
        - type
        - param
        - code
      properties:
        message:
          type: string
          description: What went wrong, for a person to read.
        type:
          type: string
          description: >-
            402 uses insufficient_quota, other 4xx errors use
            invalid_request_error, and 5xx errors use api_error.
          enum:
            - invalid_request_error
            - insufficient_quota
            - api_error
        param:
          type:
            - string
            - 'null'
          description: The request field at fault, when there is one.
        code:
          type:
            - string
            - 'null'
          description: A stable code. The Errors and limits page lists them all.
          examples:
            - model_not_found
        price_credits:
          type: number
          description: Job price in credits on an insufficient_quota error.
        balance_credits:
          type: number
          description: Account balance in credits on an insufficient_quota error.
      if:
        properties:
          code:
            const: insufficient_quota
      then:
        required:
          - price_credits
          - balance_credits
  responses:
    Transcript:
      description: >-
        The transcript, in the format asked for. With `diarize`, each `srt` and
        `vtt` cue starts with the speaker's name.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/Transcript'
              - $ref: '#/components/schemas/VerboseTranscript'
        text/plain:
          schema:
            type: string
            description: '`response_format` `text`.'
        application/x-subrip:
          schema:
            type: string
            description: '`response_format` `srt`.'
        text/vtt:
          schema:
            type: string
            description: '`response_format` `vtt`.'
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        X-ShareMyAI-Cost-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Cost-Credits'
        X-ShareMyAI-Balance-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Balance-Credits'
    BadRequest:
      description: >-
        A field failed validation (invalid_value, model_not_found or
        unsupported_value), the body could not be read (null), a content check
        failed (content_policy_violation), or the job input was malformed
        (invalid_input).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Choose a temperature from 0 to 2.
              type: invalid_request_error
              param: temperature
              code: invalid_value
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        X-ShareMyAI-Cost-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Cost-Credits'
        X-ShareMyAI-Balance-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Balance-Credits'
        X-ShareMyAI-Max-Tokens:
          $ref: '#/components/headers/X-ShareMyAI-Max-Tokens'
        x-should-retry:
          $ref: '#/components/headers/x-should-retry'
    Unauthorized:
      description: >-
        The message distinguishes a missing token, a key without the smai_
        prefix and an unknown or revoked ShareMyAI token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: >-
                Send your API token as Authorization: Bearer smai_…. Create one
                at https://sharemy.ai, account panel, API tokens.
              type: invalid_request_error
              param: null
              code: invalid_api_key
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
    InsufficientCredits:
      description: The balance is less than the job's price.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: >-
                This costs 8.192 credits and your balance is 3.000 credits. Add
                credits at https://sharemy.ai.
              type: insufficient_quota
              param: null
              code: insufficient_quota
              price_credits: 8.192
              balance_credits: 3
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        X-ShareMyAI-Max-Tokens:
          $ref: '#/components/headers/X-ShareMyAI-Max-Tokens'
        x-should-retry:
          $ref: '#/components/headers/x-should-retry'
    Suspended:
      description: The account is suspended.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: >-
                This account is suspended. If you think that is a mistake,
                contact us.
              type: invalid_request_error
              param: null
              code: account_suspended
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        X-ShareMyAI-Cost-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Cost-Credits'
        X-ShareMyAI-Balance-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Balance-Credits'
        X-ShareMyAI-Max-Tokens:
          $ref: '#/components/headers/X-ShareMyAI-Max-Tokens'
    MethodNotAllowed:
      description: The path exists. Use a method listed in Allow (method_not_allowed).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        Allow:
          $ref: '#/components/headers/Allow'
    TooLarge:
      description: >-
        The file is over 25 MB (`file_too_large`) or the recording is over 30
        minutes (`audio_too_long`).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Send a file of 25 MB or less.
              type: invalid_request_error
              param: file
              code: file_too_large
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
    UnsupportedAudio:
      description: >-
        The file is not audio in a format the API reads, or a WAV file could not
        be decoded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: Send WAV, MP3, M4A, OGG, FLAC, WebM or AAC audio.
              type: invalid_request_error
              param: file
              code: unsupported_audio
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
    TooManyCalls:
      description: >-
        Four job calls are already in flight across the account's tokens, or
        eligible machines stayed busy for 10 minutes. Both return
        rate_limit_exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: At most 4 API calls at once. Wait for one to finish.
              type: invalid_request_error
              param: null
              code: rate_limit_exceeded
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        X-ShareMyAI-Cost-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Cost-Credits'
        X-ShareMyAI-Balance-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Balance-Credits'
        X-ShareMyAI-Max-Tokens:
          $ref: '#/components/headers/X-ShareMyAI-Max-Tokens'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
    Cancelled:
      description: >-
        The caller hung up before the job finished. The job was dropped and its
        credits returned.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        X-ShareMyAI-Cost-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Cost-Credits'
        X-ShareMyAI-Balance-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Balance-Credits'
        X-ShareMyAI-Max-Tokens:
          $ref: '#/components/headers/X-ShareMyAI-Max-Tokens'
    NetworkError:
      description: >-
        The job failed on the network, for example after three machines in turn
        left or stopped answering. Its credits were returned.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: >-
                The machine running this left the network. (request
                69ba81e5-6a67-4cd5-a28b-2e023337b936)
              type: api_error
              param: null
              code: network_error
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        X-ShareMyAI-Cost-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Cost-Credits'
        X-ShareMyAI-Balance-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Balance-Credits'
        X-ShareMyAI-Max-Tokens:
          $ref: '#/components/headers/X-ShareMyAI-Max-Tokens'
    NoProvider:
      description: >-
        No machine offers the model at submission, or an accepted job has had no
        eligible machine for about a minute.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              message: >-
                No machine that runs this model is online right now. (request
                69ba81e5-6a67-4cd5-a28b-2e023337b936)
              type: api_error
              param: null
              code: no_provider
      headers:
        x-request-id:
          $ref: '#/components/headers/x-request-id'
        x-ratelimit-limit-concurrent:
          $ref: '#/components/headers/x-ratelimit-limit-concurrent'
        x-ratelimit-remaining-concurrent:
          $ref: '#/components/headers/x-ratelimit-remaining-concurrent'
        X-ShareMyAI-Cost-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Cost-Credits'
        X-ShareMyAI-Balance-Credits:
          $ref: '#/components/headers/X-ShareMyAI-Balance-Credits'
        X-ShareMyAI-Max-Tokens:
          $ref: '#/components/headers/X-ShareMyAI-Max-Tokens'
        x-should-retry:
          $ref: '#/components/headers/x-should-retry'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
  headers:
    x-request-id:
      description: Identifier for this API response.
      schema:
        type: string
    x-ratelimit-limit-concurrent:
      description: Job slots per account across all tokens.
      schema:
        type: integer
        const: 4
    x-ratelimit-remaining-concurrent:
      description: Free account slots when headers are sent.
      schema:
        type: integer
        minimum: 0
        maximum: 4
    X-ShareMyAI-Cost-Credits:
      description: >-
        Quoted price in credits when a job was accepted. For a Janus batch, the
        total for completed pictures.
      schema:
        type: number
    X-ShareMyAI-Balance-Credits:
      description: >-
        Balance in credits after the hold, from the last successful quote on a
        Janus batch.
      schema:
        type: number
    X-ShareMyAI-Max-Tokens:
      description: Only on chat requests whose output budget was capped.
      schema:
        type: integer
        const: 4096
    x-should-retry:
      description: >-
        Suppress automatic retries for insufficient_quota,
        content_policy_violation or no_provider.
      schema:
        type: string
        const: 'false'
    Allow:
      description: Methods available for the requested path, including OPTIONS.
      schema:
        type: string
    Retry-After:
      description: >-
        Seconds to wait. 2 on async submission and unfinished polls, 1 on a 429,
        and 30 on HTTP 503 no_provider.
      schema:
        type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API token from the account panel on sharemy.ai. Tokens start with
        `smai_`.

````

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