Crazyrouter GuidesMain Site
Image API Guide

Grok 4 Image API guide

Use the standard model name grok-4-image through Crazyrouter's OpenAI Images-compatible endpoint, with Grok-specific request parameters.

Use case

Developers comparing image APIs need to see Grok-specific parameter differences before copying a generic OpenAI Images request.

Standard model names and pricing

Source: GET https://cn.crazyrouter.com/api/pricing, snapshot 2026-06-06.

POST /v1/images/generations
grok-4-image
$0.044/image after 0.55x discount
Billing: per_image
Public endpoints: image-generation
Supported endpoints: image-generation, openai

Available model and pricing

The current Pricing API row for grok-4-image exposes image-generation to customers. Pricing display should follow the Pricing page and consumption logs, not upstream marketing copy.

  • grok-4-image: $0.044/image after 0.55x discount; public_endpoint_types = image-generation.

Grok-specific parameters

The docs warn not to pass size, quality, or style to Grok image models. Use aspect_ratio and resolution instead, and start with n=1 for stable cost control.

  • Recommended response_format: url.
  • Use aspect_ratio values such as 1:1, 16:9, 9:16, 3:2, or auto.
  • Use resolution values such as 1k or 2k.

Evaluation workflow

Compare Grok 4 Image against GPT Image 2 and Qwen Image on prompt adherence, accepted-output rate, temporary URL handling, and effective cost after rejected generations.

cn.crazyrouter.com test evidence

Only checks that returned 200 are shown here. API requests use https://cn.crazyrouter.com; account, billing, and console actions use https://crazyrouter.com.

CheckRequestStatusResult
Pricing API reachableGET https://cn.crazyrouter.com/api/pricing200Returned the public model pricing catalog used by these pages.
Target models visible to API keyGET https://cn.crazyrouter.com/v1/models200Authenticated check confirmed gpt-image-2, veo-3.1-fast, veo-3.1, nano-banana-2, nano-banana-pro, nano-banana, grok-4-image, qwen-image-plus, qwen-image-max, and qwen-image-2.0 are visible to the local Crazyrouter API key.

Implementation examples

cURL
curl -X POST https://cn.crazyrouter.com/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "grok-4-image",
    "prompt": "A tiny yellow cube on a plain white background, minimal product photo",
    "n": 1,
    "response_format": "url",
    "aspect_ratio": "1:1",
    "resolution": "1k"
  }'
Python
from openai import OpenAI

client = OpenAI(
    api_key="YOUR_API_KEY",
    base_url="https://cn.crazyrouter.com/v1",
)

response = client.images.generate(
    model="grok-4-image",
    prompt="A tiny yellow cube on a plain white background, minimal product photo",
    n=1,
    response_format="url",
    extra_body={
        "aspect_ratio": "1:1",
        "resolution": "1k",
    },
)

print(response.data[0].url)

FAQ

Where do these model prices come from?

Prices are based on GET https://cn.crazyrouter.com/api/pricing and the current Crazyrouter pricing catalog. For final billing, confirm usage in the Crazyrouter console and consumption logs.

Can I test this without an API key?

Start by checking the public pricing endpoint. To list models or make model calls, create an API key at https://crazyrouter.com and send it as Bearer authorization.

Can I use size=1024x1024 with grok-4-image?

No. The Grok image docs say size is not supported. Use aspect_ratio and resolution for Grok image requests.