API reference

Everything you need to call the inference API: authentication, endpoints, payloads, and errors.

Authentication

Send your API key in the Authorization header as a Bearer token. Keys are environment-scoped: vs_live_… keys hit production, vs_test_… keys hit development and staging. Create and rotate keys on the API keys page.

Quickstart
Run detection on an image in one request
bash
curl -X POST https://api.visionserve.dev/v1/detect \
  -H "Authorization: Bearer vs_live_…" \
  -H "Content-Type: multipart/form-data" \
  -F "image=@street.jpg" \
  -F "confidence_threshold=0.25"
Endpoints
Base URL: https://api.visionserve.dev
MethodPathDescriptionRequired scope
POST/v1/detectRun object detection on an imageinference:run
POST/v1/ocrExtract text from an imageinference:run
POST/v1/classifyClassify an image into labelsinference:run
POST/v1/jobsSubmit an asynchronous inference jobjobs:write
GET/v1/jobs/{id}Poll job status and progressjobs:read
POST/v1/batchesSubmit a batch of files for processingbatches:write
GET/v1/batches/{id}Poll batch progressjobs:read
GET/v1/results/{id}Fetch a stored inference resultresults:read
GET/v1/modelsList registered modelsmodels:read
GET/v1/healthLiveness and component status—
Error codes
All errors return a JSON body with code, message, and request_id
CodeHTTPDescription
INVALID_IMAGE400The request body could not be decoded as a supported image.
UNSUPPORTED_IMAGE_FORMAT415Format not in the workspace allowlist (JPEG, PNG, WebP, TIFF, HEIC).
IMAGE_TOO_LARGE413Upload exceeds the configured maximum file size.
PIXEL_LIMIT_EXCEEDED413Decoded pixel count exceeds the decompression guard.
MODEL_NOT_FOUND404No model with this ID exists in the registry.
MODEL_UNAVAILABLE503Model failed health checks or is not loaded in this environment.
MODEL_LOAD_FAILED500The runtime session could not be created from the artifact.
INFERENCE_TIMEOUT504Inference exceeded the configured job timeout.
QUEUE_FULL429The job queue is at capacity; retry with backoff.
RATE_LIMITED429The API key exceeded its per-minute rate limit.
AUTHENTICATION_REQUIRED401Missing or invalid API key.
PERMISSION_DENIED403The key lacks the required scope for this operation.
STORAGE_ERROR500Object storage read or write failed.
INTERNAL_ERROR500Unexpected server error; contact support with the request ID.