# Görsel oluşturma görevi gönderin

**API:** Model API

**Endpoint:** `POST /api/v1/images/generations`

Kalıcı bir task_id ile HTTP 202 döndürür. GET /api/v1/images/generations/{task_id} adresini yoklayın. Düz veya iç içe giriş desteklenir; iç içe giriş öncelik kazanır. Geri çağırma alanları yok sayılır. Yetenekler ve giriş parametreleri yapılandırılmış modele ve kanala bağlıdır.

## Base URL

- `https://openapi.felo.ai` — Üretim

## Authentication

- `FeloBearerAuth` (http bearer) — `Authorization: Bearer <key>` biçiminde gönderilen Felo API anahtarı.
- `FeloApiKey` (apiKey in header `X-API-Key`) — `X-API-Key: <key>` biçiminde gönderilen Felo API anahtarı.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `X-Request-Id` | header | no | string | Tanılama için geri yansıtılan isteğe bağlı çağıran istek kimliği. |
| `X-Felo-Channel` | header | no | string, default: "default" | Virgülle ayrılmış sıralı genel kanal kodları. Varsayılanı kullanmak için bu başlığı atlayın; default tek başına kullanılmalıdır. Cüzdan modunda default, modelin geçerli genel kanal sırasını tersten tarar, yayımlanmamış veya kullanılamayan kanalları atlar ve ilk kullanılabilir kanalın sağlayıcısını seçer. Aynı üst kaynak model kimliğine ve hizmet katmanına sahip, o sağlayıcıya ait kullanılabilir uç noktaları içerir. Açıkça belirtilen kanallar istemcinin belirttiği sırayla doğrulanır; yalnızca ilk kanalın sağlayıcı grubu gönderilir. Diğer sağlayıcılara otomatik geçiş yapılmaz. Eski sağlayıcı başlıkları kanal yönlendirmesini geçersiz kılamaz. |

## Request body

Required: **yes**

### application/json

Schema: `ImageGenerationRequest` (`#/components/schemas/ImageGenerationRequest`)

```json
{
  "type": "object",
  "required": [
    "model"
  ],
  "properties": {
    "model": {
      "type": "string"
    },
    "prompt": {
      "type": "string"
    },
    "input": {
      "type": "object",
      "additionalProperties": true,
      "description": "İsteğe bağlı iç içe input; düz girdiye göre öncelik kazanır.",
      "properties": {
        "input_references": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "image_url"
                ]
              },
              "image_url": {
                "type": "object",
                "additionalProperties": false,
                "oneOf": [
                  {
                    "required": [
                      "url"
                    ]
                  },
                  {
                    "required": [
                      "file_id"
                    ]
                  }
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "\\S",
                    "not": {
                      "pattern": "^\\s*felo_file_"
                    }
                  },
                  "file_id": {
                    "type": "string",
                    "maxLength": 80,
                    "pattern": "^felo_file_[A-Za-z0-9_-]{1,70}$",
                    "description": "Uploaded Felo file owned by the authenticated user."
                  }
                }
              },
              "role": {
                "type": "string",
                "description": "Optional asset role for models that define reference roles, e.g. refer_image, style_refer_image or subject_refer_image for Kling long images. Other channels reject it."
              }
            },
            "required": [
              "type",
              "image_url"
            ]
          },
          "description": "Reference images by URL/data URI or uploaded Felo file_id. At most 100 Felo references and 50,000,000 bytes per request; model/channel limits may be lower. Keep files until completion."
        },
        "service_tier": {
          "type": [
            "string",
            "null"
          ],
          "default": "default",
          "description": "Şu anda yalnızca default (standart) desteklenir. Atlanan, null, takma adlar ve desteklenmeyen dizeler default değerine döner; diğer türler HTTP 400 döndürür. Yapılandırılmış kanallar ve fiyatlar değişmez. Metin API'leri sağlayıcının standart değerini gönderir; Decisions ve oluşturma API'leri üst kaynak alanını atlar."
        }
      }
    },
    "n": {
      "type": "integer"
    },
    "size": {
      "type": "string",
      "description": "Model-specific size. For supported Gemini token-priced image models, pixel dimensions select the nearest supported aspect ratio only; ignored when aspect_ratio is supplied. Use image_size or resolution for the resolution tier."
    },
    "image_size": {
      "type": "string",
      "enum": [
        "512",
        "1K",
        "2K",
        "4K"
      ],
      "description": "Resolution tier for supported Gemini token-priced image models. Available tiers depend on the model and channel."
    },
    "resolution": {
      "type": "string",
      "description": "Resolution tier; must agree with image_size when both are supplied."
    },
    "aspect_ratio": {
      "type": "string",
      "description": "Output aspect ratio. Supported values depend on the model and channel."
    },
    "provider": {
      "type": "object",
      "required": [
        "options"
      ],
      "additionalProperties": false,
      "properties": {
        "options": {
          "type": "object",
          "minProperties": 1,
          "maxProperties": 1,
          "additionalProperties": {
            "type": "object"
          },
          "description": "Options keyed by the slug published in the model catalog."
        }
      }
    },
    "quality": {
      "type": "string",
      "description": "Model-specific quality or resolution tier. For supported Gemini token-priced models, auto/low map to 1K, medium to 2K and high to 4K, subject to model capabilities. Explicit image_size or resolution takes precedence over these labels. Estimated reservations do not replace actual usage billing."
    },
    "input_references": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "image_url"
            ]
          },
          "image_url": {
            "type": "object",
            "additionalProperties": false,
            "oneOf": [
              {
                "required": [
                  "url"
                ]
              },
              {
                "required": [
                  "file_id"
                ]
              }
            ],
            "properties": {
              "url": {
                "type": "string",
                "minLength": 1,
                "pattern": "\\S",
                "not": {
                  "pattern": "^\\s*felo_file_"
                }
              },
              "file_id": {
                "type": "string",
                "maxLength": 80,
                "pattern": "^felo_file_[A-Za-z0-9_-]{1,70}$",
                "description": "Uploaded Felo file owned by the authenticated user."
              }
            }
          },
          "role": {
            "type": "string",
            "description": "Optional asset role for models that define reference roles, e.g. refer_image, style_refer_image or subject_refer_image for Kling long images. Other channels reject it."
          }
        },
        "required": [
          "type",
          "image_url"
        ]
      },
      "description": "Reference images by URL/data URI or uploaded Felo file_id. At most 100 Felo references and 50,000,000 bytes per request; model/channel limits may be lower. Keep files until completion."
    },
    "skill": {
      "type": "string",
      "description": "Long-image type for models that publish it in parameter_definitions, e.g. ecommerce or webpage."
    },
    "length": {
      "type": "string",
      "description": "Page length for long-image models; see applies_when in parameter_definitions for the skills it applies to."
    },
    "service_tier": {
      "type": [
        "string",
        "null"
      ],
      "default": "default",
      "description": "Şu anda yalnızca default (standart) desteklenir. Atlanan, null, takma adlar ve desteklenmeyen dizeler default değerine döner; diğer türler HTTP 400 döndürür. Yapılandırılmış kanallar ve fiyatlar değişmez. Metin API'leri sağlayıcının standart değerini gönderir; Decisions ve oluşturma API'leri üst kaynak alanını atlar."
    }
  },
  "additionalProperties": true,
  "description": "Modele özgü girdi, yapılandırılmış genel model protokolünü izler."
}
```

Example:

```json
{
  "model": "configured-image-model",
  "prompt": "a cat"
}
```

## Responses

### 202 — Görev kabul edildi

**application/json**

Schema: `ImageGenerationAccepted` (`#/components/schemas/ImageGenerationAccepted`)

### 400 — Geçersiz istek (bilinmeyen model, karışık giriş modları, geçersiz alanlar)

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

### 401 — Geçersiz veya eksik Felo API anahtarı

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

### 402 — Yetersiz bakiye / faturalandırma koşulu karşılanmadı

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

### 403 — Hesabın izni yok (abonelik gerekli veya kullanıcı yasaklanmış). Devre dışı modeller de üst kaynak çağrılarından önce reddedilir. Mevcut kabul edilmiş istekler ve görevler devam eder.

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

### 429 — İstek veya harcama sınırına ulaşıldı

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

### 502 — Üst kaynak sağlayıcı başarısız oldu

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

### 503 — Oluşturma hizmeti veya faturalandırma hizmeti geçici olarak kullanılamıyor

**application/json**

Schema: `GenerationError` (`#/components/schemas/GenerationError`)

## Schema definitions

### GenerationError

`#/components/schemas/GenerationError`

```json
{
  "type": "object",
  "description": "OpenAI uyumlu hata zarfı.",
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "message",
        "type"
      ],
      "properties": {
        "message": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "invalid_request_error",
            "server_error"
          ]
        },
        "param": {
          "type": "string",
          "nullable": true
        },
        "code": {
          "type": "string"
        }
      }
    }
  }
}
```

### ImageGenerationAccepted

`#/components/schemas/ImageGenerationAccepted`

```json
{
  "type": "object",
  "required": [
    "task_id",
    "status",
    "kind",
    "outputs"
  ],
  "properties": {
    "task_id": {
      "type": "string",
      "description": "Yoklama için kullanılacak görev kimliği."
    },
    "status": {
      "type": "string",
      "enum": [
        "queued"
      ]
    },
    "kind": {
      "type": "string",
      "enum": [
        "image"
      ]
    },
    "outputs": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "string",
            "format": "uri"
          },
          {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "format": "uri"
              },
              "watermark_url": {
                "type": "string",
                "format": "uri",
                "nullable": true,
                "description": "Optional watermarked version of this image."
              },
              "b64_json": {
                "type": "string"
              }
            }
          }
        ]
      },
      "description": "Görev başarılı olana kadar boş."
    }
  }
}
```
