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" \ --max-time 900 \ -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", }, timeout=900, # generations can take several minutes)data = response.json()print(data["image_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.image_url);model is optional: without it, Depicta uses your default model or the recommended model for the operation. See Models.
Response
Section titled “Response”{ "id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "model": "microsoft/mai-image-2.6-flash", "ai_generated": true, "image_url": "https://media.depicta.ai/...", "formats": { "png": { "url": "https://media.depicta.ai/...", "format": "png", "size_bytes": 307200, "hash": "e3b0c442...", "expires_at": "2026-04-06T16:00:00Z" }, "jpeg": { "url": "https://media.depicta.ai/...", "format": "jpeg" }, "webp": { "url": "https://media.depicta.ai/...", "format": "webp" } }, "cost_eur": "0.036000", "balance_eur": "9.964000", "image_hash": "e3b0c44298fc1c149afbf4c8996fb924..."}Key fields:
model— the model used (useful when you omitmodeland Depicta picks one).image_url— signed URL of the generated image. It expires in 1 hour.formats— signed URLs for PNG, JPEG, and WebP, when available. Each expires in 1 hour.cost_eur— what this request cost, in credits (EUR, excluding VAT; VAT is added when you buy credits).balance_eur— the credits you have left.image_hash— SHA-256 of the generated image for provenance verification.
Authentication
Section titled “Authentication”Every request needs an Authorization: Bearer dpct_... header, except GET /health, GET /v1/pricing and the OpenAPI files. Without it, you get HTTP 401.
An API key can create, edit, combine and process images, run stories, upload input images, list your jobs and the models, search guidelines, and read your profile and balance. Managing your account (API keys, buying credits, payments and withdrawals, settings, data export, closing the account) happens in the dashboard while you’re signed in. With an API key, those calls return 403 auth_session_required.
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