Skip to content

GPT Image

Tianshu's GPT image models (the gpt-image series) are for text-to-image and image editing, under the 生图专用 group.

Prepare

  1. Create a token in the 生图专用 group in the Console.
  2. Confirm an available image model name in the 生图专用 group on the Model Marketplace (the examples below use gpt-image-2).

Use the direct route

Image generation is a long-running request, so use the direct route https://api.tian-shu.org for the endpoint to avoid gateway timeouts.

To generate images, use the Images API, which has two endpoints: text-to-image and image editing.

Text-to-image /v1/images/generations

bash
curl 'https://api.tian-shu.org/v1/images/generations' \
  -H 'Authorization: Bearer your-image-group-token' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "gpt-image-2",
    "prompt": "an orange cat wearing an orange scarf hugging an otter, warm illustration style",
    "size": "1024x1024",
    "quality": "high",
    "output_format": "png",
    "response_format": "url",
    "n": 1
  }'

Image editing / image-to-image /v1/images/edits

Upload an image using multipart/form-data and describe the change clearly in prompt:

bash
curl 'https://api.tian-shu.org/v1/images/edits' \
  -H 'Authorization: Bearer your-image-group-token' \
  -F 'model=gpt-image-2' \
  -F 'prompt=Keep the subject, add a red stamp in the top-right corner reading DEMO' \
  -F 'image=@/path/to/your-image.jpg' \
  -F 'size=1024x1024' \
  -F 'quality=high' \
  -F 'output_format=png' \
  -F 'response_format=url'

Common parameters

ParameterNotes
modelAlways the image model name, e.g. gpt-image-2.
promptImage description; spell out the subject, scene, style, aspect ratio and any text.
nOnly 1 is supported — one image per call.
sizeSupports auto and common sizes such as 1024x1024, 1536x1024, 1024x1536.
qualitylow / medium / high / auto; use low for drafts and high for final output.
response_formaturl or b64_json; url is recommended by default.
output_formatpng or jpeg recommended; webp is not recommended.
streamNot supported — do not enable.

Option 2: Generate images in Cherry Studio

  1. Create and copy a token in the 生图专用 group.
  2. Cherry Studio → Settings → Model Services → add an OpenAI-type provider:
    • API address: https://api.tian-shu.org
    • API key: your image-group token
  3. Under "Manage", add an image model (such as gpt-image-2).
  4. Be sure to turn off "streaming output" (the image endpoint doesn't stream), otherwise generation may fail.
  5. Select the image model and you can start generating.

Note on call method

For gpt-image generation, use the Images API (/v1/images/generations, /v1/images/edits). The Chat Completions / Responses endpoints are not the entry point for image generation.