---
title: "POST /openai/gpt/generations"
method: POST
path: "/openai/gpt/generations"
---

# POST /openai/gpt/generations

`POST /openai/gpt/generations`

Generate images based on text prompts and image resources

## Request body

- GptgenerationsRequest
  - `model` 'gpt-image-1.5' | 'gpt-image-2' | 'gpt-image-2-plus' — Supported models
  - `prompt` string, required — Text prompt for image generation. Since this is a reverse-engineered model, it's recommended to include keywords in your prompt such as: **"draw a xxx", "generate a", 'draw a xxx'**, Language is not restricted; OpenAI itself supports multilingual models with excellent Chinese support.
  - `referImages` string[] — Reference image array
  - `aspect_ratio` '1:1' | '3:4' | '4:3' | '16:9' | '9:16' — Support model: `gpt-image-2`
  - `size` string — Image Size (width × height), support model: `gpt-image-2-plus` must meet the following constraints: Both width and height must be multiples of 16 Maximum edge ≤ 3840 Aspect ratio ≤ 3:1 Total pixels: 655,360 ~ 8,294,400 If the input size is invalid, it will be automatically adjusted to a valid range
  - `hookUrl` string — Callback notification URL. When task completes or fails, this URL will be notified. <a href="gpt-fetch" target="_self">Notification data structure</a> is consistent with fetch structure. If not set, you need to request the <a href="gpt-fetch" target="_self">fetch endpoint</a> for query

## Response `200`

Request successful

- object
  - `status` string, required
  - `message` string, required
  - `data` object, required

## Other responses

- `400` — Parameter error
- `401` — Authorization failed

---

[API](https://skmtc.net/ttapi/apis/flowmusic-api-docs.md) · [All operations](https://skmtc.net/ttapi/apis/flowmusic-api-docs/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/ttapi/flowmusic-api-docs/versions/f27f8a59dbd0/schema)
