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.

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.

Reference sections (markdown for agents)