---
title: "Speech to text"
method: POST
path: "/audio/transcriptions"
tags: ["Audio"]
---

# Speech to text

`POST /audio/transcriptions`

## Request

- Base URL: `https://www.aimagicx.com/api/v1`
- URL: `https://www.aimagicx.com/api/v1/audio/transcriptions`
- Auth: HTTP bearer

Transcribes audio into text with support for multiple languages and speaker detection.

## Request body

- SpeechToTextRequest
  - `file` string, required: Audio URL or base64 data
  - `model` string
  - `language` string: ISO language code or 'auto'
  - `response_format` 'json' | 'text' | 'srt' | 'vtt'
  - `timestamp_granularities` string[]
  - `diarization` boolean: Enable speaker detection
  - `translation` boolean: Translate to English

## Response `200`

Successful response

- SpeechToTextResponse
  - `text` string
  - `segments` object[]
    - `start` number
    - `end` number
    - `text` string
    - `speaker` string, nullable
  - `words` object[]
    - `word` string
    - `start` number
    - `end` number
  - `language` string
  - `duration` number
  - `model` string
  - `model_tier` string
  - `usage` Usage
    - `credits_used` integer
    - `credits_breakdown` object
    - `prompt_tokens` integer
    - `completion_tokens` integer
    - `total_tokens` integer

## Other responses

- `400`: Bad request - invalid parameters
- `401`: Unauthorized - invalid or missing API key

---

[API](https://skmtc.dev/aimagicx/apis/ai-magicx-api.md) - [All operations](https://skmtc.dev/aimagicx/apis/ai-magicx-api/llms.txt) - [OpenAPI document](https://skmtc.dev/aimagicx/apis/ai-magicx-api/revisions/08210272abb4?raw)
