Skip to content

Audio API

Endpoints for audio hosting on Picora (v0.12.0+). Audio files share the storage quota with videos and require a paid plan (Pro or Pro+).

Upload Audio

Upload an audio file directly to your library. Unlike videos, audio uploads are synchronous — once the request returns 201, the file is immediately playable.

Endpoint

POST https://api.picora.me/v1/audio

Authentication

Requires Bearer token (API key or JWT access token).

Request

Content-Type: multipart/form-data with fields:

FieldTypeRequiredDescription
filefileYesAudio file. See accepted MIME types below.
titlestringNoDisplay title. Defaults to the filename. Max 255 characters.

Accepted MIME types & limits

MIMEExtensionMagic check
audio/mpeg, audio/mp3.mp3ID3 header or 0xff 0xfb frame sync
audio/x-m4a, audio/mp4.m4a(container, validated downstream)
audio/wav, audio/x-wav.wavRIFF
audio/flac.flacfLaC
audio/ogg.oggOggS

Per-plan limits (also enforced server-side):

PlanMax file sizeMax duration
trial50 MB10 min
pro100 MB1 hour
pro+500 MB4 hours

Cover artwork extraction

For MP3 (ID3v2) and FLAC files, Picora parses embedded cover artwork (APIC / PICTURE block) at upload time and stores it as the audio thumbnail. M4A / OGG / WAV files use a default per-format SVG.

bitrate and duration_seconds are populated from the file when parseable; otherwise they remain null.

Example Request

Terminal window
curl -X POST "https://api.picora.me/v1/audio" \
-H "Authorization: Bearer sk_live_YOUR_KEY" \
-F "file=@track.mp3" \
-F "title=Episode 12 — Intro"

Response

Status: 201 Created

{
"success": true,
"data": {
"id": "KkVO6hcQTwBXgPTvb-_uE",
"type": "audio",
"url": "https://media.picora.me/audio/KkVO6hcQTwBXgPTvb-_uE.mp3",
"filename": "track.mp3",
"sizeBytes": 5242880,
"mimeType": "audio/mpeg",
"title": "Episode 12 — Intro",
"thumbnailUrl": "https://media.picora.me/audio-cover/KkVO6hcQTwBXgPTvb-_uE.jpg",
"durationSeconds": 218,
"bitrate": 192,
"status": "ready",
"isPublic": true,
"createdAt": "2026-04-27T08:00:00.000Z"
}
}

Get Audio

Retrieve metadata for a single audio file.

Endpoint

GET https://api.picora.me/v1/audio/:id

Response Fields

FieldTypeDescription
idstring21-char nanoid.
urlstringPublic CDN URL. Stable; safe to embed.
thumbnailUrlstringCover image URL — extracted ID3 cover or default SVG.
durationSecondsnumber | nullTrack duration (only present for parseable formats).
bitratenumber | nullkbps.
statusstringAlways ready for audio (no transcoding).

Update Audio

Patch the title or visibility flag.

Endpoint

PATCH https://api.picora.me/v1/audio/:id

Body

{ "title": "New title", "is_public": false }

Both fields are optional; sending an empty object is a no-op.


Delete Audio

Permanently delete an audio file. R2 object, embedded cover (if any), database row, and KV cache entry are all removed.

Endpoint

DELETE https://api.picora.me/v1/audio/:id

Response

Status: 204 No Content


Error Responses

StatusCodeDescription
401UNAUTHORIZEDMissing or invalid API key.
403FORBIDDENPlan does not allow audio (Free), or audio belongs to a different user.
403QUOTA_EXCEEDEDStorage quota exhausted.
404NOT_FOUNDNo audio with this ID exists in your library.
422VALIDATION_ERRORBad MIME / signature mismatch / oversize.
429RATE_LIMITTiered rate limit hit. See RateLimit-* headers and Retry-After.

Listing audio

Audio files are returned by the unified media list endpoint with type=audio:

GET https://api.picora.me/v1/media?type=audio

See Media API for full pagination semantics.