azure-vision-analyze

Analyze an image for captions, tags, objects, and readable text.

API IDazure-vision-analyze
View setup
View usage

Overview

Input
An image and selected analysis features.
Output
Structured results for the features that were executed.
Providers
Azure AI Services
Latest operational check
Healthy
API compatibility
  • Primex Vision Analysis API
Recommended for
  • Image understanding
  • Visual metadata extraction
Supported features
  • Captions
  • Tags
  • Objects
  • OCR

Make your first request

View full setup
# Requires curl and jq.
set -euo pipefail

API_KEY="YOUR_API_KEY"
GATEWAY='https://gateway.primexos.com'
FILE_PATH='image.png'
CONTENT_TYPE='image/png'
BYTE_SIZE=$(wc -c < "$FILE_PATH" | tr -d '[:space:]')

AUTHORIZATION=$(curl --fail-with-body -sS "$GATEWAY/v1/primex/files/upload-authorizations" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"purpose\":\"VISION_INPUT\",\"content_type\":\"$CONTENT_TYPE\",\"byte_size\":$BYTE_SIZE}")

UPLOAD_URL=$(printf '%s' "$AUTHORIZATION" | jq -r '.upload_url')
UPLOAD_METHOD=$(printf '%s' "$AUTHORIZATION" | jq -r '.method')
BLOB_TYPE=$(printf '%s' "$AUTHORIZATION" | jq -r '.headers["x-ms-blob-type"]')
UPLOAD_CONTENT_TYPE=$(printf '%s' "$AUTHORIZATION" | jq -r '.headers["Content-Type"]')
FILE_ID=$(printf '%s' "$AUTHORIZATION" | jq -r '.file_id')

curl --fail-with-body -sS -X "$UPLOAD_METHOD" "$UPLOAD_URL" \
  -H "x-ms-blob-type: $BLOB_TYPE" \
  -H "Content-Type: $UPLOAD_CONTENT_TYPE" \
  --data-binary "@$FILE_PATH"

FINALIZED=$(curl --fail-with-body -sS -X POST "$GATEWAY/v1/primex/files/$FILE_ID/finalize" \
  -H "Authorization: Bearer $API_KEY")
FILE_ID=$(printf '%s' "$FINALIZED" | jq -r '.file_id')

SERVICE_PAYLOAD='{"model":"azure-vision-analyze","file_id":"__PRIMEX_PRODUCTION_FILE_ID__","features":["read"]}'
SERVICE_PAYLOAD=$(printf '%s' "$SERVICE_PAYLOAD" | jq --arg file_id "$FILE_ID"   'walk(if type == "object" and .file_id? == "__PRIMEX_PRODUCTION_FILE_ID__" then .file_id = $file_id else . end)')

curl --fail-with-body "$GATEWAY/v1/vision/analyze" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d "$SERVICE_PAYLOAD"

Executing this request uses your account’s API credits.

Sample input → output

Inputphoto.jpg + selected features
Output preview
caption
Generated image caption
tags
Detected visual tags
text
Readable text when requested

Simplified preview based on the published service response contract.

Input requirements

Supported formats
JPEGPNGGIFBMP