# Create Transcription

`POST /v1/audio/transcriptions`

Turn speech into text: voice notes, clips and call recordings, with the spoken language detected.

Synchronous. Send the audio as a multipart `file` (OpenAI SDK compatible) or as JSON with a public https `url`. Formats: wav, mp3, m4a and mp4, ogg and opus, flac, webm and more; up to 10 MB and 5 minutes per request. The audio is sent for recognition inline and never stored.
Billed by the second of audio at $0.0042 per minute on `spicy-transcribe-1` (minimum $0.0001 per request), settled to the length the recognizer measured. Nothing is generated, so there is no content block; a file that cannot be decoded is a 400 and nothing is charged. When recognition is unavailable the call returns 503, nothing charged: retry in a few seconds. Sandbox keys get a fixture transcript and pay nothing.

Base URL: `https://api.spicyapi.com`

## Authorizations

- `Authorization` (string, header, required): Bearer authentication header of the form `Bearer <token>`, where `<token>` is your SpicyAPI key (`sk-spicy-…`). Create one in the dashboard under API Keys.

## Body (multipart/form-data)

Send exactly one of `file` (multipart/form-data) or `url` (an `application/json` body).

- `file` (binary, multipart, optional): The audio file, at most 10 MB and 5 minutes.
- `url` (string, json, optional): Public https URL of the audio, fetched on your behalf (same limits; private, loopback and plain-IP hosts are refused).
- `model` (string, optional): `spicy-transcribe-1`, the default.
- `language` (string, optional): Optional hint when you know the language: `English`, `Chinese`, `German`, `Italian`, `Portuguese`, `Spanish`, `Japanese`, `Korean`, `French` or `Russian`. Omit to detect it.

## Request

```bash
curl --request POST \
  --url https://api.spicyapi.com/v1/audio/transcriptions \
  --header 'Authorization: Bearer $SPICYAPI_KEY' \
  --form 'file=@voice-note.m4a' \
  --form 'model=spicy-transcribe-1'

# or from a public URL
curl --request POST \
  --url https://api.spicyapi.com/v1/audio/transcriptions \
  --header 'Authorization: Bearer $SPICYAPI_KEY' \
  --header 'Content-Type: application/json' \
  --data '{ "url": "https://example.com/voice-note.mp3", "language": "English" }'
```

## Response: 200 application/json

Transcription

- `id` (string, required): Request id.
- `object` (string, required): Always `audio.transcription`.
- `model` (string, required): The model that transcribed.
- `text` (string, required): The transcript.
- `language` (string | null, required): The language detected (or the hint you sent), as a short code such as `en`.
- `duration_s` (number, required): Seconds of audio billed.
- `cost_usd` (number, required): What this request cost, in US dollars, already debited from your balance.

```json
{
  "id": "sj_4b8e21d7c3a9f0e1b2d4c6a8",
  "object": "audio.transcription",
  "model": "spicy-transcribe-1",
  "text": "Hey, it's me. I just got home, call me when you're free tonight.",
  "language": "en",
  "duration_s": 6,
  "cost_usd": 0.00042
}
```
