Complete File Upload
curl --request POST \
--url https://api.modelhunter.ai/api/v1/files/{file_id}/complete \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.modelhunter.ai/api/v1/files/{file_id}/complete"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.modelhunter.ai/api/v1/files/{file_id}/complete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.modelhunter.ai/api/v1/files/{file_id}/complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.modelhunter.ai/api/v1/files/{file_id}/complete"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.modelhunter.ai/api/v1/files/{file_id}/complete")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.modelhunter.ai/api/v1/files/{file_id}/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "file_abc123",
"url": "https://cdn.modelhunter.ai/files/file_abc123.jpg",
"filename": "my-image.jpg",
"content_type": "image/jpeg",
"size_bytes": 2048576,
"created_at": "2025-01-15T10:05:00Z"
}
}
{
"success": false,
"error": {
"code": "FILE_NOT_FOUND",
"message": "File not found or upload URL has expired"
}
}
Files
Complete File Upload
Confirm that a file upload is complete and get the CDN URL.
POST
/
api
/
v1
/
files
/
{file_id}
/
complete
Complete File Upload
curl --request POST \
--url https://api.modelhunter.ai/api/v1/files/{file_id}/complete \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.modelhunter.ai/api/v1/files/{file_id}/complete"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.modelhunter.ai/api/v1/files/{file_id}/complete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.modelhunter.ai/api/v1/files/{file_id}/complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.modelhunter.ai/api/v1/files/{file_id}/complete"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.modelhunter.ai/api/v1/files/{file_id}/complete")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.modelhunter.ai/api/v1/files/{file_id}/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "file_abc123",
"url": "https://cdn.modelhunter.ai/files/file_abc123.jpg",
"filename": "my-image.jpg",
"content_type": "image/jpeg",
"size_bytes": 2048576,
"created_at": "2025-01-15T10:05:00Z"
}
}
{
"success": false,
"error": {
"code": "FILE_NOT_FOUND",
"message": "File not found or upload URL has expired"
}
}
Path Parameters
string
required
File ID from the Get Upload URL response.
Response Fields
boolean
Whether the request was successful.
object
Uploaded file details.
Show data properties
Show data properties
{
"success": true,
"data": {
"id": "file_abc123",
"url": "https://cdn.modelhunter.ai/files/file_abc123.jpg",
"filename": "my-image.jpg",
"content_type": "image/jpeg",
"size_bytes": 2048576,
"created_at": "2025-01-15T10:05:00Z"
}
}
{
"success": false,
"error": {
"code": "FILE_NOT_FOUND",
"message": "File not found or upload URL has expired"
}
}
⌘I