API-Referenz
Precise gradients for modern web design
Integrate ChromaKit’s gradient engine directly into your applications. Our REST API delivers production-ready CSS, SVG, and PNG outputs with millisecond precision.
Access to the API requires a valid bearer token. Generate yours from the developer dashboard. Standard tier allows 1,000 requests per hour; Enterprise plans scale to 50,000 RPM with dedicated endpoints.
Generate API Key Rate Limit DetailsEndpoints
POST
/v1/gradients/generate
Creates a new gradient configuration. Accepts JSON payloads defining color stops, angle, type (linear/radial/conic), and output format. Returns a unique gradient_id and immediate CSS/SVG response.
GET
/v1/gradients/{id}
Retrieves stored gradient metadata and export assets. Supports ?format=png or ?format=css query parameters. Caches responses for 24 hours to optimize delivery.
DELETE
/v1/gradients/{id}
Permanently removes a gradient from your workspace. Requires write scope on your bearer token. Returns 204 No Content on success.
GET
/v1/palettes/trending
Fetches the top 20 community-voted color palettes updated daily. Useful for seeding AI-driven design tools or dynamic theme generators.
Examples
Authentication
Bearer Token Setup
Include your API key in the Authorization header for every request. Tokens are scoped to read or write and expire after 90 days. Rotate credentials via the dashboard to maintain compliance.
Authorization: Bearer ck_live_8f3a9c2e1d4b7f6a
Request Payload
JSON Gradient Body
Define stops using hex or HSL values. The stops array must contain at least two objects. Angle defaults to 135 degrees if omitted.
{ "type": "linear", "angle": 90, "stops": [{ "offset": 0, "color": "#0f172a" }, { "offset": 0.5, "color": "#3b82f6" }, { "offset": 1, "color": "#06b6d4" }], "output": "css" }
Response Handling
Rate Limits & Errors
ChromaKit enforces a sliding window rate limit. Exceeding your tier returns 429 Too Many Requests with a Retry-After header. Validate payloads against our OpenAPI schema to avoid 400 Bad Request errors before deployment.