Skip to main content
POST
生成图像
Generate a new image from a text prompt. Available sizes, image counts, and response formats depend on the selected model.
The snippets below are complete requests. Set HILINKUP_API_KEY to your real key first, and replace model with an image model ID returned by GET /v1/models.

Request parameters

string
required
An image-capable model ID. Use GET /v1/models to list current values.
string
required
A text description of the target image.
integer
default:"1"
Number of images to generate. Some models only support 1.
string
Image size, for example 1024x1024. Valid values depend on the model.

Request examples

Response

integer
Unix timestamp of the generation result.
array
List of image results. Each item contains url or b64_json.
The response may return a temporary URL or Base64 data, usually in a b64_json field. Download and store the result before the URL expires.

Saving the result

The model IDs, response fields, and URLs in these examples illustrate the request format only. Confirm in the model catalog or console that your account can access the model, and which sizes and n values it supports.

Next steps

To modify an existing image instead, use Edit images.

Authorizations

Authorization
string
header
required

在控制台创建的 API Key,格式为 Authorization: Bearer HILINKUP_API_KEY。

Body

application/json
model
string
required

支持图像生成的模型 ID。

prompt
string
required

描述目标图像的文本提示。

n
integer
default:1

要生成的图像数量。部分模型只支持 1。

size
string

图像尺寸,例如 1024x1024。可用值由模型决定。

Response

200 - application/json

图像生成结果

created
integer

生成结果的 Unix 时间戳。

data
object[]
Last modified on October 8, 2026