Ta strona jest dostępna tylko po angielsku.

Audio

Three endpoints in OpenAI's shape. The model is <provider>/<model>, for example openai/tts-1, openai/whisper-1 or openrouter/openai/whisper-large-v3-turbo.

EndpointUnitProviders
POST /v1/audio/speech1,000 input characters (1,000 UTF-8 bytes on Fish Audio models)openai, openrouter, elevenlabs, fish-audio, together, nanogpt, pollinations
POST /v1/audio/transcriptionsminute of audioopenai, groq, openrouter, elevenlabs, fish-audio
POST /v1/audio/translationsminute of audioopenai, groq
cURLcurl
1curl https://api.aile.sh/v1/audio/speech \
2-H "Authorization: Bearer $AILE_KEY" \
3-H "Content-Type: application/json" \
4-d '{ "model": "openai/tts-1", "voice": "alloy", "input": "Hello from Aile." }' \
5--output hello.mp3
6
7curl https://api.aile.sh/v1/audio/transcriptions \
8-H "Authorization: Bearer $AILE_KEY" \
9-F model=openai/whisper-1 \

Speech

  • input is up to 4,096 characters.
  • stream_format: "audio" streams the audio as it is made. stream_format: "sse" answers one speech.audio.delta and a speech.audio.done once the audio is finished.
  • stream: true is a 400. Use stream_format.
  • OpenRouter speech models take response_format mp3 (the default) or pcm.
  • ElevenLabs (elevenlabs/eleven_v4, eleven_v3, eleven_multilingual_v2, eleven_flash_v2_5, eleven_flash_v2) takes an ElevenLabs voice id as voice, not OpenAI's voice names; with none it uses its default voice. response_format is mp3, opus, pcm or wav. Its transcription models are elevenlabs/scribe_v2 and scribe_v2_medical.
  • Fish Audio (fish-audio/s2.1-pro, s2-pro, drama-3) takes a Fish Audio voice id (32 hex characters) as voice, not OpenAI's voice names; with none it uses Fish Audio's default voice. response_format is mp3, opus, pcm or wav. Its transcription models are fish-audio/transcribe-1-pro and transcribe-1; Pro marks speakers inline as <|speaker:N|>.

Transcription and translation

  • Upload is multipart/form-data, up to 25 MB. OpenRouter's JSON body (input_audio: { data, format }) is accepted too.
  • response_format is json (the default), text, verbose_json, srt or vtt. A model that returns only json still answers verbose_json, with no segments, and refuses timestamp_granularities[]=word.
  • stream: true returns the finished transcript as transcript.text.delta and transcript.text.done events.
  • A JSON answer's usage is { "type": "duration", "seconds": … }, the reported length.

Billing

  • Speech bills its input characters. A stream is billed in full once any audio reaches you, and not at all if the provider fails mid-stream.
  • Fish Audio models, on fish-audio and as openrouter/fish-audio/..., are counted in UTF-8 bytes, as Fish Audio bills them. One unit is 1,000 bytes: plain English is one byte a character, and other scripts use two to four.
  • Transcription holds an estimate from the upload's size and bills the duration the provider reports, up to the hold.
  • A response with no audio, or a transcript with no duration, is a 502 and is not charged.
  • A call with no answer by the deployment's buffered deadline (at most 120 seconds) is voided with a 504. For transcription, the upload's time counts.
  • A 502 or 504 arrives as 503 with the real code in x-aile-status.
  • A provider refusal you can fix (400, 404, 413, 422 …) passes through. One about the sharer's account is a 502 saying you were not charged.
  • A key's pins and the routing headers choose the sharer here too. x-aile-provider must match the model's prefix, and x-aile-max-price does not apply to a per-character or per-minute price.
  • Where the deployment enables it, speech also takes keyless x402, buffered only (stream_format: "audio" needs a key). So do transcription and translation, priced on the file's measured length (WAV, MP3, FLAC, OGG/Opus, M4A, WebM or AAC, up to 10 minutes); a file whose length cannot be read needs an API key. If the provider measures the audio more than 2% + 1 second longer than the file's header said, the transcript is withheld with a 400 and nothing is charged.
  • Audio is sent to the provider as uploaded. Aile does not inspect it.