---
title: Image generation and editing
description: Submit prompts or source images to model-supported image endpoints.
lastUpdated: 2026-09-08
---

Image generation and image editing use different endpoints. Check the current model's interface and price in [Model Square](https://infistar.ai/pricing) before sending a request. Generation consumes account credit.

## Generate an image

Use `POST /v1/images/generations` with `Authorization: Bearer YOUR_API_KEY`.

| Parameter | Required | Meaning |
| --- | --- | --- |
| `model` | Yes | Exact image-generation model ID. |
| `prompt` | Yes | Description of the desired image, in English or Chinese. |
| `size` | No | Output dimensions supported by the model. |
| `quality` | No | Quality setting, where supported. |
| `style` | No | Style setting, where supported. |
| `n` | No | Requested number of images; the documented default is 1. |

## Edit an image

Use `POST /v1/images/edits` with the same authorization header. Common OpenAI-compatible models accept file uploads using `multipart/form-data`; some models use a JSON request with image URLs.

| Field | Required | Meaning |
| --- | --- | --- |
| `model` | Yes | Exact image-editing model ID. |
| `image` | Yes | Original image; supported size and format depend on the model. |
| `prompt` | Yes | Requested edit. |
| `mask` | No | Optional transparency mask indicating the editable area. |

Use the request format supported by the selected model. Do not assume generation support also means editing support. Inspect the returned result and usage log before submitting another request.

For a graphical client walkthrough, see [Cherry Studio image tutorial (Chinese)](/integration-guides/image-generation-quickstart). For asynchronous video results, see [Videos API](/en/api-reference/video-generation).
