Skip to main content
DreamLayer generates and edits images through a hosted REST API. Use https://api.dreamlayer.io, authenticate with Authorization: Bearer YOUR_API_KEY, and send DreamLayer-Version: 1 on managed execution and conversation requests. Keep keys on the server; create and revoke them in the developer console.

Operations

Read GET /v1/capabilities for account operation availability and current sprite pricing. Sprite sheets are beta. Image operations cost one credit on successful delivery. Sprites reserve their approved quote and settle on complete delivery; failure or timeout restores the hold. Read GET /v1/balance for available credits before paid work.

Start and follow an execution

JSON requests receive 202 with an execution ID. Persist it, then read GET /v1/executions/{execution_id} or follow GET /v1/executions/{execution_id}/events. Request Accept: text/event-stream on submission if you prefer an initial SSE stream. The event set is started, thinking, progress, job, question, asset, and done. Resume with Last-Event-ID. A closed connection does not end a job. Canonical execution states are queued, running, needs_input, completed, failed, and cancelled. A completed output is downloaded through GET /v1/image-jobs/{job_id}/asset, using the owned download_url from the execution. It redirects to a signed URL valid for 15 minutes, with credentials restricted to the API origin.

Limits and safe retries

POST requests share a 10-request window per 60 seconds; most GET requests share 120 per 60 seconds; asset downloads allow 20 per 60 seconds. Each bucket applies both per key and per account. The beta allows two active jobs per account and four open execution streams per key. See exact scopes and handling. Errors include a stable reason, retryable, and request_id, with X-Request-ID on the response. Retry-After and remaining/reset headers are not guaranteed. Back off with jitter on 429. A missing Authorization header returns 422; an invalid or revoked bearer key returns 401. A conflicting idempotency request returns 409. Acceptance is not admission: credit, quota, and active-job checks run after /v1/execute accepts the request. Non-retryable admission failures appear as status: failed with an error object on the execution and its done event, not as a submit-time 402. Retryable admission failures remain queued and are retried by the service. Keep following the existing execution. Give every logical submission its own stable idempotency key. Replay identical request bytes with that original key after uncertainty; do not re-upload a reference or create a replacement key automatically. Read known execution state first.

Build your integration

This API uses asynchronous executions, SSE and status reads. A native batch endpoint and webhook delivery contract are not part of this documented interface. Use the client queue and event stream for those integration needs.