Skip to main content

Media tagging

Analyze a publicly reachable image with a vision model and return a structured set of tags. The model fetches the URL directly; the image is never stored.

POST /api/v1/companion/media-tag
  • Auth: Bearer key with the chat:companion scope.

Request body

FieldTypeRequiredNotes
image_urlstringA public https URL, 1–2000 chars. Private or internal addresses are rejected.
modelstring-Override the vision model (1–200 chars).
debugboolean-Default false. Returns { model, system_prompt, raw_output, timings_ms } alongside the tags.

Example

curl -X POST https://api.phantomrouter.ai/api/v1/companion/media-tag \
-H "Authorization: Bearer $PHANTOM_KEY" \
-H "Content-Type: application/json" \
-d '{ "image_url": "https://example.com/photo.jpg" }'

Response

{
"result": {
"title": "Woman smiling on a beach at sunset",
"clothing": "summer dress",
"nudity_level": "fully_clothed",
"focus": "full_body",
"setting": "outdoors",
"mood": "playful",
"time_of_day": "day",
"additional_details": "golden-hour lighting, ocean in the background"
}
}

result fields

FieldTypeValues
titlestringA short caption.
clothingstringFree-text description of attire.
nudity_levelenumfully_clothed · lingerie · topless · bottomless · fully_nude
focusenumcleavage · breasts · ass · intimate_area · covered_with_hands · full_body · other
settingenumbedroom · bathroom · living_room · kitchen · outdoors · other
moodenuminnocent · playful · horny · dominant · submissive · romantic · confident · shy · other
time_of_dayenumday · night
additional_detailsstringAny other notable details.

The vision model actually used (which may differ from a requested model on fallback) is reported as debug.model, returned only when you set debug: true.

Errors

StatusCodeWhen
400INVALID_REQUESTBody failed validation, or the URL is non-https / not publicly reachable.
402PAYMENT_REQUIREDInsufficient credit balance.
403FORBIDDENKey lacks chat:companion.
503SERVICE_UNAVAILABLEThe vision model failed or returned an unparseable result. Retry with backoff.