Skip to main content
POST
/
api
/
v2
/
generate
Image Generation
curl --request POST \
  --url https://api.example.com/api/v2/generate \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "<string>",
  "prompt": "<string>",
  "negative_prompt": "<string>",
  "size": "<string>",
  "format": "<string>",
  "quality": "<string>",
  "style": "<string>",
  "seed": 123,
  "image_url": "<string>"
}
'
{
  "id": 123,
  "status": "<string>",
  "result_url": "<string>",
  "tokens_spent": 123,
  "seed": 123
}

Request

Authorization
string
required
Authorization: Bearer nb_YOUR_API_KEY
model
string
required
Image model slug. See Image Models.Popular options: dall-e-3, flux-1.1-pro, midjourney-v6, midjourney-turbo, sd-3.5-large
prompt
string
required
Text description of the image to generate.
negative_prompt
string
What to exclude from the image. Supported by Flux, SD, Midjourney models.
size
string
default:"1024x1024"
Image dimensions. Available options depend on the model:
ModelAvailable sizes
DALL-E 31024x1024, 1024x1792, 1792x1024
Flux 1.1 Pro1024x1024, 768x1344, 1344x768, 1024x1536, 1536x1024
Midjourney V6 / Turbo1:1, 2:3, 3:2, 9:16, 16:9 (aspect ratios)
SD 3.5 Large1024x1024, 768x1344, 1344x768
format
string
default:"webp"
Output format: webp, png, jpeg
quality
string
default:"standard"
Quality preset: standard or hd. Affects cost on DALL-E 3 and GPT Image.
style
string
Style hint for compatible models (vivid or natural for DALL-E 3).
seed
integer
Random seed for reproducible results. Pass the same seed with the same prompt to get similar outputs.
image_url
string
Input image URL for image-to-image generation (supported by Flux Kontext, SD Inpaint).

Request Example

curl -X POST https://neuralbox.top/api/v2/generate \
  -H "Authorization: Bearer nb_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "dall-e-3",
    "prompt": "A cozy coffee shop on a rainy evening, warm lighting, impressionist style",
    "size": "1024x1024",
    "format": "webp"
  }'

Response

id
integer
Unique generation ID.
status
string
completed | pending | failed
result_url
string
Direct URL to the generated image. Files are stored for the duration matching your plan (Free: 7 days, Basic: 30 days, Pro/VIP: 90 days, Elite: unlimited).
tokens_spent
integer
NeuralBox tokens consumed.
seed
integer
The seed used (useful if you didn’t specify one and want to reproduce the result).

Response Example

{
  "id": 18491,
  "status": "completed",
  "model_slug": "flux-1.1-pro",
  "result_url": "https://storage.neuralbox.top/generations/18491.webp",
  "tokens_spent": 4,
  "result_metadata": { "width": 768, "height": 1344 },
  "created_at": "2026-03-08T12:02:30Z"
}

Async Generation (MidJourney)

MidJourney returns status: "pending" initially. Poll until complete:
{
  "id": 18495,
  "status": "pending",
  "model_slug": "midjourney",
  "eta_seconds": 45
}
Then poll: GET /api/v2/generate/{id} See Generation Status for details.

Non-square Pricing Note

DALL-E 3 and GPT Image 1.5 charge more for non-square aspect ratios (e.g. 1024×1792 costs up to 2× more). Use the Calculate Price endpoint to check exact token cost before generating.