API 문서미디어
이미지 또는 동영상 업로드
이미지 또는 동영상을 업로드하고 저장된 파일을 식별하는 미디어 ID를 받습니다.
Authorization
bearerAuth AuthorizationBearer <token>
인증이 필요한 요청에는 HTTP header에 아래 값을 추가하세요.
In: header
파일의 원본 바이트입니다. 이 엔드포인트는 multipart/form-data를 받지 않습니다.
다음 두 헤더가 필요합니다:
Content-Type— 파일의 MIME 타입입니다(예:image/png,video/mp4). 서버는image/*와video/*만 허용합니다.Content-Length— 본문의 정확한 바이트 길이입니다. 실제 본문 길이가 이 값과 다르면 요청이 실패합니다.
TypeScript Definitions
Use the request body type in TypeScript.
body*file
Format
binaryResponse Body
application/json
application/json
application/json
curl -X POST https://api.pixai.art/v1/media/upload \ -H "Authorization: Bearer $PIXAI_API_KEY" \ -H "Content-Type: image/png" \ --data-binary @reference.png{
"id": "string",
"type": "IMAGE",
"urls": [
{
"variant": "PUBLIC",
"url": "string"
}
],
"width": 0,
"height": 0,
"imageType": "string",
"fileUrl": "string",
"duration": 0,
"thumbnailUrl": "string",
"hlsUrl": "string",
"size": 0
}{
"code": 0,
"message": "string"
}{
"code": 0,
"message": "string"
}