Skip to content

Audio task endpoints ​

Use a ph0ny API key in Authorization: Bearer $PH0NY_API_KEY. These endpoints accept multipart/form-data with a required file field. A missing file returns HTTP 400. Provider-backed tasks may return HTTP 501 when the required provider credential is unavailable.

Detect language ​

bash
curl -X POST https://api.ph0ny.com/v1/audio/detect-language \
  -H "Authorization: Bearer $PH0NY_API_KEY" \
  -F file=@speech.wav

Returns JSON with language, confidence, and alternatives. The gateway uses OpenAI Whisper when configured, otherwise Deepgram. The response header X-Phony-Provider identifies the provider that ran.

Identify speakers ​

bash
curl -X POST https://api.ph0ny.com/v1/audio/identify \
  -H "Authorization: Bearer $PH0NY_API_KEY" \
  -F file=@conversation.wav

Uses Deepgram diarization and returns speaker_id, confidence, num_speakers, and speakers with per-speaker durations. The IDs describe speakers within this recording; they are not persistent identities across recordings. The API does not return voice embeddings.

Diarize ​

bash
curl -X POST https://api.ph0ny.com/v1/audio/diarize \
  -H "Authorization: Bearer $PH0NY_API_KEY" \
  -F file=@conversation.wav

Returns utterances with speaker labels and timestamps. This endpoint uses Deepgram; language can be supplied as an additional form field. It is billed as an STT request by rounded-up audio minutes.

Enhance ​

bash
curl -X POST https://api.ph0ny.com/v1/audio/enhance \
  -H "Authorization: Bearer $PH0NY_API_KEY" \
  -F file=@noisy.wav \
  --output enhanced.wav

Returns WAV audio with denoise and normalization applied. Response headers include X-Duration-Ms and X-Operations.

Translate speech to English ​

bash
curl -X POST https://api.ph0ny.com/v1/audio/translate \
  -H "Authorization: Bearer $PH0NY_API_KEY" \
  -F file=@speech.wav \
  -F target_language=en

Returns JSON with text, source_language, target_language, and duration_seconds. This endpoint currently supports English as the target language only; any other target_language returns HTTP 400. It uses OpenAI Whisper's translation endpoint and is billed as an STT request by rounded-up audio minutes.

For current model rates and the credit rule, see Pricing.

Built by ph0ny.