realpng
Docs

Optimize audio

Re-record a voice clip or music track in a living room, then download its M4A with an optimization score.

Start an optimization

Optimize audio by URL
curl -X POST "https://realpng.com/api/v1/optimize" \
  -H "X-API-Key: $REALPNG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "audio_url": "https://audio.example.com/voice-note.mp3",
    "seconds": 18
  }'
202 Accepted
{
  "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "status": "queued",
  "media": "audio"
}

POST /optimize answers 202 with a job id. Send exactly one of audio_url or audio_upload_id. An audio file on disk goes through an upload.

The optimizer accepts MP3, WAV and M4A files. It treats music and voice clips the same way, and scores the encoded output with the voice detector.

Poll and download

Get the audio optimization
curl "https://realpng.com/api/v1/optimize/7c9e6679-7425-40de-944b-e07fc1f90ae7" \
  -H "X-API-Key: $REALPNG_API_KEY"
200 OK
{
  "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "status": "succeeded",
  "media": "audio",
  "file_url": "https://realpng.com/api/v1/optimize/7c9e6679-7425-40de-944b-e07fc1f90ae7/file",
  "expires_at": "2026-10-15T12:00:00+00:00",
  "optimization_score": {
    "score": 86,
    "zone": "good"
  }
}

Poll GET /optimize/{id} until the job succeeds or fails. A succeeded job has file_url, an M4A download link, and optimization_score. The link works until expires_at.

The output is AAC at 192 kb/s and 48 kHz. It keeps the input length and channel count. Its tags and encoder line are removed.

From an agent

The MCP tool optimize_audio takes the same fields and waits for the job. get_processing_result resumes a job that is still running. See MCP tools.