Images

Generate an image

Changed on

Generate 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 IDSize presets (pixels), or aspect ratiosimage_sizeMax reference images
gpt-image-2.51024x1024, 1024x1536, 1536x1024, 1920x1072, 1072x1920, 3840x2160, 2160x3840Omit5
gpt-image-21024x1024, 1024x1536, 1536x1024, 1920x1072, 1072x1920, 3840x2160, 2160x3840Omit5
grok-imagine-image-quality2048x2048, 2048x1152, 1152x2048, 2048x1536, 1536x2048, 1920x1280, 1280x1920, 1024x1024, 1024x576, 576x1024, 1024x768, 768x1024, 960x640, 640x960Omit3
nano-banana1:1, 21:9, 16:9, 4:3, 3:2, 9:16, 3:4, 2:3, 5:4, 4:5Omit5
nano-banana-21:1, 21:9, 16:9, 4:3, 3:2, 9:16, 3:4, 2:3, 5:4, 4:52K, 4K5
gemini-3-pro-image1:1, 21:9, 16:9, 4:3, 3:2, 9:16, 3:4, 2:3, 5:4, 4:52K, 4K5

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.

post/images/generations

Request

  • Base URL
    https://api.textcortex.com/v1
  • Auth
    HTTP bearer

Request body

ninteger
promptstring required
response_format'url'

Response

Successful response

createdinteger required

Unix timestamp in seconds.

Changes