English

Files API

Upload private reference files and use their IDs in media requests.

Files API

Upload a PNG

curl "https://api.apimodel.store/v1/files" \
  -H "Authorization: Bearer $MODELPORT_API_KEY" \
  -H "Content-Type: image/png" \
  --data-binary @reference.png

Read file metadata

curl "https://api.apimodel.store/v1/files/$MODELPORT_FILE_ID" \
  -H "Authorization: Bearer $MODELPORT_API_KEY"

Use the returned ID in references[].file_id and specify the role. Image limits are 10 MB per file, video limits are 100 MB, and audio limits are 20 MB. Individual model limits can be lower. To plan an upload, send JSON with filename, contentType, and optional fileSize. PUT the original bytes to data.uploadUrl within ten minutes with the same content type.

For supported models, pass data.publicUrl as image_url, an entry in image images[], video_url, or audio_url. The file owner can download it with authentication or reference it until the file expires.