Image Understanding
Use MiMo-V2-Omni for image understanding and analysis.
MiMo-V2-Omni supports image understanding, allowing you to send images for analysis, description, and visual question answering. Images can be provided via URL or base64-encoded data.
Using Image URL
from openai import OpenAI
client = OpenAI(
api_key="your_mimo_api_key",
base_url="https://api.mimo-v2.com/v1"
)
completion = client.chat.completions.create(
model="mimo-v2-omni",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "What is in this image?"},
{"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}}
]
}
]
)
print(completion.choices[0].message.content)Using Base64 Encoded Image
from openai import OpenAI
import base64
client = OpenAI(
api_key="your_mimo_api_key",
base_url="https://api.mimo-v2.com/v1"
)
with open("image.jpg", "rb") as f:
image_data = base64.b64encode(f.read()).decode()
completion = client.chat.completions.create(
model="mimo-v2-omni",
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Describe this image"},
{"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{image_data}"}}
]
}
]
)
print(completion.choices[0].message.content)Supported Formats
| Format | MIME Type |
|---|---|
| JPEG | image/jpeg |
| PNG | image/png |
| GIF | image/gif |
| WebP | image/webp |
Image tokens are counted based on the image resolution. Larger images consume more tokens. Consider resizing images if token usage is a concern.
MiMo API Docs