MorphogenDocs
API

Transcriptions

POST /v1/audio/transcriptions: speech recognition.

POST/v1/audio/transcriptions

Turns audio into text. The format is compatible with OpenAI Audio: client.audio.transcriptions.create(...) works. You need a model of the "Speech" category: whisper-large-v3. The request is accepted as multipart/form-data with a file or as JSON with base64 audio. There is no streaming and no PII masking.

Headers

HeaderValue
AuthorizationBearer <key>. Required. x-api-key: <key> is accepted instead
Content-Typemultipart/form-data or application/json
X-Morphogen-Spacespc_…: the spending space. Optional

Request body

modelstringrequired

A recognition model from GET /v1/models, for example whisper-large-v3.

filefilerequired

The audio file in a multipart request. The request size is at most 26 MiB. In the JSON variant, audio is passed in base64 in the input_audio field.

languagestring

The language code, for example ru. It helps the model if the language is known in advance.

Spending is counted by the audio duration in seconds.

Request example

curl https://api.morphogen.ru/v1/audio/transcriptions \
  -H "Authorization: Bearer $MORPHOGEN_API_KEY" \
  -F model=whisper-large-v3 \
  -F language=ru \
  -F file=@meeting.mp3

Response example

{
  "text": "Начинаем встречу. Первый вопрос: сроки релиза.",
  "usage": { "type": "duration", "seconds": 4.129 }
}

Errors

400invalid_multipartThe multipart body could not be parsed.
400invalid_jsonThe JSON body could not be parsed.
400model_category_mismatchThe model is not in the speech category.
400pii_masking_unsupported_endpointThe request has X-PII-Masking: on.
401invalid_api_keyThe key is missing, invalid, revoked or expired.
402insufficient_fundsThe balance does not cover the request reserve.
403model_not_allowedThe model is not in the key's list.
404model_not_foundThere is no such model in the catalog.
413request_too_largeThe request is larger than 26 MiB.
429rate_limit_exceededThe request limit per minute is exceeded.

Other codes: Errors.

On this page