Generate an image
POST
https://api.vidmoat.com/v1/ai/imagesGenerate a still with optional referenceUrls (up to 5 images: your uploads or public HTTPS images). provider accepts grok, openai, vertex or auto (default). quoteOnly:true returns the initial and maximum credits without spending. Retain provider:auto with the quoted maxCredits to allow safe quota fallback; explicit providers never switch. OpenAI GPT Image 2.5 Flare costs 128 at 1k or 256 at 2k plus 8 per reference; Vertex costs 128/192 plus 2 per reference. Only the successful asset is charged. Studio.
Body#
promptstringrequiredUp to 800 characters.providerenumdefaultautoWho generates it.One ofauto,grok,openai,vertexresolutionenumdefault2kAffects OpenAI and Vertex prices.One of1k,2kaspectRatiostringFor example16:9,9:16,1:1,4:5,21:9.referenceUrlsarray of stringsUp to 5 reference images: your upload URLs (png, jpg, webp, avif) or public HTTPS URLs.maxCreditsnumberNever spend more than this.quoteOnlybooleantruereturns the route and price without generating or charging.
Response#
Returns 200.
Response fields#
urlstringThe image. Use as a clipsrc.routeobjectThe provider route chosen:provider,model,credits,maxCredits,reasonandpolicy(andvoiceIdfor speech).creditsobject{ charged, remaining }: what this call cost and the balance after it.hintstringWhat to do with it.
Errors#
Besides the errors any request can get (authentication, rate limits):
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | No prompt, a refused reference, or no provider matches the options and maxCredits. |
| 402 | plan_required | The plan has no image generation. |
| 402 | insufficient_credits | The balance cannot cover the call. Nothing ran. remaining is the balance. |
| 422 | prompt_rejected | The prompt failed the safety check. Nothing was charged. field names the field. |
| 502 | provider_error | The generation provider failed. The charge is refunded. |