Open in the interactive docs · markdown for agents: https://neuraldeep.tech/docs/images.md
Images · Image API
Image generation and processing with the same key, endpoints under /v1/images/*. Generation and editing run on Qwen-Image on our GPUs in Russia; it understands Russian prompts without translation. Upscale, background removal, enhancement and avatar are separate operations.
Each group has its own quota: generation and editing count separately from processing existing images. The remainder is in GET /v1/images/quota. Quota is charged only when the image is ready. A failed task returns it.
How it works. Everything is asynchronous, with our own format, not OpenAI's. POST creates a task and answers right away with {"task_uid": "...", "queue_position": N, "eta_sec": N}. Then poll GET /v1/images/tasks/{uid} until status becomes finished (other values: queued, processing, failed). Fetch the image as a file from GET /v1/images/tasks/{uid}/result; until it is ready, this endpoint answers 202 with an empty body. We do not expose storage links.
| endpoint | input | quota |
|---|---|---|
POST /v1/images/generate |
JSON {prompt, options} |
generation |
POST /v1/images/edit |
multipart images[], prompt |
generation |
POST /v1/images/upscale |
multipart image |
processing |
POST /v1/images/background/remove |
multipart image |
processing |
POST /v1/images/enhance |
multipart image |
processing |
POST /v1/images/avatar |
multipart photo, gender, style |
processing |
GET /v1/images/queue |
current queue |
Generation parameters, the options field: width and height (both together), or aspect_ratio (1:1, 4:3, 3:4, 16:9, 9:16, square), negative_prompt, steps, true_cfg_scale, seed, num_images, transparent (transparent background). Without a size you get a 1312×1312 square. Editing takes the same fields except size: proportions come from the first image.
Input limits.
- Output size: at most 1.5 MP. A larger request is not rejected but scaled down keeping proportions, sides rounded down to multiples of 32. Each side up to 2752 px, otherwise
422. num_images1 to 4,steps1 to 50,true_cfg_scale1 to 10,promptup to 4000 characters,negative_promptup to 2000.- Editing: up to 10 images per request and up to 25 MB for all files together.
- Processing: one file up to 25 MB and up to 4 MP. PNG, JPEG, WebP.
- Queue: one account can have a limited number of tasks waiting or rendering at once. Beyond that you get
429; wait for your tasks to finish.
uid=$(curl -s https://api.neuraldeep.tech/v1/images/generate \
-H "Authorization: Bearer $YOUR_KEY" -H "Content-Type: application/json" \
-d '{"prompt":"astronaut cat, neon","options":{"width":1024,"height":1024}}' | jq -r .task_uid)
curl https://api.neuraldeep.tech/v1/images/tasks/$uid \
-H "Authorization: Bearer $YOUR_KEY"
curl https://api.neuraldeep.tech/v1/images/tasks/$uid/result \
-H "Authorization: Bearer $YOUR_KEY" -o out.png
# edit with words, up to 10 source images
curl https://api.neuraldeep.tech/v1/images/edit \
-H "Authorization: Bearer $YOUR_KEY" \
-F "images[][email protected]" -F "prompt=replace the background with a seashore"
# upscale an existing image
curl https://api.neuraldeep.tech/v1/images/upscale \
-H "Authorization: Bearer $YOUR_KEY" -F "[email protected]"
import time, httpx
H = {"Authorization": "Bearer $YOUR_KEY"}
job = httpx.post(
"https://api.neuraldeep.tech/v1/images/generate",
headers=H, json={"prompt": "a cosmic cat in neon", "options": {"aspect_ratio": "1:1"}},
).json()
uid = job["task_uid"]
# the queue may hold several tasks, keep a timeout on polling
for _ in range(300):
st = httpx.get(f"https://api.neuraldeep.tech/v1/images/tasks/{uid}", headers=H).json()
if st["status"] in ("finished", "failed"):
break
time.sleep(2)
img = httpx.get(f"https://api.neuraldeep.tech/v1/images/tasks/{uid}/result", headers=H).content
open("out.png", "wb").write(img)
Errors.
400: empty prompt.402: the wallet does not have enough money for the operation.404: the result has expired or there is no image with that index.413: the file exceeds the limit.422: a parameter out of range, unknownaspect_ratio, more than 10 images in an edit, the file is not an image.429: the quota is used up (quota_exceededbody, see getting started) or too many of your tasks are in the queue.503: generation or processing is temporarily unavailable, retry later.
Reference sections (markdown for agents)
- Start · key, errors, quotas
- Text · chat
- Vectorization
- Reranking
- Transcription
- Image recognition
- Structured output
- Clients · agents
- Remaining limits · Limits API
- Search · Search API
- OCR · documents
- Images · Image API
- Music · Music API
- PII anonymization · PII Guard
- SpeechCore · STT
- Speech synthesis · TTS API
- Who spoke when · diarization
- Text decisions · FRIDA-Decisions, clef-flash
- Drift · overview
- Files + sandbox preview
- Your own tools, skills, MCP
- Tasks · proactive
- Memory · memory
- Isolation and security
- Agent settings
- Limits · errors
- Book · search and MCP
- Streaming
- SDK · Python / JS
- Privacy