Skip to content

Upload a file

POST /v2/upload

Uploads an audio or video file (multipart form, field audio, up to 1000 MB) and returns its audio_url for POST /v2/pre-recorded. Or send the URL of a file as JSON ({"audio_url": "https://..."}): the API downloads it (same size limit, a public address only, redirects followed) and answers the same; audio_metadata.source is then that URL. Use it to keep a copy of a file whose link expires before the job runs. The file is kept as long as your workspace keeps its recorded audio. One upload feeds any number of jobs (one per option set, to compare them): deleting a job keeps the file while another job uses it, the last job's deletion deletes it. A workspace in zero data retention uploads nothing: 403. Jobs run on Gladia Enterprise's own pre-recorded hosts, or on Gladia's standard API (Gladia SaaS, with zero data retention), as the cluster's operator set it; the API is the same either way.

Authentication: your API key in the x-gladia-key header (Authentication).

Example

Terminal window
curl -X POST https://eu1.api.gladia.io/v2/upload \
-H "x-gladia-key: $GLADIA_API_KEY" \
-F "audio=@call.wav"

Try it

Body

  • audio_url string required

    The http(s) URL of an audio or video file the API downloads and stores, for a POST /v2/pre-recorded that may run later than the URL lives (a short-lived presigned link). It must be at a public address; redirects are followed. Same size limit as a multipart upload.

Responses

200 The file is stored.
  • audio_url string required

    The file's address for POST /v2/pre-recorded. Only your account's jobs can use it.

  • audio_metadata object required

    What the API read of the file.

    7 fields
    • id string required

      Identifier of the uploaded file.

    • filename string required

      Name of the uploaded file.

    • extension string required

      Extension of the file name.

    • size integer required

      Size of the file, in bytes.

    • audio_duration number required

      Duration in seconds, read from a WAV file's header; null for other formats (the job's file gives it once transcribed).

    • number_of_channels integer required

      Channels of a WAV file; null for other formats.

    • source string required

      The URL the file was downloaded from (the JSON form); null for a file sent in a multipart form.

Example
{
"audio_url": "https://eu1.api.gladia.io/file/0199d7a2-5c3e-7b41-9f0a-3c2d1e4f5a6b",
"audio_metadata": {
"id": "0199d7a2-5c3e-7b41-9f0a-3c2d1e4f5a6b",
"filename": "call.wav",
"extension": "wav",
"size": 960044,
"audio_duration": 30,
"number_of_channels": 1,
"source": "string"
}
}
400 The request is invalid (validation_errors lists why), or pre-recorded transcription is not available or turned off on this cluster (message says so): do not retry.
Error body
{
"statusCode": 400,
"timestamp": "2026-10-12T09:04:17.210Z",
"path": "/v2/live",
"message": "Invalid parameter(s). See validation_errors for more details.",
"request_id": "G-1a2b3c4d",
"validation_errors": [
"sample_rate Input should be 8000, 16000, 32000, 44100 or 48000"
],
"error": "string"
}
401 No API key, or an unknown one.
Error body
{
"statusCode": 400,
"timestamp": "2026-10-12T09:04:17.210Z",
"path": "/v2/live",
"message": "Invalid parameter(s). See validation_errors for more details.",
"request_id": "G-1a2b3c4d",
"validation_errors": [
"sample_rate Input should be 8000, 16000, 32000, 44100 or 48000"
],
"error": "string"
}
403 The key may not do this (its scopes, or the addresses it may be used from).
Error body
{
"statusCode": 400,
"timestamp": "2026-10-12T09:04:17.210Z",
"path": "/v2/live",
"message": "Invalid parameter(s). See validation_errors for more details.",
"request_id": "G-1a2b3c4d",
"validation_errors": [
"sample_rate Input should be 8000, 16000, 32000, 44100 or 48000"
],
"error": "string"
}
413 The file is larger than 1000 MB.
Error body
{
"statusCode": 400,
"timestamp": "2026-10-12T09:04:17.210Z",
"path": "/v2/live",
"message": "Invalid parameter(s). See validation_errors for more details.",
"request_id": "G-1a2b3c4d",
"validation_errors": [
"sample_rate Input should be 8000, 16000, 32000, 44100 or 48000"
],
"error": "string"
}
503 Pre-recorded transcription is not available right now: try again.
Error body
{
"statusCode": 400,
"timestamp": "2026-10-12T09:04:17.210Z",
"path": "/v2/live",
"message": "Invalid parameter(s). See validation_errors for more details.",
"request_id": "G-1a2b3c4d",
"validation_errors": [
"sample_rate Input should be 8000, 16000, 32000, 44100 or 48000"
],
"error": "string"
}