LogoLogoAPI Docs
LogoLogoAPI Docs
Homepage
OverviewAuthentication and idempotencyImage generationsImage editsImage conversionsChart generationsJobs and bounded waitingCreditsErrorsRate limits and concurrencyAPI changelog
API Docs

Image generations

Create prompt-to-image jobs

POST /api/v1/images/generations creates one to four images from a text description. Required scope: images:generate.

JSON body

FieldTypeRequiredDefaultRules
promptstringyes—Trimmed, 5–2,000 characters
aspect_ratiostringno1:11:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 5:4, 4:5, or 21:9
resolutionstringno2K2K or 4K
countintegerno11–4

Unknown fields are rejected. The public request has no capability-routing options.

Credits

ResolutionCredits per image
2K5
4K20

The total reservation is the per-image cost multiplied by count. Credits are reserved atomically when the job is accepted, settled on success, and released on terminal failure.

Authentication and idempotency

API keys, scopes, request IDs, and safe retries

Image edits

Edit an uploaded image with natural-language instructions

Table of Contents

JSON body
Credits
cURL
JavaScript
Python
Output dimensions
cURL
curl https://sci-draw.com/api/v1/images/generations \
  -H 'Authorization: Bearer sd_YOUR_KEY' \
  -H 'Idempotency-Key: manuscript-42-panel-a' \
  -H 'Prefer: wait=10' \
  -H 'Content-Type: application/json' \
  -d '{"prompt":"A labeled plant cell diagram","aspect_ratio":"4:3","resolution":"2K","count":1}'

JavaScript

const response = await fetch('https://sci-draw.com/api/v1/images/generations', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.SCIDRAW_API_KEY}`,
    'Idempotency-Key': crypto.randomUUID(),
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ prompt: 'A labeled plant cell diagram' }),
});
const body = await response.json();

Python

import os, uuid, requests

response = requests.post(
    "https://sci-draw.com/api/v1/images/generations",
    headers={
        "Authorization": f"Bearer {os.environ['SCIDRAW_API_KEY']}",
        "Idempotency-Key": str(uuid.uuid4()),
    },
    json={"prompt": "A labeled plant cell diagram", "resolution": "2K"},
)
job = response.json()["data"]

Returns 202 while queued or processing, or 200 when bounded waiting reaches a terminal state. See Jobs for the response schema and polling flow.

Output dimensions

2K and 4K are size tiers, not fixed edge lengths. The table shows the actual output pixels. Unsupported ratios return HTTP 400 (INVALID_REQUEST) before a job or credit reservation is created.

aspect_ratio2K4K
1:12048×20482880×2880
16:92560×14403840×2160
9:161440×25602160×3840
4:32304×17283264×2448
3:41728×23042448×3264
3:22496×16643504×2336
2:31664×24962336×3504
5:42240×17923200×2560
4:51792×22402560×3200
21:93136×13443808×1632