AnacomAI for developers
Vision API
Vision is AnacomAI's own model for finding things in photos. Send a photo and say what you're looking for. You get back where it is: a box around each match, an outline if you ask for one, and any text read on it.
Quickstart
curl https://api.anacomai.com/v1/search \ -H "Authorization: Bearer $ANACOM_API_KEY" \ -F image=@garage.jpg \ -F query="Find the cordless drill"
POST /v1/search
Send a photo and what to find as multipart/form-data. The answer comes back in the same request, usually in a few seconds. Photos are processed in memory, never stored, never used for training, and never sent to anyone else.
| image | JPEG, PNG, WebP or HEIC, up to 25 MB. Required. |
| query | What to find, in plain words, up to 500 characters. Required. |
| outlines | true to also get an outline around each match. Off by default because it's slower. |
Response
{
"request_id": "req_8fK2xQ...",
"model": "engine-1",
"query": "Find the cordless drill",
"image": { "width": 4032, "height": 3024 },
"summary": "Found 1 likely match.",
"matches": [
{
"label": "cordless drill",
"status": "likely_match",
"box": { "x_min": 0.412, "y_min": 0.538, "x_max": 0.597, "y_max": 0.771 },
"outline": null,
"text": null
}
],
"warnings": [],
"usage": {
"plan": "starter",
"searches_this_period": 41,
"included": 2500,
"duration_ms": 2800
},
"duration_ms": 2800
}- box and outline use 0–1 coordinates from the top-left of your photo, after any phone rotation is applied. Multiply by image.width and image.height for pixels.
- status is likely_match or possible_match. Likely matches come first. There is no made-up confidence score.
- matches empty and warnings empty means what you asked for isn't in the photo.
- A question a photo can't answer (“which is cheapest?”) returns no matches and a warning saying why. It never guesses a box.
- outline and text are null when there's nothing to show.
- model says which AnacomAI model answered: engine-1 while Vision rolls out, then vision-1, vision-2 and so on. New models always get new names, so your results never change silently.
Retries and repeats
- Send an Idempotency-Key header (any unique string, up to 255 characters) to retry safely. Retries with the same key get the first answer back and aren't counted again for 24 hours.
- The same photo and query again within 10 minutes is answered from memory, almost instantly. It still counts as a search.
GET /v1/usage
Your plan, the current period, searches_this_period, included, overage_usd and requests_per_minute.
Errors
Errors look like {"error": {"code": "...", "message": "..."}}. Codes don't change. Failed requests are never counted.
| 401 | missing_api_key / invalid_api_key | No key, a wrong key, or a revoked key. |
| 402 | subscription_required / spend_cap_reached | No active monthly plan, or your spending limit for extra searches is reached. |
| 413 | file_too_large | The image is over 25 MB. |
| 415 | invalid_image | The file isn't a JPEG, PNG, WebP or HEIC image. |
| 422 | validation_error / empty_query / idempotency_key_reused | The query is missing, blank or too long, or an Idempotency-Key was reused for a different request. |
| 429 | rate_limited | Too many requests this minute for your plan. Wait the number of seconds in the Retry-After header. |
| 504 | search_timeout | The search took too long. Try a smaller photo. |
Limits
- Requests a minute per key: 30 on Starter, 90 on Pro, 300 on Scale.
- Searches beyond your plan are billed at the end of the month. You can set a spending limit for them under Your account.
- Up to 10 keys per account.
- Keep keys on your server. Don't put them in apps or web pages people can download.
- /v1 only ever gains fields. Nothing in it is renamed or removed.