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
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 stablereason, 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
- OpenAPI 3.1 specification, plus generated endpoint pages in the navigation
- Runnable Python and JavaScript clients with saved requests, SSE recovery and downloads
- Multiple-image queue with bounded concurrency and partial-failure handling
- Event payloads, errors, and idempotency
- MCP setup and CLI guide