apicheats.dev elevenlabs/llms.txt Raw .md
POST

/v1/productions/orders/{order_id}/media

ElevenLabs API

Register Media

Base URL
https://api.elevenlabs.io
Auth
xi-api-key: <ELEVENLABS_API_KEY>
Last verified
2026-09-03 · upstream hash matched
Actions
Agents: curl -H "Accept: text/markdown" this URL
→ 211 tokens · Vary: Accept

Critical gotchas

Authentication uses the non-standard xi-api-key header, not Authorization: Bearer. Sending a Bearer token returns HTTP 401.

Text-to-speech responses are raw binary audio, not JSON. Write the body to a file (--output speech.mp3) rather than parsing it.

cURL

curl -X POST 'https://api.elevenlabs.io/v1/productions/orders/order-id/media' \  -H "xi-api-key: $ELEVENLABS_API_KEY" \  -F 'declared_language=string' \  -F 'media=@sample.bin' \  -F 'media_url=string' \  -F 'media_url_filename=string' \  -F 'media_url_content_type=string'
Get a free ElevenLabs API key → sponsored

Parameters

Name In Type Required Description
order_id path string Yes The ID of the order to which this media will be attached.
declared_language body string Yes The language code of the media content (e.g. 'en', 'es-ES'). Must be a supported source language for some order item kind.
media body string No The media file to upload. Mutually exclusive with media_url.
media_url body string No A URL to fetch the media file from. Mutually exclusive with media.
media_url_filename body string No The filename for URL-sourced media (e.g. 'example.mp4'). Required when using media_url.
media_url_content_type body string No The MIME type for URL-sourced media (e.g. 'video/mp4'). Required when using media_url.

Response 200 OK

{
  "media_id": "prodmedia_01jgb2zd68f8f9tfvbb968wb8z"
}