# Default Parameters for GPT-Image-2 Generation: Complete API Reference

> Discover the default parameters for GPT-Image-2 generation including model, prompt limit, image count, aspect ratio, resolution, language, and pricing. Access the complete API reference.

- Repository: [苍何/awesome-gpt-image-2](https://github.com/freestylefly/awesome-gpt-image-2)
- Tags: api-reference
- Published: 2026-09-04

---

**The GPT-Image-2 generation API in the `freestylefly/awesome-gpt-image-2` repository automatically applies built-in defaults—model `gpt-image-2`, 10,000-character prompt limit, single image output (`n=1`), 1:1 aspect ratio at 1k resolution (1024×1024), English language (`en`), and $0.010625 pricing—unless explicitly overridden in the request body.**

When integrating the `/api/generate-image` endpoint, developers should understand these hardcoded defaults defined in the source code. The repository automatically applies these parameters through the `buildApimartGenerationPayload` function, ensuring consistent behavior while allowing selective customization via the POST request payload.

## Core Model and Configuration Defaults

The foundational constants governing GPT-Image-2 generation are defined in [`shared/apimart.js`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/shared/apimart.js):

- **Model**: `gpt-image-2` — specified by the `APIMART_MODEL` constant (line 1)
- **Maximum Prompt Length**: `10,000` characters — enforced by `APIMART_MAX_PROMPT_LENGTH` (line 5)
- **Default Price**: `$0.010625` per 1k-resolution image — set by `APIMART_DEFAULT_PRICE_USD` (line 3)

These constants act as the system-wide baseline for all generation requests.

## Image Generation Defaults in buildApimartGenerationPayload

The `buildApimartGenerationPayload` function in [`shared/apimart.js`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/shared/apimart.js) initializes image-specific parameters with the following defaults:

- **Number of Images (`n`)**: `1` (line 11)
- **Aspect Ratio (`size`)**: `1:1` (square format) (line 12)
- **Resolution (`resolution`)**: `1k` (approximately 1024×1024 pixels) (line 13)

These values are applied to the payload object before merging with client-supplied options.

## Localization and Webhook Defaults

Additional defaults handle internationalization and callbacks:

- **Language**: English (`en`) — the function checks for a `language` field and defaults to `"en"` unless the caller explicitly supplies `zh` (lines 17-18 of `buildApimartGenerationPayload`)
- **Webhook URL**: Empty string — in [`api/generate-image.js`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/api/generate-image.js), the `submitApimartGeneration` function only adds a `webhook` field to the payload if `appUrl` is present (lines 48-49), effectively defaulting to no callback

## Practical Usage Examples

### Minimal Request (Using All Defaults)

Send a request with only the required `prompt` and `caseId` to accept all default parameters:

```javascript
await fetch('/api/generate-image', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    prompt: 'a futuristic city skyline at sunset',
    caseId: 12345               // required, but other fields optional
  })
});

```

This triggers the default configuration: single 1k square image in English using `gpt-image-2`.

### Overriding Select Defaults

Override specific parameters while retaining others:

```javascript
await fetch('/api/generate-image', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    prompt: '一只在雪山上的狐狸',
    caseId: 12346,
    language: 'zh',
    // The API will still use n=1, size=1:1, but resolution changes to 4k internally
    // because the client can request a different resolution via a webhook or later request.
  })
});

```

Here, the language defaults are overridden to Chinese (`zh`), while image count and aspect ratio remain at their standard values.

## Summary

- The system defaults to the `gpt-image-2` model via `APIMART_MODEL` in [`shared/apimart.js`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/shared/apimart.js).
- Generation produces **1 image** at **1:1 aspect ratio** with **1k resolution** (1024×1024) unless specified otherwise.
- Prompts are limited to **10,000 characters** as defined by `APIMART_MAX_PROMPT_LENGTH`.
- Standard generation costs **$0.010625** per image at default resolution.
- The API defaults to **English** (`en`) language settings and **no webhook callback** unless the request includes alternative values.

## Frequently Asked Questions

### What is the maximum prompt length allowed for GPT-Image-2 generation?

The API enforces a hard limit of **10,000 characters** defined by the `APIMART_MAX_PROMPT_LENGTH` constant in [`shared/apimart.js`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/shared/apimart.js) (line 5). Requests exceeding this threshold are rejected before processing begins.

### How many images does the API generate by default?

By default, the API generates **one image** (`n=1`) with a **1:1 square aspect ratio**. These values are hardcoded in the `buildApimartGenerationPayload` function at lines 11-12 of [`shared/apimart.js`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/shared/apimart.js).

### What is the default resolution and pricing for generated images?

The default resolution is **1k** (approximately 1024×1024 pixels), with each image costing **$0.010625** as specified by `APIMART_DEFAULT_PRICE_USD` in [`shared/apimart.js`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/shared/apimart.js) (line 3). The system supports alternative resolutions, but 1k serves as the baseline.

### Does the API default to English, and can I change the language?

Yes, the default language is **English** (`en`). The `buildApimartGenerationPayload` function (lines 17-18 of [`shared/apimart.js`](https://github.com/freestylefly/awesome-gpt-image-2/blob/main/shared/apimart.js)) checks for a `language` field in the request and falls back to `en` if not provided. To generate Chinese prompts, explicitly set `language: "zh"` in the request body.