Generate
POST /v1/images/generations takes the OpenAI fields model, prompt, n, quality, size, response_format (url or b64_json) and user, plus GEEKIDEA’s generation_config and metadata.
generation_config accepts resolution, aspect_ratio, seed and negative_prompt; which values a model supports is listed in its generation_config.
Response
urlis a signed link to the original image, valid for at least a day. Download what you need to keep. To get fresh links later, callGET /v1/generations/{id}with theid.previewsare WebP thumbnails in four sizes.b64_jsonreplacesurlwhen you setresponse_format: "b64_json".
Edit with reference images
POST /v1/images/edits generates from one or more reference images. The model must list image_to_image in capabilities, and you can send up to its max_reference_images.
- Multipart (OpenAI SDK)
- JSON
image for one file and image[] for several. Send generation_config and metadata as JSON strings.413 file_too_large). mask is not supported yet.
How images are priced
There are two pricing styles; each model’spricing shows which one it uses.
- Per image: a price per image, optionally by quality or resolution tier (
image_per_spec). The tier is matched ongeneration_config.resolutionfirst, thenquality; tiers not listed useimage. - Per token (GPT Image, FLUX.2, MAI Image): input tokens ×
input+ output image tokens ×output. Higher resolution and quality produce more output tokens. A low-quality 1K GPT Image uses about 200 output tokens.
Midjourney
Midjourney models return 4 images per request and charge once per request (generation_config.images_per_request = 4). Here n is the number of requests (default 1, at most 2), so n: 2 returns 8 images. Write Midjourney parameters in the prompt as usual. GEEKIDEA appends the aspect ratio and, for V8 at 2K, the HD flag from generation_config. The full prompt, including reference image links, must be at most 1024 characters.
Long-running requests
Image generation can take from seconds to a few minutes. To avoid holding a connection open, sendPrefer: respond-async to get 202 right away and fetch the result later. See Async requests.