Image Recognition
Authorizations
AuthorizationstringRequired
Bearer token obtained from POST /v2/token-cache/unified/oauth/token/{YourAPIKey}
Body
imagestringRequired
Base64 encoded image as a data URI. Expected format: 'data:;base64,'. For example: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABA...'. You can generate this from an image file using ImageMagick or similar tools: base64_data=$(base64 <image.jpg) && echo "data:image/jpeg;base64,${base64_data}". Supported formats: JPEG, PNG, WebP, and GIF.
messageobjectOptional
Optional context message or metadata about the image to improve analysis (e.g., {"context": "lunch meal", "dietary_preference": "vegetarian"}).
Responses
200
Successful response
application/json
400
Bad Request - Invalid input.
application/json
500
Internal Server Error.
application/json
post
/napi/tools/vision/extractIngredientsAutoTypedExample: Sending an image via JSON (recommended)
Example: Sending an image via multipart form-data
Understanding the Response
Last updated