Capabilities
Images
Send images with your text in the OpenAI content-part format.
Put an image_url part in a user message's content array, next to a text part. The URL can be a base64 data: URL or an https URL.
import base64
import os
from openai import OpenAI
client = OpenAI(
base_url="https://lyber-paid-acceptance-gateway-production.up.railway.app/v1",
api_key=os.environ["LYBER_API_KEY"],
)
with open("photo.jpg", "rb") as file:
image = base64.b64encode(file.read()).decode()
response = client.chat.completions.create(
model="minimax-m3.1-flash-abliterated",
messages=[{
"role": "user",
"content": [
{"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{image}"}},
{"type": "text", "text": "What is in this image?"},
],
}],
max_tokens=1024,
)
print(response.choices[0].message.content)Limits
| Limit | Value |
|---|---|
| Messages and tools, as JSON | 8 MiB, base64 images included (400 context_length_exceeded) |
| Whole request body | 16 MiB (413) |
| Time to upload the body | 15 seconds (408 request_timeout) |
detail | auto, low, high or original |
Base64 adds about a third to an image's size, so 8 MiB holds roughly 6 MiB of image files. Resize large photos before sending; a long edge of 2048 pixels is plenty for most questions.
The Responses API accepts input_image parts with an image_url; file_id references are not supported.