API Reference
Create a File Upload
Upload one local file, remote HTTPS URL, or base64 source and receive a temporary URL.
Upload one local file, remote HTTPS URL, or base64 source and receive a temporary URL.
Endpoint
- Base URL
https://runapi.ai- API version
v1- Authentication
Authorization: Bearer YOUR_API_KEY
02
JSON bodyRequest
Send values only in the listed request location.
application/json - Base64 source4 fields
file_namestring
Optional
Optional filename for the created File Upload.
sourceobject
Required
Base64-encoded source bytes.
source.datastring
Required
Base64 data
source.typestring
Required
Selects the base64 source representation.
application/json - URL source4 fields
file_namestring
Optional
Optional filename for the created File Upload.
sourceobject
Required
Remote HTTPS source to download.
source.typestring
Required
Selects the URL source representation.
source.urlstring
Required
Public HTTPS URL to download.
multipart/form-data2 fields
filestring
Required
Local file bytes to upload.
file_namestring
Optional
Optional filename for the created File Upload.
03
HTTP 201Success response
POST /api/v1/files
JSON
{
"created_at": "2026-07-27T10:00:00.000Z",
"expires_at": "2026-07-27T11:00:00.000Z",
"file_name": "mask.png",
"mime_type": "image/png",
"size_bytes": 204800,
"url": "https://file.runapi.ai/temp/user-uploads/mask.png"
}
04
HTTP 401Error response (401)
JSON
{
"error": {
"code": "authentication_required",
"message": "Authentication required"
}
}
05
HTTP 403Error response (403)
JSON
{
"error": {
"code": "standard_api_key_required",
"message": "Standard API key required"
}
}
06
HTTP 400Error response (400)
JSON
{
"error": {
"code": "invalid_source",
"message": "Only HTTPS URLs are allowed"
}
}
07
HTTP 408Error response (408)
JSON
{
"error": {
"code": "invalid_source",
"message": "Download timeout"
}
}
08
HTTP 413Error response (413)
JSON
{
"error": {
"code": "file_too_large",
"message": "File size exceeds the maximum allowed size"
}
}
09
HTTP 415Error response (415)
JSON
{
"error": {
"code": "unsupported_media_type",
"message": "This content type is not supported"
}
}
10
HTTP 422Error response (422)
JSON
{
"error": {
"code": "upload_failed",
"message": "File upload failed. Please try again."
}
}
11
HTTP 429Error response (429)
JSON
{
"error": {
"code": "rate_limited",
"message": "Too many file uploads for this account. Please retry later."
}
}
12
cURL example
CURL
curl -X POST https://runapi.ai/api/v1/files \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"source":{"type":"url","url":"https://cdn.runapi.ai/public/samples/mask.png"},"file_name":"mask.png"}'