myt AI Cloud

By Mauritius Telecom

Beta
⌘K
Core features

OCR and image recognition

Pass images to vision-capable models for recognition, OCR, and visual reasoning.

POST

/v1/chat/completions

Vision-capable models accept image inputs alongside text in the messages array using OpenAI content-parts format.

Request body

Use the standard chat completions body with content as an array of content parts instead of a plain string.

Part typeFieldsNotes
texttype, textInstruction or question about the image.
image_urltype, image_url.urlPublic HTTPS URL or a base64 data URL (data:image/png;base64,...).

Example request — URL image

{
"model": "myt/qwen3.6-35b-a3b",
"messages": [
  {
    "role": "user",
    "content": [
      { "type": "text",      "text": "Extract all text visible in this image." },
      { "type": "image_url", "image_url": { "url": "https://example.com/invoice.png" } }
    ]
  }
],
"max_tokens": 512
}

Example request — base64 image

{
"model": "myt/qwen3.6-35b-a3b",
"messages": [
  {
    "role": "user",
    "content": [
      { "type": "text",      "text": "What does this chart show?" },
      { "type": "image_url", "image_url": { "url": "data:image/png;base64,iVBORw0KGgo..." } }
    ]
  }
]
}

Response

Same shape as a standard chat completion response.

{
"id": "chatcmpl-xyz789",
"object": "chat.completion",
"created": 1749366600,
"model": "myt/qwen3.6-35b-a3b",
"choices": [
  {
    "index": 0,
    "finish_reason": "stop",
    "message": {
      "role": "assistant",
      "content": "The image shows an invoice dated 2026-05-01 for $250.00 addressed to Acme Corp."
    }
  }
],
"usage": {
  "prompt_tokens": 892,
  "completion_tokens": 28,
  "total_tokens": 920
}
}

Errors

StatusWhen
400Image URL unreachable, invalid base64, or model does not support vision
401API key missing or invalid
429Rate limit or budget exceeded

Code examples

curl -sS --request "POST" \
  --url "$MYT_BASE_URL/chat/completions" \
  --header "Authorization: Bearer $MYT_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"model":"myt/qwen3.6-35b-a3b","messages":[{"role":"user","content":[{"type":"text","text":"Describe this image."},{"type":"image_url","image_url":{"url":"https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Cat03.jpg/320px-Cat03.jpg"}}]}]}'

Full parameter reference: Chat completions.

On this page