Skip to content
xAI · Grok Imagine

grok-imagine-1.5-openrouterapi API

Generate images from text and edit reference images with xAI’s Grok Imagine model on Openrouter API.

Image generationImageAsync task
Model id
grok-imagine-1.5-openrouterapi

grok-imagine-1.5-openrouterapi API pricing

All prices in USD. Openrouter API rates compared with the official list price for the same unit.

OptionOpenrouter APIOfficialSave
DefaultDefault$0.0165$0.02−17%

Prices are per image.

What is grok-imagine-1.5-openrouterapi?

grok-imagine-1.5-openrouterapi is an xAI Grok Imagine model for text-to-image generation and reference-based image editing on Openrouter API. Submit a multilingual text prompt to create images, or include reference image URLs to guide edits such as background or style changes. The model accepts 1–5 reference images and generates 1–10 images per request, with five supported aspect ratios selected through the size parameter.

Requests use POST /v1/images/generations and run asynchronously: submission returns a task ID for subsequent status queries. Openrouter API provides one API key and an OpenAI-compatible base URL at https://openrouterapi.ru/v1. Default pricing is $0.0165 per image, about 17% below the developer's list price of $0.02 per image, with pay-as-you-go billing only for successful requests. Download completed images promptly because generated links expire after 24 hours.

grok-imagine-1.5-openrouterapi highlights

Generation and Editing

Generate images from text alone or supply reference image URLs for image editing. Prompts support multiple languages.

Multiple Reference Images

Use 1–5 reference images in an editing request. Inputs must be publicly accessible absolute HTTP or HTTPS URLs.

Shape and Count Controls

Choose square, widescreen, tall, landscape, or portrait output using the size parameter. Request 1–10 images with n.

Optional Moderation Check

Set nsfw_check to true to review prompts and input images with omni-moderation-latest before submitting the task. It defaults to false.

How to call the grok-imagine-1.5-openrouterapi API in 4 steps

  1. 01

    Get an API key

    Sign in to Openrouter API, top up from $50, and create an sk-ora key in the console.

  2. 02

    Set the base URL

    Use https://openrouterapi.ru/v1 as the base URL in your SDK or HTTP client.

  3. 03

    Send the request

    Call POST /v1/images/generations with "model": "grok-imagine-1.5-openrouterapi" and the parameters below.

  4. 04

    Handle the response

    The response contains a task_id. Poll GET /v1/tasks/{task_id} until the status is completed, then download the result URLs.

# model can be "grok-imagine-1.5-openrouterapi", or the compatible alias "grok-imagine-1.5-ext"
curl --request POST \
  --url https://openrouterapi.ru/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "grok-imagine-1.5-openrouterapi",
    "prompt": "An orange cat sitting on a sunny windowsill, oil painting style",
    "size": "1:1",
    "n": 1
  }'

Parameters

ParameterTypeRequiredDefaultDescription
modelstringRequiredgrok-imagine-1.5-openrouterapiImage generation model name
nsfw_checkbooleanOptionalfalseWhether to run content moderation before submitting the image task.
promptstringRequired—Text description for image generation or editing, supports multiple languages
image_urlsstring[]Optional—Reference image URL list. **Omit for text-to-image; include for image editing**.
sizestringOptional1:1Output image size
nintegerOptional1Number of images to generate

What you can build with grok-imagine-1.5-openrouterapi

Prompt-Based Image Tools

Build a text-to-image interface that lets users describe an image and select its output shape and image count.

Background Editing Workflows

Let users supply a reference image and describe a background change, then retrieve the edited output through the asynchronous task flow.

Style Exploration

Create a reference-based editing tool for trying prompt-described style changes on supplied images.

Content Format Variations

Generate square, landscape, and portrait images for different content placements using the documented size options.

Tips for better results

  • 01

    Choose the Input Mode

    Omit image_urls for text-to-image generation; include it for editing. Upload local files through POST /v1/uploads/images and use the returned URL.

  • 02

    Set Size Explicitly

    The size parameter defaults to 1:1. Supported values are 1:1, 16:9, 9:16, 3:2, and 2:3.

  • 03

    Control Image Count

    Use n to request 1–10 images; it defaults to 1. Send an unquoted integer, and choose the count with the $0.0165 per image default price in mind.

  • 04

    Poll and Save Outputs

    Store the task ID returned on submission and query task status rather than expecting images immediately. Save generated images before their links expire after 24 hours.

Limits and things to know

  • Processing is asynchronous; submission returns a task ID rather than completed images.

  • Generated image links remain valid for 24 hours.

  • Each request supports at most 5 reference images and 10 output images.

grok-imagine-1.5-openrouterapi API FAQ

How much does grok-imagine-1.5-openrouterapi cost on Openrouter API?

Openrouter API Default pricing is $0.0165 per image, about 17% below the developer's list price of $0.02 per image. Billing is pay-as-you-go and applies only to successful requests.

How do I call grok-imagine-1.5-openrouterapi?

Send a Bearer-authenticated POST request to https://openrouterapi.ru/v1/images/generations with model set to grok-imagine-1.5-openrouterapi and a required prompt. The response returns a task ID for subsequent status queries.

Is grok-imagine-1.5-ext the same model?

Yes. grok-imagine-1.5-ext is an accepted alias for grok-imagine-1.5-openrouterapi; the two are interchangeable and produce identical results.

Which parameters control image generation and editing?

Use prompt for the description, image_urls for editing references, size for the output aspect ratio, and n for image count. The optional nsfw_check parameter enables moderation before task submission.

What are the input and output limits?

Editing supports 1–5 reference images from publicly accessible absolute HTTP or HTTPS URLs, and n accepts 1–10 output images. Generated image links expire after 24 hours.

Can I use generated images commercially?

Commercial use is subject to the model developer’s terms. Review the applicable xAI terms before using generated images in a commercial product or campaign.

Related models

Depth: 250+ models · Minimum top-up $50

Start building with grok-imagine-1.5-openrouterapi

One key, pay as you go from $50, billed only for successful requests.