LogoLogoAPI Docs
LogoLogoAPI Docs
Homepage
OverviewAuthentication and idempotencyImage generationsImage editsImage conversionsJobs 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.

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'



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']}"




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

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
,
},
body: JSON.stringify({ prompt: 'A labeled plant cell diagram' }),
});
const body = await response.json();
,
"Idempotency-Key": str(uuid.uuid4()),
},
json={"prompt": "A labeled plant cell diagram", "resolution": "2K"},
)
job = response.json()["data"]