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
curl -X POST https://api.ph0ny.com/v1/audio/detect-language \
-H "Authorization: Bearer $PH0NY_API_KEY" \
-F file=@speech.wavReturns 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
curl -X POST https://api.ph0ny.com/v1/audio/identify \
-H "Authorization: Bearer $PH0NY_API_KEY" \
-F file=@conversation.wavUses 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
curl -X POST https://api.ph0ny.com/v1/audio/diarize \
-H "Authorization: Bearer $PH0NY_API_KEY" \
-F file=@conversation.wavReturns 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
curl -X POST https://api.ph0ny.com/v1/audio/enhance \
-H "Authorization: Bearer $PH0NY_API_KEY" \
-F file=@noisy.wav \
--output enhanced.wavReturns WAV audio with denoise and normalization applied. Response headers include X-Duration-Ms and X-Operations.
Translate speech to English
curl -X POST https://api.ph0ny.com/v1/audio/translate \
-H "Authorization: Bearer $PH0NY_API_KEY" \
-F file=@speech.wav \
-F target_language=enReturns 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.