Get Upload URL
curl --request POST \
--url https://api.modelhunter.ai/api/v1/files/upload-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "<string>",
"contentType": "<string>",
"sizeBytes": 123
}
'import requests
url = "https://api.modelhunter.ai/api/v1/files/upload-url"
payload = {
"filename": "<string>",
"contentType": "<string>",
"sizeBytes": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({filename: '<string>', contentType: '<string>', sizeBytes: 123})
};
fetch('https://api.modelhunter.ai/api/v1/files/upload-url', 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/upload-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filename' => '<string>',
'contentType' => '<string>',
'sizeBytes' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.modelhunter.ai/api/v1/files/upload-url"
payload := strings.NewReader("{\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"sizeBytes\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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/upload-url")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"sizeBytes\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.modelhunter.ai/api/v1/files/upload-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"sizeBytes\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"upload_url": "https://storage.modelhunter.ai/uploads/file_abc123?X-Amz-Signature=...",
"file_id": "file_abc123",
"expires_at": "2025-01-15T11:00:00Z"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid contentType: must be a supported MIME type"
}
}
{
"success": false,
"error": {
"code": "FILE_TOO_LARGE",
"message": "File size exceeds the 100 MB limit"
}
}
Files
Get Upload URL
Get a signed URL for uploading a file.
POST
/
api
/
v1
/
files
/
upload-url
Get Upload URL
curl --request POST \
--url https://api.modelhunter.ai/api/v1/files/upload-url \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filename": "<string>",
"contentType": "<string>",
"sizeBytes": 123
}
'import requests
url = "https://api.modelhunter.ai/api/v1/files/upload-url"
payload = {
"filename": "<string>",
"contentType": "<string>",
"sizeBytes": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({filename: '<string>', contentType: '<string>', sizeBytes: 123})
};
fetch('https://api.modelhunter.ai/api/v1/files/upload-url', 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/upload-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filename' => '<string>',
'contentType' => '<string>',
'sizeBytes' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.modelhunter.ai/api/v1/files/upload-url"
payload := strings.NewReader("{\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"sizeBytes\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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/upload-url")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"sizeBytes\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.modelhunter.ai/api/v1/files/upload-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filename\": \"<string>\",\n \"contentType\": \"<string>\",\n \"sizeBytes\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"upload_url": "https://storage.modelhunter.ai/uploads/file_abc123?X-Amz-Signature=...",
"file_id": "file_abc123",
"expires_at": "2025-01-15T11:00:00Z"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid contentType: must be a supported MIME type"
}
}
{
"success": false,
"error": {
"code": "FILE_TOO_LARGE",
"message": "File size exceeds the 100 MB limit"
}
}
Body Parameters
string
required
Original filename (e.g.
my-image.jpg).string
required
MIME type of the file (e.g.
image/jpeg, video/mp4, audio/mpeg).number
required
File size in bytes. Max 100 MB.
Response Fields
boolean
Whether the request was successful.
object
Upload URL details.
Show data properties
Show data properties
string
Pre-signed URL for uploading the file via HTTP PUT. Valid for 15 minutes.
string
Unique file identifier. Use this to call Complete Upload after uploading.
string
ISO 8601 timestamp when the upload URL expires.
{
"success": true,
"data": {
"upload_url": "https://storage.modelhunter.ai/uploads/file_abc123?X-Amz-Signature=...",
"file_id": "file_abc123",
"expires_at": "2025-01-15T11:00:00Z"
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid contentType: must be a supported MIME type"
}
}
{
"success": false,
"error": {
"code": "FILE_TOO_LARGE",
"message": "File size exceeds the 100 MB limit"
}
}
⌘I