Text to Image
Generate high-quality images using Jimeng (Dreamina) models based on text prompts.Endpoint
POST /v1/images/generations
Authentication
All requests require a Bearer token in the Authorization header:Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Model ID, e.g., jimeng-2.1 |
| prompt | string | Yes | Text description for image generation |
| negative_prompt | string | No | Negative prompt describing unwanted content |
| n | integer | No | Number of images to generate, default 1 |
| size | string | No | Image size, e.g., 1024x1024, 1280x720 |
| style | string | No | Image style |
| response_format | string | No | Response format, options: url, b64_json, default url |
Request Example
Response Example
Response Fields
| Field | Type | Description |
|---|---|---|
| created | integer | Creation timestamp |
| data | array | List of generated images |
| data[].url | string | Image URL |
| data[].b64_json | string | Base64 encoded image |