---
title: "Create an AIHubMix image generation"
method: POST
path: "/ai/v1/images/generations"
tags: ["AIHubMix Unified API"]
---

# Create an AIHubMix image generation

`POST /ai/v1/images/generations`

## Request

- Base URL: `https://aihubmix.com`
- URL: `https://aihubmix.com/ai/v1/images/generations`
- Auth: HTTP bearer

Generates images with the AIHubMix native media protocol. Requests are synchronous by default and become asynchronous when `async` is `true`.

## Request body

- AIHubMixImageCreateRequest
  - `model` string, required: Image model ID.
  - `prompt` string, required
  - `n` integer, nullable
  - `size` string, nullable
  - `aspect_ratio` string, nullable
  - `seed` integer, nullable
  - `negative_prompt` string, nullable
  - `image` unknown
  - `images` unknown[], nullable
    - unknown
  - `mask` unknown
  - `output_format` 'png' | 'jpeg' | 'webp', nullable
  - `response_format` 'url' | 'b64_json', nullable
  - `async` boolean
  - `webhook_url` string, uri
  - `webhook_events_filter` string[]
  - `extra` object, nullable

## Response `200`

Image generation task

- AIHubMixMediaTask
  - `id` string, required: Platform task ID.
  - `object` 'image' | 'video', required
  - `model` string, required
  - `status` 'pending' | 'in_progress' | 'completed' | 'failed' | 'cancelled', required: Current task state. Completed, failed, and cancelled are terminal states.
  - `output` AIHubMixTaskArtifact[], required
    - `index` integer, required: Zero-based result order.
    - `result_id` string, nullable: Result ID exposed by unified task snapshots. Media task objects may omit it.
    - `type` 'file', required
    - `content_type` string, nullable
    - `content_url` string, nullable: Authenticated result download URL.
    - `b64_json` string, nullable: Base64-encoded image result when requested.
  - `error` AIHubMixTaskError, nullable, required
    - `code` string, required: Stable task error code.
    - `message` string, required: Human-readable error message.
    - `upstream_detail` unknown
  - `created_at` integer, required: Unix timestamp in seconds.
  - `completed_at` integer, nullable, required
  - `expires_at` integer, nullable, required: Artifact expiry time in Unix seconds; may be null before completion.

## Other responses

- `default`: AIHubMix task, validation, authentication, routing, artifact, or upstream error.

## Changes

- **2026-11-03** `0dfd8d5c3b27`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/aihubmix/apis/aihubmix-gateway-api/changes/ai/v1/images/generations/post.md)

---

[API](https://skmtc.dev/aihubmix/apis/aihubmix-gateway-api.md) - [All operations](https://skmtc.dev/aihubmix/apis/aihubmix-gateway-api/llms.txt) - [OpenAPI document](https://skmtc.dev/aihubmix/apis/aihubmix-gateway-api/revisions/0dfd8d5c3b27?raw)
