Developer API
The developer API lets you access the platform programmatically using a scoped API token.
Base URL
Section titled “Base URL”https://api.prettycode.devEvery endpoint in this reference is versioned under /v1 — for example, GET /api/v1/me.
Authentication
Section titled “Authentication”Requests authenticate with a bearer token you generate from your dashboard. Send it on every request:
Authorization: Bearer YOUR_TOKENSee Authentication for how to create a token and what each scope grants.
Requirements
Section titled “Requirements”Your organization’s plan must include API access. If it doesn’t, the API responds with 403 Forbidden.
Rate limits
Section titled “Rate limits”The API accepts up to 120 requests per minute for each organization by default. Every token of an organization shares that budget, so creating another token doesn’t raise it. Tokens have no monthly cap.
A request over the limit gets 429 Too Many Requests with a Retry-After header — the number of seconds to wait before sending the next one. The JSON body carries the same number as retry_after:
{ "message": "Too many attempts. Please try again in 42 seconds.", "errors": [], "retry_after": 42 }Wait that long, then retry. If your integration keeps hitting the limit, spread its requests out or cache what it reads. Need a higher limit? Contact us.
Errors
Section titled “Errors”Errors return the matching HTTP status code and a JSON body:
{ "message": "A human-readable description of what went wrong." }| Status | Meaning |
|---|---|
401 Unauthorized | Missing or invalid token. |
403 Forbidden | Plan doesn’t qualify, or the token lacks the required scope. |
404 Not Found | The requested resource doesn’t exist. |
429 Too Many Requests | Too many requests this minute — wait the seconds in the Retry-After header. |
Endpoints
Section titled “Endpoints”Endpoints are grouped by the resource they act on.
GET /v1/me— the authenticated user.
Snippets
Section titled “Snippets”POST /v1/renders— turn code into an image, and optionally save it.GET /v1/presets— your workspace’s style presets.