GPT Image
Tianshu's GPT image models (the gpt-image series) are for text-to-image and image editing, under the 生图专用 group.
Prepare
- Create a token in the
生图专用group in the Console. - Confirm an available image model name in the
生图专用group on the Model Marketplace (the examples below usegpt-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.
Option 1: API call (recommended)
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
| Parameter | Notes |
|---|---|
model | Always the image model name, e.g. gpt-image-2. |
prompt | Image description; spell out the subject, scene, style, aspect ratio and any text. |
n | Only 1 is supported — one image per call. |
size | Supports auto and common sizes such as 1024x1024, 1536x1024, 1024x1536. |
quality | low / medium / high / auto; use low for drafts and high for final output. |
response_format | url or b64_json; url is recommended by default. |
output_format | png or jpeg recommended; webp is not recommended. |
stream | Not supported — do not enable. |
Option 2: Generate images in Cherry Studio
- Create and copy a token in the
生图专用group. - Cherry Studio → Settings → Model Services → add an OpenAI-type provider:
- API address:
https://api.tian-shu.org - API key: your image-group token
- API address:
- Under "Manage", add an image model (such as
gpt-image-2). - Be sure to turn off "streaming output" (the image endpoint doesn't stream), otherwise generation may fail.
- 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.
