简体中文
cURL
with_data_url
curl --request POST \ --url https://kieai.redpandaai.co/api/file-base64-upload \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "base64Data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==", "uploadPath": "images/base64", "fileName": "test-image.png"}'
200
example
{ "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" }}
iVBORw0KGgoAAAANSUhEUgAA...
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...
所有接口都需要通过 Bearer Token 方式进行认证。
获取 API Key:
使用方式: 在请求头中添加: Authorization: Bearer YOUR_API_KEY
文件上传成功
The response is of type object.
object