API Reference
The VisionAI REST API gives you access to all computer vision capabilities. Base URL: https://api.visionai.dev/v2
REST API
JSON Responses
Bearer Auth
TLS 1.3
Authentication
All API requests require a Bearer token in the Authorization header. Get your API key from the dashboard.
curl https://api.visionai.dev/v2/detect \
-H "Authorization: Bearer vai_sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{"image_url": "https://example.com/photo.jpg"}'
POST
/v2/detect
Detect and locate objects within an image. Returns bounding boxes, labels, and confidence scores.
Request Body
image_urlstring, requiredmodelstring, optionalconfidence_thresholdfloat, default: 0.5max_objectsinteger, default: 100Response
{
"objects": [
{
"label": "person",
"confidence": 0.97,
"bbox": [120, 80, 340, 520]
}
],
"processing_time_ms": 42
}
POST
/v2/classify
Classify an image into categories. Returns top-N predictions with confidence scores.
Request Body
image_urlstring, requiredtop_ninteger, default: 5taxonomystring, default: "imagenet"Response
{
"predictions": [
{"label": "golden retriever", "confidence": 0.94},
{"label": "labrador", "confidence": 0.03}
],
"processing_time_ms": 28
}
POST
/v2/ocr
Extract text from images. Supports handwriting, printed text, and documents in 60+ languages.
Request Body
image_urlstring, requiredlanguagesarray, optionaloutput_format"text" | "structured"Response
{
"text": "Invoice #12345\nTotal: $1,250.00",
"blocks": [
{"text": "Invoice #12345", "confidence": 0.99,
"bbox": [10, 20, 300, 60]}
],
"processing_time_ms": 65
}
POST
/v2/faces
Detect faces, estimate age, gender, and emotion. Optionally match against enrolled face collections.
Request Body
image_urlstring, requiredattributesarray, optionalcollection_idstring, optionalResponse
{
"faces": [
{"bbox": [100, 50, 250, 300],
"confidence": 0.99,
"attributes": {
"age_range": [25, 35],
"emotion": "happy"
}}
],
"processing_time_ms": 55
}
GET
/v2/status
Check API health and your account usage.
{
"status": "operational",
"latency_ms": 12,
"usage": {"calls_used": 8432, "calls_limit": 50000, "period": "2024-12"}
}
Official SDKs
Get started faster with our language-specific SDKs.