DEV Community

hopbase
hopbase

Posted on Originally published at hop-base.com

Midjourney v8.2 API: Async Calls, 4-Image Jobs, --ar/--hd Sizes and Per-Image Cost

Midjourney v8.2 (model ID midjourney-v8-2) is now live on HopBase, submitted over the OpenAI-compatible POST /v1/images/generations endpoint and polled for results with GET /v1/video/tasks/{task_id}. The biggest difference from most image models is that every job returns a fixed set of 4 candidate images, and aspect ratio and quality are written into the prompt (--ar sets the ratio, --hd renders at native 2K) instead of being passed as request fields. Billing follows the number of images actually returned: $0.0067 per image at 1K and $0.0108 per image at 2K. Check that your key can see it with GET /v1/models.

How to call it

  • Two-step async: POST /v1/images/generations returns 202 with a task ID, then you poll GET /v1/video/tasks/{task_id}. Status moves through queued → processing → completed, and only completed and failed are terminal.
  • Use the full model ID: midjourney-v8-2. The authoritative ID is whatever GET /v1/models returns.
  • Key access: Midjourney is enabled per API key; if midjourney-v8-2 is not in your key's GET /v1/models list, enable it in the console first.
  • A prompt is required: sending a reference image with no text description is rejected. At most 1 reference image, passed in the images field.
  • Output lifetime: on completion outputs carries 4 signed links, valid for 24 hours from the moment the task completes. Polling again returns the same links without extending them, and expired links return 410, so download inside that window.
  • Timeouts are free: a task still unfinished 2 hours after creation is marked failed and not billed.
  • Actual charge per task: once the task is terminal, the task query carries usage.cost_usd, the amount actually deducted, so you can reconcile cost per job in code.

Pricing: the official rate converted to a per-image price

Tier How to trigger Per image Per job (4 images)
Standard Default $0.0067 $0.0267
2K Add --hd to the prompt $0.0108 $0.0433

Midjourney prices officially by GPU time (0.8 GPU minutes for a standard job, 1.3 minutes with --hd), and we convert that official rate into a per-image price. Billing follows the number of images actually returned, so a single call costs four images' worth — put that in your budget model rather than estimating from a one-image price. To compare against single-image models, multiply their per-image price by the number of candidates you would otherwise generate — see live pricing at https://hop-base.com/pricing. The console itemises the actual cost of every request.

Aspect ratio and size

Size is not a request field; it comes from --ar in the prompt, and adding --hd renders at native 2K. Measured values:

--ar Standard With --hd
1:1 (default) 1024 × 1024 2048 × 2048
16:9 1456 × 816 2944 × 1648
9:16 816 × 1456 1648 × 2944
4:3 1232 × 928 2544 × 1904
21:9 1680 × 720 3376 × 1440

--ar only accepts integer ratios, so --ar 1.5:1 is rejected. The ceiling is 14:1, tightened to 4:1 once --hd is on.

Parameter support

  • Supported: --ar, --hd, --s (0-1000), --c (0-100), --weird (0-3000), --iw (0-3), --sref with --sw, --no, --seed, --tile, --exp.
  • Not supported on v8.2, rejected with 400 at submit: --q/--quality, --niji, --repeat, --oref, --cref, --stealth, --stop, --draft, and :: multi-prompt weighting.

We reject this set at submit time rather than forwarding it: some of these the model silently ignores (you pay and get nothing for it), and the rest only fail after the job has run for tens of seconds. The error message names the parameter and why it is not supported.

Three-minute integration

# 1. Submit; returns 202 plus a task ID
curl https://api.hop-base.com/v1/images/generations \
  -H "Authorization: Bearer sk-your-key" \
  -H "Content-Type: application/json" \
  -d '{"model":"midjourney-v8-2","prompt":"a red apple on a wooden table, studio light --ar 16:9"}'

# 2. Poll with the id from the previous step; once completed, take the 4 links from outputs (valid 24 hours)
curl https://api.hop-base.com/v1/video/tasks/YOUR_TASK_ID \
  -H "Authorization: Bearer sk-your-key"
Enter fullscreen mode Exit fullscreen mode

FAQ

Can I generate just one image?

No. Every Midjourney generation mode returns a fixed 2×2 grid of four candidate images. That is how the model itself works, not a restriction added on our side. Neither the image-count field in the request nor --repeat changes the result, which is why we do not accept any value of n other than 4 — better to say so at submit time than to silently charge you for four.

How do I control the size?

In the prompt: --ar sets the ratio and --hd renders at native 2K. The quality field in the request body has no effect on this model and is rejected if you send it. The full size table is above.

Does it support reference images?

Yes — at most 1, passed in the images field, with --iw (0-3) to tune how strongly it is followed; for style references, use --sref together with --sw. Note that v8.2 does not support --oref or --cref; Midjourney has replaced them with its new editing models.

Are failed jobs billed?

No. Only jobs that actually produce images are billed; failed jobs cost nothing. If a prompt is stopped by content moderation the response gives an explicit failure reason, so you can rewrite it and retry.

Cost in code: budgeting a batch

PER_IMAGE = {"1k": 0.0067, "2k": 0.0108}   # official list price, USD per returned image
def batch_cost(jobs: int, tier: str = "1k") -> float:
    return jobs * 4 * PER_IMAGE[tier]        # every job returns 4 images

print(batch_cost(500))        # 500 standard jobs -> ~$13.40
print(batch_cost(500, "2k"))  # 500 --hd jobs     -> ~$21.60
Enter fullscreen mode Exit fullscreen mode

Full parameter reference and error codes: Midjourney v8.2 docs. Live list prices for every model: hop-base.com/pricing. Originally published on the HopBase blog.

Top comments (0)