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

# Generate images

> Create images from a prompt

| Field                | Type    | Required | Description                                   |
| -------------------- | ------- | -------- | --------------------------------------------- |
| `model`              | string  | Yes      | Image model ID.                               |
| `prompt`             | string  | Yes      | Image description.                            |
| `n`                  | integer | No       | Number of images, subject to model limits.    |
| `size`, `quality`    | string  | No       | Output dimensions and quality.                |
| `background`         | string  | No       | Transparent, opaque, or automatic background. |
| `output_format`      | string  | No       | Such as png, jpeg, or webp.                   |
| `moderation`, `user` | string  | No       | Moderation level and user identifier.         |

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.bianxie.ai/v1/images/generations \
    -H "Authorization: Bearer API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "your-model",
      "prompt": "A futuristic city"
    }'
  ```

  ```python Python theme={null}
  client.images.generate(model="your-model", prompt="A futuristic city")
  ```

  ```javascript Node.js theme={null}
  await client.images.generate({ model: "your-model", prompt: "A futuristic city" });
  ```
</CodeGroup>

The response includes `created` and `data[]`; images may be returned as `b64_json` or URLs, sometimes with a revised prompt. Treat this as non-streaming unless the selected model explicitly supports progress events.
