Create a private direct-upload URL
curl --request POST \
--url https://nsfw-api.net/v1/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"size_bytes": 26214400
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({size_bytes: 26214400})
};
fetch('https://nsfw-api.net/v1/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://nsfw-api.net/v1/uploads"
payload = { "size_bytes": 26214400 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"object": "media",
"status": "pending",
"purpose": "image",
"upload_url": "<string>",
"upload_method": "PUT",
"required_headers": {
"content-type": "<string>"
},
"expires_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}API Reference
Create an upload
Create a private direct-upload URL.
POST
https://nsfw-api.net
/
v1
/
uploads
Create a private direct-upload URL
curl --request POST \
--url https://nsfw-api.net/v1/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"size_bytes": 26214400
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({size_bytes: 26214400})
};
fetch('https://nsfw-api.net/v1/uploads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://nsfw-api.net/v1/uploads"
payload = { "size_bytes": 26214400 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"object": "media",
"status": "pending",
"purpose": "image",
"upload_url": "<string>",
"upload_method": "PUT",
"required_headers": {
"content-type": "<string>"
},
"expires_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
},
"request_id": "<string>"
}Creates a single-use signed PUT URL for private media storage. Complete the upload before using its media ID in a generation request.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Available options:
image, video, audio Available options:
image/jpeg, image/png, image/webp, video/mp4, video/webm, video/quicktime, audio/mpeg, audio/wav, audio/x-wav, audio/mp4, audio/aac, audio/ogg Required range:
1 <= x <= 52428800Response
Default Response
Pattern:
^media_[A-Za-z0-9_-]{20,64}$Available options:
media Available options:
pending Available options:
image, video, audio Available options:
PUT Show child attributes
Show child attributes
Last modified on September 17, 2026