Skip to main content

System

Health checks, error codes, rate limits, and deprecation notices.

Health Check

GET /health

Check the overall health status of the Peako API. No authentication required.

Response (Healthy):

{
"status": "ok",
"qsv": true,
"redis": true,
"workers": 4,
"queued": 2,
"uptime": 3600
}

Response (Degraded):

{
"status": "degraded",
"qsv": false,
"redis": true,
"workers": 0,
"queued": 5,
"uptime": 3600,
"error": "QSV hardware encoder unavailable"
}

Fields:

FieldTypeDescription
statusstring"ok" or "degraded"
qsvbooleanIntel Quick Sync Video hardware encoder available
redisbooleanRedis (job queue) connection healthy
workersnumberCurrently active render workers
queuednumberJobs waiting or actively processing
uptimenumberServer uptime in seconds
errorstring(degraded only) Reason for degraded status

Status Codes:

  • 200 — All systems operational
  • 503 — One or more systems degraded

Example:

curl https://peako.shin0x.space/health

Error Codes

All API errors return a consistent JSON body:

{
"statusCode": 400,
"code": "INVALID_REQUEST",
"message": "Field 'blockId' is required"
}

HTTP Status Codes:

CodeMeaning
200Success
201Created
202Accepted (async job queued)
400Bad request — validation error, invalid params
401Unauthorized — missing or invalid API key / session
403Forbidden — not the owner of this resource
404Not found — resource doesn't exist
409Conflict — queue full, can't cancel active job, etc.
413Payload too large — file exceeds size limit
429Too many requests — rate limited
500Internal server error
503Service unavailable — Redis or render workers down

Common Error Codes:

CodeHTTPDescription
UNAUTHORIZED401Missing or invalid credentials
INVALID_REQUEST400Malformed request body or invalid field values
NOT_FOUND404Template, job, or asset not found
BLOCK_NOT_FOUND400blockId in render request doesn't exist in template
REQUIRED_BLOCK_MISSING400A required block was not filled
BLOCK_TYPE_MISMATCH400Fill type doesn't match block type
CDN_URL_NOT_ALLOWED400src_url is not from the Peako CDN
TRANSCRIBE_SOURCE_MISSING400transcribe_from block is not filled
QUEUE_DEPTH_EXCEEDED409User has 20+ active jobs
FILE_TOO_LARGE413File exceeds 2 GB limit
RENDER_FAILED500Video render error
INTERNAL_ERROR500Unexpected server error

Rate Limits

Per-user limits:

LimitValue
Concurrent render jobs20 max per user
File upload size2 GB per file
Subtitle file size1 MB
Job result retention7 days after completion

No per-second rate limit — quota is enforced at the job queue level.

If you hit the concurrent job limit (409), wait for pending jobs to complete before submitting new ones.


Deprecated Routes

Old /api/v1/ routes are still functional but deprecated. They will be removed on 2026-07-01.

DeprecatedCurrent
POST /api/v1/trimPOST /api/trim
POST /api/v1/mergePOST /api/merge
POST /api/v1/mutePOST /api/mute
POST /api/v1/add-audioPOST /api/add-audio
POST /api/v1/subtitlePOST /api/subtitle
POST /api/v1/blurPOST /api/blur
POST /api/v1/speed-rampPOST /api/speed-ramp
GET /api/v1/templatesGET /api/templates
POST /api/v1/templatesPOST /api/templates

Deprecated routes respond with a warning header:

Deprecation: true
Sunset: Sat, 01 Jul 2026 00:00:00 GMT

Migrate to the current routes before the sunset date.


Best Practices

  1. Always check /health before running batch jobs — verify workers are available
  2. Use delivery: "async" for anything longer than a few seconds
  3. Upload once, reference many times — upload assets once, reuse the CDN URL across multiple renders
  4. Pre-transcribe when you can — if you'll reuse captions, transcribe separately and cache the result
  5. Implement exponential backoff when polling — start at 2s, back off to 30s for longer jobs
  6. Handle 409 gracefully — check job count before submitting, or implement a queue with retry logic
  7. Store output URLs — download rendered videos before the 7-day expiry