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

# What Happens If You Omit the Model Name in an Image Request? It Defaults to dall-e-2 and Fails Fast with a 503

> If model is omitted or empty on /v1/images/generations, APIYI uses the OpenAI-compatible default dall-e-2. When the group has no channel for it, the request fails in 0.1–0.3 seconds with a 503.

## Short answer

You must pass `model` explicitly. If you **omit `model`** on `/v1/images/generations`, or send an empty string or `null`, APIYI applies the OpenAI-compatible default model **`dall-e-2`**.

If the current token group has no available channel for `dall-e-2`, the gateway returns `503` immediately at the **channel selection** stage:

```json theme={null}
{
  "error": {
    "message": "Current group default has no available channels for model dall-e-2 under billing mode [pay-as-you-go, pay-per-request] (request id: 2026...)",
    "type": "shell_api_error"
  }
}
```

This failure has three characteristics: **it returns very fast (about 0.1–0.3 seconds)**, **it never calls any image channel**, and **APIYI does not charge for it**. It does not mean the model you intended, such as `gpt-image-2.5-flare`, is unstable.

## Why the default is dall-e-2

* In the official OpenAI OpenAPI specification, `model` is optional for image generation and defaults to `dall-e-2`; it also accepts `null`.
* APIYI's gateway follows the historical one-api implementation: `middleware/utils.go` writes `dall-e-2` when `model` is empty on `/v1/images/generations`, and `getImageRequest` in `relay/controller/image.go` also sets an empty `model` to `dall-e-2`.
* The gateway selects a channel by model name before calling the provider. Once the model name has been filled in as `dall-e-2`, it no longer looks for a `gpt-image-2.5-flare` channel; if the group has no `dall-e-2` channel, it can only return "no available channels" immediately.

> [!NOTE]
>
> This is not a "channel outage." The model name in the error is the key clue: whenever you see `no available channels for model dall-e-2`, check the `model` in your request body first instead of troubleshooting image channels.

## Common ways the model gets dropped

> [card] Migrating from Azure OpenAI
>
> Azure puts the model name in the URL deployment path, so the request body can omit `model`. Changing only the Base URL and path without adding `model` triggers the default.

> [card] Hand-written HTTP requests
>
> Requests built directly with requests, HttpClient, OkHttp, or Go `http.Client` may serialize only `prompt`, `size`, and `n`, leaving `model` in configuration but out of the request body.

> [card] Separate generation and edit paths
>
> The model picker lives in the frontend while the backend has separate code for text-to-image and image editing; the edit path forwards `model`, but the generation path does not.

> [card] Older SDKs or low-code nodes
>
> Some older SDKs, third-party wrappers, or workflow nodes do not include `model` in their default image parameters, or allow it to be omitted.

> [card] A middle layer drops the field
>
> DTO conversion, field allowlists, queue serialization, or task replay may keep only the prompt, so `model` is lost at one layer.

> [card] Test template defaults
>
> Console or debugging templates fall back to `dall-e-2` when no model is selected, and that behavior can carry over into production.

## How to diagnose and fix it

**1. Read the model name in the 503**

If the error says `no available channels for model dall-e-2`, your request body did not carry the model you intended. Trust that model name rather than the selection shown in your platform UI.

**2. Inspect the request body actually sent**

Log the final serialized body on your server and confirm at least `model`, `size`, and `n`. Do not log only the frontend selection or a configuration value.

**3. Pass the model explicitly**

Pass `model` on both `/v1/images/generations` and `/v1/images/edits`, and make sure it reaches the final request body. Do not rely on the compatibility default.

**4. Verify the model name and group permission**

Use `/v1/models` to confirm the model name, then check whether the current group can use it in the console or on the [Model Pricing](https://docs.apiyi.com/en/models/index.md) page before sending production traffic.

A correct minimal request body looks like this:

```json theme={null}
{
  "model": "gpt-image-2.5-flare",
  "prompt": "A product photo of a white ceramic mug",
  "size": "1024x1024",
  "n": 1
}
```

## Why you should not rely on the default

> [!WARNING]
>
> Even if a group happens to have a `dall-e-2` channel, omitting `model` will not raise an error, but the image will be generated with **dall-e-2**: its capabilities, quality, size support, and billing are all different from the model you intended. Different gateways and versions also handle an empty `model` differently; some reject it and others default to a different model, which makes cross-gateway migrations error-prone.

## Related documents

* [Image API Best Practices](https://docs.apiyi.com/en/api-capabilities/image-api-best-practices.md)
* [How to Troubleshoot Model Call Errors](https://docs.apiyi.com/en/faq/model-error-troubleshooting.md)
* [How to Find the Request ID](https://docs.apiyi.com/en/faq/request-id-troubleshooting.md)
* [Model Pricing](https://docs.apiyi.com/en/models/index.md)


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