API Referansı
Bir Dosya Yüklemesi Oluştur
Tek bir yerel dosyayı, uzak HTTPS URL'sini veya base64 kaynağını yükleyin ve geçici bir URL alın.
Tek bir yerel dosyayı, uzak HTTPS URL’sini veya base64 kaynağını yükleyin ve geçici bir URL alın.
Uç Nokta
- Temel URL
https://runapi.ai- API sürümü
v1- Kimlik doğrulama
Authorization: Bearer YOUR_API_KEY
02
JSON gövdesiİstek
Değerleri yalnızca listelenen istek konumunda gönderin.
application/json - Base64 source4 alan
file_namestring
İsteğe bağlı
Oluşturulan Dosya Yüklemesi için isteğe bağlı dosya adı.
sourceobject
Zorunlu
Base64 kodlu kaynak baytları.
source.datastring
Zorunlu
Base64 verisi
source.typestring
Zorunlu
base64 kaynak gösterimini seçer.
application/json - URL source4 alan
file_namestring
İsteğe bağlı
Oluşturulan Dosya Yüklemesi için isteğe bağlı dosya adı.
sourceobject
Zorunlu
İndirilecek uzak HTTPS kaynağı.
source.typestring
Zorunlu
URL kaynak gösterimini seçer.
source.urlstring
Zorunlu
İndirilecek genel HTTPS URL'si.
multipart/form-data2 alan
filestring
Zorunlu
Yüklenecek yerel dosya baytları.
file_namestring
İsteğe bağlı
Oluşturulan Dosya Yüklemesi için isteğe bağlı dosya adı.
03
HTTP 201Başarılı yanıt
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 401Hata yanıtı (401)
Yanıt şeması
JSON
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir hata mesajı.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Yanıt örneği
JSON
{
"error": "Authentication required"
}
05
HTTP 403Hata yanıtı (403)
Yanıt şeması
JSON
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir hata mesajı.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Yanıt örneği
JSON
{
"error": "Standard API key required"
}
06
HTTP 400Hata yanıtı (400)
Yanıt şeması
JSON
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir hata mesajı.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Yanıt örneği
JSON
{
"error": "Only HTTPS URLs are allowed"
}
07
HTTP 408Hata yanıtı (408)
Yanıt şeması
JSON
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir hata mesajı.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Yanıt örneği
JSON
{
"error": "Download timeout"
}
08
HTTP 413Hata yanıtı (413)
Yanıt şeması
JSON
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir hata mesajı.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Yanıt örneği
JSON
{
"error": "File size exceeds the maximum allowed size"
}
09
HTTP 415Hata yanıtı (415)
Yanıt şeması
JSON
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir hata mesajı.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Yanıt örneği
JSON
{
"error": "This content type is not supported"
}
10
HTTP 422Hata yanıtı (422)
Yanıt şeması
JSON
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir hata mesajı.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Yanıt örneği
JSON
{
"error": "File upload failed. Please try again."
}
11
HTTP 429Hata yanıtı (429)
Yanıt şeması
JSON
{
"properties": {
"error": {
"description": "İnsan tarafından okunabilir hata mesajı.",
"type": "string"
}
},
"required": [
"error"
],
"type": "object",
"unevaluatedProperties": false
}
Yanıt örneği
JSON
{
"error": "Too many file uploads for this account. Please retry later."
}
12
cURL örneği
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"}'