API
Depicta’s REST API lets you generate, edit, and process images programmatically. All endpoints are at https://api.depicta.ai.
The API is designed to be consumed primarily by LLMs and AI agents — through skill files, the Depicta CLI, or direct HTTP calls from your code. The endpoints, response formats, and error messages are optimized for programmatic use by AI assistants.
Get an API key
Section titled “Get an API key”- Sign up at depicta.ai/dashboard.
- Go to API Keys in the dashboard sidebar.
- Click Create key, give it a name, and copy the key. It starts with
dpct_.
Make your first request
Section titled “Make your first request”curl -X POST https://api.depicta.ai/v1/generate/image \ -H "Authorization: Bearer dpct_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A cozy coffee shop interior, warm lighting, watercolor style", "aspect_ratio": "16:9" }'import httpx
response = httpx.post( "https://api.depicta.ai/v1/generate/image", headers={"Authorization": "Bearer dpct_YOUR_API_KEY"}, json={ "prompt": "A cozy coffee shop interior, warm lighting, watercolor style", "aspect_ratio": "16:9", },)data = response.json()print(data["formats"]["png"]["url"])const response = await fetch("https://api.depicta.ai/v1/generate/image", { method: "POST", headers: { "Authorization": "Bearer dpct_YOUR_API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ prompt: "A cozy coffee shop interior, warm lighting, watercolor style", aspect_ratio: "16:9", }),});const data = await response.json();console.log(data.formats.png.url);Response
Section titled “Response”{ "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "ai_generated": true, "formats": { "png": { "url": "https://images.depicta.ai/...", "format": "png", "size_bytes": 307200, "hash": "e3b0c442...", "expires_at": "2026-04-06T16:00:00Z" }, "jpeg": { "url": "https://images.depicta.ai/...", "format": "jpeg" }, "webp": { "url": "https://images.depicta.ai/...", "format": "webp" } }, "cost_eur": "0.045000", "balance_eur": "9.955000", "image_hash": "e3b0c44298fc1c149afbf4c8996fb924..."}Key fields:
formats— signed URLs for PNG, JPEG, and WebP. Each expires in 1 hour.cost_eur— actual cost charged.balance_eur— remaining balance after this generation.image_hash— SHA-256 of the generated image for provenance verification.
Authentication
Section titled “Authentication”Every request needs an Authorization: Bearer dpct_... header. Without it, you get HTTP 401.
Next steps
Section titled “Next steps”- Generate — content types, models, reference images
- API Reference — full endpoint documentation
- Error codes — HTTP status codes and error handling