Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.clearmaas.com/llms.txt

Use this file to discover all available pages before exploring further.

ClearMaas exposes image generation through two paths, depending on which model you pick:
  1. /v1/images/generations — OpenAI image API shape. Best for dedicated image-generation models (DALL-E replacement family, Imagen, Grok Imagine).
  2. /v1/chat/completions — chat-style image generation. Best when you want a model that returns text and an image in one turn (Gemini’s nano-banana / “imagine” family).

Path 1: dedicated image API

/v1/images/generations follows the OpenAI image API shape. Model families that serve this endpoint:
  • OpenAI: openai/gpt-image-1, openai/gpt-image-1-mini, openai/gpt-image-1.5
  • Google Imagen: google/imagen-4.0-fast-generate-001, google/imagen-4.0-generate-001, google/imagen-4.0-ultra-generate-001
  • xAI: grok/grok-imagine-image, grok/grok-imagine-image-pro
curl https://api.clearmaas.com/v1/images/generations \
  -H "Authorization: Bearer sk-clearmaas-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-image-1",
    "prompt": "A cat astronaut on Mars, photorealistic",
    "size": "1024x1024"
  }'

Path 2: image generation via chat completions

Some Gemini models can return an image as part of a normal chat completion turn. When you pick one of these models, ClearMaas automatically tells the upstream to emit both text and an image in the response:
  • google/gemini-2.5-flash-image
  • google/gemini-3-pro-image-preview
  • google/gemini-3.1-flash-image-preview

Example

from openai import OpenAI

client = OpenAI(base_url="https://api.clearmaas.com/v1", api_key="sk-clearmaas-...")

resp = client.chat.completions.create(
    model="google/gemini-2.5-flash-image",
    messages=[{"role": "user", "content": "Draw a watercolour of a foggy harbor at dawn."}],
)

# resp.choices[0].message.content carries text + an image data URL or
# inline_data block, depending on the SDK's serialization.
These models are not callable via /v1/images/generations — use chat completions for them.

See also