API v2 문서이미지

이미지 생성 작업 생성

간소화된 v2 API로 비동기 이미지 생성 작업을 시작합니다. 응답에는 생성된 작업의 ID가 포함됩니다.

v2 API는 aspectRatio(종횡비), mode(품질 모드), 명명된 style 프리셋 등 사용자 친화적인 파라미터를 제공하며, v1의 원시 픽셀 치수 및 내부 파라미터명을 대체합니다.

POST
/image/create

Authorization

bearerAuth
AuthorizationBearer <token>

인증이 필요한 모든 요청에는 HTTP 헤더에 다음을 추가하세요

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST https://api.pixai.art/v2/image/create \  -H "Authorization: Bearer $PIXAI_API_KEY" \  -H "Content-Type: application/json" \  -d '{    "modelVersionId": "1983308862240288769",    "prompt": "1girl, green hair, solo, standing",    "aspectRatio": "9:16",    "mode": "standard",    "batchSize": 4,    "seed": 12345  }'
{
  "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",
  "taskKind": "string",
  "paidQuota": 0,
  "taskStatusMsgI18n": {
    "key": "string",
    "defaultMessage": "string"
  },
  "outputs": {
    "videoMediaId": "string",
    "seed": "string",
    "mediaIds": [
      "string"
    ],
    "mediaUrls": [
      "string"
    ]
  }
}
{
  "defined": false,
  "code": "BAD_REQUEST",
  "status": 400,
  "message": "Input validation failed",
  "data": {
    "issues": [
      {
        "code": "custom",
        "path": [],
        "message": "Either modelId or modelVersionId must be provided"
      }
    ]
  }
}
{
  "code": "string",
  "status": 0,
  "message": "string",
  "data": {},
  "defined": true
}
{
  "code": "string",
  "status": 0,
  "message": "string",
  "data": {},
  "defined": true
}
{
  "code": "string",
  "status": 0,
  "message": "string",
  "data": {},
  "defined": true
}
{
  "code": "string",
  "status": 0,
  "message": "string",
  "data": {},
  "defined": true
}
{
  "code": "string",
  "status": 0,
  "message": "string",
  "data": {},
  "defined": true
}