Perform AI-powered media analysis using advanced language models. Costs 10 tokens (free for admins).
Parameters
model_path
string (optional)
AI model to use (default: "Qwen/Qwen2.5-VL-7B-Instruct")
prompt
string (optional)
Analysis prompt (default: "Describe this image.")
file
file upload (required*)
Media file to upload and analyze
file_path
string (admin only)
Path to existing media file on server (admin users only)
interval
integer (optional)
Frame sampling interval for videos (default: 10)
upload_id
string (optional)
Unique identifier for chunked uploads
chunk_number
integer (optional)
Current chunk number (0-based) for chunked uploads
total_chunks
integer (optional)
Total number of chunks for chunked uploads
filename
string (optional)
Original filename for chunked uploads
Note: Either file upload or file_path (admin only) must be provided. Chunked uploads are supported for large files.
Curl Examples
File Upload:
curl -X POST -H "Authorization: Bearer YOUR_API_TOKEN" \
-F "model_path=Qwen/Qwen2.5-VL-7B-Instruct" \
-F "prompt=Describe this video" \
-F "interval=30" \
-F "file=@/path/to/video.mp4" \
{{ request.host_url }}api/analyze
File Path (Admin Only):
curl -X POST -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
-F "model_path=Qwen/Qwen2.5-VL-7B-Instruct" \
-F "prompt=Describe this video" \
-F "file_path=/server/path/to/video.mp4" \
-F "interval=30" \
{{ request.host_url }}api/analyze
Chunked Upload:
# Upload file in chunks (useful for large files)
# First chunk
curl -X POST -H "Authorization: Bearer YOUR_API_TOKEN" \
-F "upload_id=my_upload_123" \
-F "chunk_number=0" \
-F "total_chunks=3" \
-F "filename=large_video.mp4" \
-F "file=@chunk_0.mp4" \
{{ request.host_url }}api/analyze
# Second chunk
curl -X POST -H "Authorization: Bearer YOUR_API_TOKEN" \
-F "upload_id=my_upload_123" \
-F "chunk_number=1" \
-F "total_chunks=3" \
-F "filename=large_video.mp4" \
-F "file=@chunk_1.mp4" \
{{ request.host_url }}api/analyze
# Final chunk (triggers analysis)
curl -X POST -H "Authorization: Bearer YOUR_API_TOKEN" \
-F "upload_id=my_upload_123" \
-F "chunk_number=2" \
-F "total_chunks=3" \
-F "filename=large_video.mp4" \
-F "model_path=Qwen/Qwen2.5-VL-7B-Instruct" \
-F "prompt=Describe this video" \
-F "file=@chunk_2.mp4" \
{{ request.host_url }}api/analyze
Response
{
"result": "Analysis result here...",
"tokens_used": 10,
"remaining_tokens": 90
}