Generate an image
Changed onGenerate one image from a prompt. data[0].url is a TextCortex resource URI (textcortex://images/<image_id>), not a directly downloadable HTTP URL. Keep data[0].image_id to reuse the image in another generation. Check GET /capabilities for access. This is a separate image catalog: GET /models lists chat models, not the image models below.
Choose a model
Set model explicitly for predictable selection. Omit it to use gpt-image-2.5 on this deployment.
| Model ID | Size presets (pixels), or aspect ratios | image_size | Max reference images |
|---|---|---|---|
| gpt-image-2.5 | 1024x1024, 1024x1536, 1536x1024, 1920x1072, 1072x1920, 3840x2160, 2160x3840 | Omit | 5 |
| gpt-image-2 | 1024x1024, 1024x1536, 1536x1024, 1920x1072, 1072x1920, 3840x2160, 2160x3840 | Omit | 5 |
| grok-imagine-image-quality | 2048x2048, 2048x1152, 1152x2048, 2048x1536, 1536x2048, 1920x1280, 1280x1920, 1024x1024, 1024x576, 576x1024, 1024x768, 768x1024, 960x640, 640x960 | Omit | 3 |
| nano-banana | 1:1, 21:9, 16:9, 4:3, 3:2, 9:16, 3:4, 2:3, 5:4, 4:5 | Omit | 5 |
| nano-banana-2 | 1:1, 21:9, 16:9, 4:3, 3:2, 9:16, 3:4, 2:3, 5:4, 4:5 | 2K, 4K | 5 |
| gemini-3-pro-image | 1:1, 21:9, 16:9, 4:3, 3:2, 9:16, 3:4, 2:3, 5:4, 4:5 | 2K, 4K | 5 |
The table lists presets, not every custom dimension supported by a provider. Use one sizing control at a time: size for pixel dimensions or aspect_ratio for a ratio. Omit both for the model default. For models supporting image_size, combine it with aspect_ratio to select resolution. Unsupported values return 400.
Use a reference image
Add image_urls containing publicly reachable HTTP(S) image URLs, or reuse image_ids returned by a previous generation. File-upload IDs are not image IDs. The model's reference limit applies to both arrays combined. Images must be accessible to the caller; private-network URLs are rejected. Reference URLs must serve JPEG, PNG or WEBP bytes, with a maximum download size of 6 MiB per image. GIF and SVG are not supported.
Each request returns one image: n must be 1 and response_format must be url. Base64 output is not supported. The url response format names the response field; it does not promise a public download URL or a retention period.
Request
- Base URLhttps://api.textcortex.com/v1
- AuthHTTP bearer
Request body
Response
Successful response
Changes
- info
endpoint added
- info