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

# GPT Image 2 – Text-to-Image API | Magnific API

> Generate images from text with GPT Image 2. Three quality tiers, up to 10 images per request, strong prompt following and legible in-image text rendering.

<Card title="OpenAI GPT Image 2" icon="wand-magic-sparkles">
  Text-to-image generation with three cost/quality tiers and unusually reliable prompt following, including legible text rendered inside the image.
</Card>

GPT Image 2 is a text-to-image API that turns a written prompt into one or more images. Built on OpenAI's GPT Image 2 model, it is chosen mainly for two things: it follows long, specific prompts closely, and it renders readable text inside the image — labels, signage, UI copy, packaging — which most diffusion models struggle with. A `quality` parameter selects the tier, so you can iterate cheaply and then re-run the same prompt at higher quality. To edit an existing image instead of generating from scratch, see <a href="/api-reference/text-to-image/gpt-image-2-edit/overview">GPT Image 2 Edit</a>.

### Key capabilities

* **Three quality tiers**: `quality` accepts `low`, `medium` and `high`. The tier changes both the render quality and the credit cost of the request, so the same prompt can be drafted cheaply and finalised at `high`
* **Batch generation**: request up to 10 images in a single call with `num_images`. Each image in the batch is billed
* **Prompt adherence**: follows long, multi-clause prompts including counts, spatial relationships and negations more closely than typical diffusion models
* **In-image text**: renders legible words and short phrases inside the image, which makes it suitable for mockups, posters and packaging
* **Async processing**: every request returns a task ID immediately. Poll the task endpoint or supply `webhook_url` to be notified on completion

### Use cases

* **Marketing and advertising**: on-brand key visuals where the headline or product name has to be readable inside the image
* **Packaging and print mockups**: labels, boxes and signage that need real text rather than text-shaped noise
* **Product and UI concepting**: interface screens, dashboards and device mockups with legible captions
* **Editorial illustration**: article and newsletter art generated from a detailed brief
* **Content pipelines at scale**: batch up to 10 variants per prompt at `low`, review, then re-render the winner at `high`

### Generate images with GPT Image 2

Submit a prompt to create a generation task. The API responds with a task ID; collect the result by polling or via webhook.

<div className="my-11">
  <Columns cols={2}>
    <Card title="POST /v1/ai/text-to-image/gpt-image-2" icon="wand-magic-sparkles" href="/api-reference/text-to-image/gpt-image-2/generate">
      Create a new image generation task
    </Card>

    <Card title="GET /v1/ai/text-to-image/gpt-image-2" icon="list" href="/api-reference/text-to-image/gpt-image-2/gpt-image-2-tasks">
      List all GPT Image 2 tasks with status
    </Card>

    <Card title="GET /v1/ai/text-to-image/gpt-image-2/{task-id}" icon="magnifying-glass" href="/api-reference/text-to-image/gpt-image-2/task-by-id">
      Get task status and results by ID
    </Card>
  </Columns>
</div>

### Parameters

| Parameter       | Type      | Required | Default      | Description                                                                                                                               |
| --------------- | --------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `prompt`        | `string`  | Yes      | -            | Text description of the image to generate                                                                                                 |
| `quality`       | `string`  | No       | `high`       | Quality and cost tier: `low`, `medium` or `high`                                                                                          |
| `resolution`    | `string`  | No       | `1k`         | Output resolution tier: `1k`, `2k` or `4k`. Also multiplies the credit cost — see Pricing below                                           |
| `aspect_ratio`  | `string`  | No       | `square_1_1` | Shape of the output, e.g. `square_1_1`, `widescreen_16_9`, `banner_3_1`. Combined with `resolution` it selects the exact pixel size       |
| `num_images`    | `integer` | No       | `1`          | Number of images to generate in one request, up to 10. Each image is billed                                                               |
| `output_format` | `string`  | No       | `png`        | `png`, `jpeg` or `webp`. `output_compression` applies to the last two                                                                     |
| `background`    | `string`  | No       | -            | `opaque` or `auto`. `auto` may return transparency, which only `png` and `webp` can keep                                                  |
| `moderation`    | `string`  | No       | `auto`       | Strictness of the model provider's own filter: `auto` or `low`. Applied on top of Freepik's platform moderation, which cannot be disabled |
| `webhook_url`   | `string`  | No       | -            | URL called when the task completes                                                                                                        |

### Pricing

The `quality` tier sets the price per image and `resolution` multiplies it:

|                   | `1k` | `2k` | `4k` |
| ----------------- | ---- | ---- | ---- |
| credits per image | x1   | x2   | x3   |

Every image in `num_images` is billed, so a `4k` request for 4 images costs
twelve times a single `1k` image of the same quality tier.

The endpoint reference pages above are generated from the OpenAPI specification and are the authoritative, complete parameter list.

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="What is GPT Image 2 and how does it work?">
    GPT Image 2 is a text-to-image API powered by OpenAI's GPT Image 2 model. You submit a text prompt and receive a task ID immediately. Poll the task endpoint or configure a webhook to receive the generated images when processing completes.
  </Accordion>

  <Accordion title="What does the quality parameter change?">
    `quality` selects one of three tiers — `low`, `medium` or `high`. A higher tier spends more compute per image, which improves detail and text fidelity, and costs more credits per image. `low` is intended for fast iteration, `high` for final assets.
  </Accordion>

  <Accordion title="How many images can I generate in one request?">
    Up to 10, via `num_images`. Every image in the batch is billed at the tier you selected, so a request for 10 images at `high` costs ten times a single `high` image.
  </Accordion>

  <Accordion title="Is GPT Image 2 good at rendering text inside images?">
    Yes — reliable in-image text is its main differentiator over most diffusion models. Short, specific strings (a product name, a headline, a button label) work best. Long paragraphs of body copy are still unreliable in any current image model.
  </Accordion>

  <Accordion title="What is the difference between GPT Image 2 and GPT Image 2 Edit?">
    GPT Image 2 generates a new image from a text prompt alone. GPT Image 2 Edit takes one or more existing images plus a prompt and returns a modified version, for retouching, object changes and style edits. Both share the same three quality tiers and the same batch limit.
  </Accordion>

  <Accordion title="What are the rate limits for GPT Image 2?">
    Rate limits depend on your subscription tier. See [Rate Limits](/ratelimits) for current limits.
  </Accordion>

  <Accordion title="How much does GPT Image 2 cost?">
    Cost per image depends on the `quality` tier you request. See the [Pricing page](/pricing) for current rates and subscription options.
  </Accordion>
</AccordionGroup>

## Best practices

* **Tier the workflow**: draft at `quality: "low"`, review, then re-run the winning prompt at `quality: "high"`. The prompt does not need to change
* **Batch deliberately**: `num_images` is billed per image. Batch at `low` for exploration, generate single images at `high`
* **Write text explicitly**: put the exact string you want rendered in quotes inside the prompt, and keep it short
* **Be specific**: GPT Image 2 rewards long, concrete prompts — subject, composition, lighting, camera, style — more than keyword lists
* **Production integration**: use `webhook_url` instead of polling for scalable applications
* **Error handling**: implement retry logic with exponential backoff for 503 errors

## Related APIs

* **[GPT Image 2 Edit](/api-reference/text-to-image/gpt-image-2-edit/overview)**: edit existing images with the same model and quality tiers
* **[Nano Banana Pro](/api-reference/text-to-image/post-nano-banana-pro)**: Google Gemini image generation, also strong at in-image text
* **[Seedream 5 Pro](/api-reference/text-to-image/post-seedream-v5-pro)**: high-resolution text-to-image with a generate and edit split
* **[FLUX.2 Pro](/api-reference/text-to-image/post-flux-2-pro)**: photorealistic generation with fine-grained resolution control
