Register
`POST /v1/auth/register` creates a user, creates a Stripe customer, and returns an API key once.
{
"email": "dev@example.com"
}
Reference
These docs mirror the current FastAPI routes, the `X-API-Key` header, the async job flow, and the usage tiers already defined in the project.
Quickstart
curl -X POST https://api.beatlyze.dev/v1/analyze/upload \
-H "X-API-Key: bz_your_api_key" \
-F "file=@track.mp3"
# response
{
"job_id": "8b7a5c17-b1a1-42fd-aab8-51d0c4ff3d2a",
"status": "processing"
}
curl https://api.beatlyze.dev/v1/analysis/8b7a5c17-b1a1-42fd-aab8-51d0c4ff3d2a \
-H "X-API-Key: bz_your_api_key"
Authentication
`POST /v1/auth/register` creates a user, creates a Stripe customer, and returns an API key once.
{
"email": "dev@example.com"
}
Every protected endpoint expects the raw key in the request header below.
X-API-Key: bz_your_api_key
Lifecycle
Use the upload endpoint for local files or the URL endpoint for remotely hosted audio.
The API returns an accepted response with `status: "processing"` while workers perform analysis.
Poll `GET /v1/analysis/{job_id}` or supply `webhook_url` when you submit the job.
Endpoints
/v1/auth/registerCreate a user, Stripe customer, and default API key. Returns the raw key once.
/v1/analyze/uploadUpload an audio file up to 50 MB and receive an async analysis job ID.
/v1/analyze/urlSubmit a publicly accessible audio URL for download + analysis in the background.
/v1/analysis/{job_id}Retrieve the summary result. The compact response omits section-level detail.
/v1/analysis/{job_id}/fullRetrieve the full result including the `sections` array.
/v1/batchQueue multiple URL analyses. The current implementation expects URL items, not uploaded files.
/v1/usageReturn current billing-month usage, tier limit, and meter usage for paid plans.
/webhooks/stripeHandle subscription lifecycle and payment-failure events from Stripe.
Schema
{
"job_id": "8b7a5c17-b1a1-42fd-aab8-51d0c4ff3d2a",
"status": "completed",
"result": {
"bpm": 127.8,
"bpm_confidence": 0.94,
"key": "A",
"scale": "minor",
"key_notation": "Am",
"key_confidence": 0.88,
"energy": 0.86,
"danceability": 0.91,
"valence": 0.44,
"loudness_lufs": -8.1,
"mood_tags": ["energetic", "dark"],
"genre_suggestions": ["techno", "house"],
"duration_seconds": 247.3,
"time_signature": 4
}
}
The full endpoint adds a `sections` array with structural segment detail.
"sections": [
{
"start_time": 0.0,
"duration": 31.4,
"key": "Am",
"loudness": -9.2,
"energy": 0.71
}
]
Usage + billing
The API stores monthly usage locally and can also fetch Stripe meter summaries for paid users. Free-tier enforcement is hard-capped in the request flow.
Migration
Agent-ready docs
# See the machine-readable guide
curl https://beatlyze.dev/llms.txt
# And the contract source
curl https://beatlyze.dev/openapi.yaml