LLM API
xAIImage generation

Grok Imagine Image

Grok Imagine Image costs $0.02 per image on LLM API. It generates images from text.

Pricing

Served by xAI, the only provider.

Grok Imagine Image prices on LLM API
Image$0.02/ imageper image

Specifications

  • ModesGenerate

Call Grok Imagine Image

POST /v1/images/generationsSet LLMAPI_KEY to your LLM API key.Generate docs

import base64
import os

from openai import OpenAI

client = OpenAI(
    base_url="https://api.llmapi.ai/v1",
    api_key=os.environ["LLMAPI_KEY"],
)

result = client.images.generate(
    model="grok-imagine-image",
    prompt="A lighthouse at dawn, watercolor",
)
with open(f"image.{result.output_format}", "wb") as f:
    f.write(base64.b64decode(result.data[0].b64_json))

Prices synced .

You've been invited to LLM API

Top up $50 or more and the friend who invited you gets $20 in credits. We pay the $20; your credits stay yours. Referral terms

Sign up