Skip to main content
Use GPT Image, Google Nano Banana, or Grok to generate and edit images. Choose the model family, then follow its request format and image response handling.

Choose an image API

Generate GPT images

Generate GPT images and read the Base64 image data.

Edit GPT images

Upload source images and request a prompt-driven edit.

Generate Nano Banana images

Generate or edit images with Gemini generateContent.

Generate Grok images

Generate Grok images with URL or Base64 results.

Edit Grok images

Send source image URLs or data URIs in a JSON request.

Retrieve a GPT image task

Poll a GPT image request submitted with async enabled.

Generate an image

The examples below generate one GPT image with gpt-image-2. For Nano Banana or Grok, use the corresponding reference above.
Open Create an image to use the playground and endpoint schema.

Response example

GPT Image returns Base64 image data in data[].b64_json. Decode that value and save the image bytes. The response uses this shape:

Common errors

Choose an image-capable model from the Models page.
Use a size that the selected image endpoint accepts.
Download Grok URL results promptly after generation completes.
Reduce the source image file size before sending the request again.
Read b64_json for GPT Image, final inlineData for Nano Banana, or the requested URL or Base64 field for Grok.

Error codes and retry strategy

Do not retry until the prompt, size, or image input is fixed.
Do not retry until the API key is present and valid.
Check the base URL, path, and model ID before retrying.
Reduce upload size before retrying.
Retry with exponential backoff and reduce concurrency.
Retry with backoff for transient service errors.
For implementation patterns, see Error codes and retry strategy and Rate limits and concurrency.

Pricing and model directory

Models page

Read how RunBridge AI exposes model IDs in the docs.

Model directory

Browse model availability and capabilities.

Pricing

Check pricing before you call a model.
Last modified on October 9, 2026