PixAI Platform
API v2 DocumentationImage

Create an image generation task

Start to generate a new image using the simplified v2 API. The v2 API provides a streamlined interface with user-friendly parameters such as `aspectRatio`, `mode`, and named `style` presets, replacing the raw pixel dimensions and internal parameter names of v1.

POST
/image/create

Authorization

bearerAuth
AuthorizationBearer <token>

In all requests that require authentication

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://api.pixai.art/v2/image/create" \  -H "Content-Type: application/json" \  -d '{    "modelVersionId": "1983308862240288769",    "prompt": "1girl, green hair, solo, standing",    "aspectRatio": "9:16",    "mode": "standard"  }'
{
  "id": "string",
  "status": "waiting",
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "startedAt": "2019-08-24T14:15:22Z",
  "endAt": "2019-08-24T14:15:22Z",
  "outputs": {
    "mediaIds": [
      "string"
    ],
    "mediaUrls": [
      "string"
    ]
  }
}
Empty
Empty