KIE.AI
Chinese
  • English
  • Chinese
Chinese
  • English
  • Chinese
Support
Chinese
  • English
  • Chinese
MarketVeo3.1 APISuno API4o Image APIFlux Kontext APIRunway APILuma APIFile Upload API
Common API
MarketVeo3.1 APISuno API4o Image APIFlux Kontext APIRunway APILuma APIFile Upload API
Common API
  1. File Upload API
  • 文件上传 API 快速开始
  • Base64 文件上传
    POST
  • 文件流上传
    POST
  • URL 文件上传
    POST
Chinese
  • English
  • Chinese
Support
Chinese
  • English
  • Chinese
MarketVeo3.1 APISuno API4o Image APIFlux Kontext APIRunway APILuma APIFile Upload API
Common API
MarketVeo3.1 APISuno API4o Image APIFlux Kontext APIRunway APILuma APIFile Upload API
Common API
  1. File Upload API

Base64 文件上传

POST
/api/file-base64-upload
上传的文件为临时文件,3天后自动删除。

功能特点#

支持 Base64 编码数据和 data URL 格式
自动识别 MIME 类型和文件扩展名
支持自定义文件名或自动生成(相同文件名会覆盖旧文件,可能存在缓存延迟)
返回完整的文件信息和下载链接
API Key 认证保护
上传文件为临时文件,3天后自动删除

支持的格式#

纯 Base64 字符串:iVBORw0KGgoAAAANSUhEUgAA...
Data URL 格式:data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...

使用建议#

推荐用于小文件如图片
大文件(>10MB)建议使用文件流上传 API
Base64 编码会使数据传输量增加约 33%

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢200SuccessResponse
application/json
文件上传成功
Body

🟠400BadRequestError
🟠401UnauthorizedError
🔴500ServerError
Request Request Example
Shell
JavaScript
Java
Swift
cURL
curl --location --request POST 'https://api.kie.ai/api/file-base64-upload' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "base64Data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==",
    "uploadPath": "images/base64",
    "fileName": "test-image.png"
}'
Response Response Example
200 - 成功示例
{"success":true,"code":200,"msg":"文件上传成功","data":{"fileName":"uploaded-image.png","filePath":"images/user-uploads/uploaded-image.png","downloadUrl":"https://tempfile.redpandaai.co/xxx/images/user-uploads/uploaded-image.png","fileSize":154832,"mimeType":"image/png","uploadedAt":"2025-01-01T12:00:00.000Z"}}
Previous
文件上传 API 快速开始
Next
文件流上传
Built with