> ## Documentation Index
> Fetch the complete documentation index at: https://docs.novita.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Ming Image Text to Image

Ming Image — an image generation model family. `ming-image-0.1-design` supports text-to-image generation using the OpenAI Image generations protocol.

* `ming-image-0.1-design`: Supports text-to-image, using the OpenAI Image generations protocol.
* `ming-image-0.1-design-layer`: Only supports layer decoupling, using the OpenAI Image edits protocol (see the [Ming Image Layer Decoupling](/api-reference/model-apis-ming-image-layer) API).

## Request Headers

**Content-Type** `string` *required*

Supports: `application/json`

**Authorization** `string` *required*

Bearer authentication format, for example: Bearer \{\{API Key}}.

## Request Body

**model** `enum` *required*

The model name. Available values: `ming-image-0.1-design`

**prompt** `string` *required*

The text description of the image.

**output\_format** `string` (default: png)

The output image format. Must be one of `png` or `jpeg`.

**response\_format** `string` (default: b64\_json)

The form in which the image is returned, default is `b64_json`. Available values: `url`, `b64_json`. Note: `url` is valid for 24 hours.

**size** `string` (default: auto)

The output image size, default `auto` selects automatically based on the model. Format `"{w}x{h}"`, e.g. `"1024x1024"`.

`ming-image-0.1-design` size only supports 1k and above, e.g. `"1024x1024"`, `"2048x2048"`.

**watermark** `boolean` (default: false)

Controls whether a watermark is added to the AI-generated image. `true`: enables the explicit watermark and implicit digital watermark on AI-generated images, complying with policy requirements. `false`: disables all watermarks.

## Response

**created** `integer` *required*

The Unix timestamp (seconds) when the response was created.

**data** `array` *required*

The array of returned images, each element contains the information of one generated image.

**properties**

**b64\_json** `string`

The base64-encoded generated image data.

**output\_format** `string` *required*

The actual output image format, e.g. `png`, `jpeg`.

**size** `string`

`null`

**usage** `object` *required*

Token usage statistics.

**properties**

**input\_tokens** `integer`

Total input tokens (0 for text-to-image).

**input\_tokens\_details** `object`

Input token details.

**properties**

**image\_tokens** `integer`

The number of image tokens in the input (0 for text-to-image).

**text\_tokens** `integer`

The number of text tokens in the input.

**output\_tokens** `integer`

Total output tokens (i.e. the tokens consumed by the generated image).

**total\_tokens** `integer`

The total of input + output tokens.

**output\_tokens\_details** `object`

Output token details.

**properties**

**image\_tokens** `integer`

The number of image tokens in the output.

**text\_tokens** `integer`

The number of text tokens in the output.

**model** `string` *required*

The name of the model that actually processed the request.

**id** `string` *required*

The unique identifier ID of this request.

## Example

`Request:`

```bash theme={"system"}
curl --location --request POST 'https://api.novita.ai/openai/v1/images/generations' \
--header 'Authorization: Bearer {{API Key}}' \
--header 'content-type: application/json' \
--data-raw '{
  "model": "ming-image-0.1-design",
  "prompt": "Generate a banana"
}'
```

`Response:`

```js theme={"system"}
{
  "created": 1789642354,
  "data": [
    {
      "b64_json": "..."
    }
  ],
  "output_format": "png",
  "size": null,
  "usage": {
    "input_tokens": 0,
    "input_tokens_details": {
      "image_tokens": 0,
      "text_tokens": 0
    },
    "output_tokens": 16384,
    "total_tokens": 16384,
    "output_tokens_details": {
      "image_tokens": 16384,
      "text_tokens": 0
    }
  },
  "model": "Ming-Image-0.1-Design-StressTest",
  "id": "2180534417896423312485570e8523"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.