Images & Vision
Images & Vision
Images & Vision
Mesh API uses POST /v1/chat/completions for image input and image generation.
Use this guide for two common workflows:
Call GET /v1/models and inspect:
input_modalities for image input supportoutput_modalities for image output supportYou can send images to multimodal models (like GPT-4o or Claude 3.5 Sonnet) by passing an array of content parts in the message.
Mesh API supports two ways to provide images:
data:image/jpeg;base64,... URLs.https://... URLs.[!WARNING] Not all models support passing images via public URL. Some models (especially from certain providers) require images to be base64 encoded. Check the provider documentation or use base64 encoding to ensure maximum compatibility.
Here is an example request sending an image via URL:
To send a base64 encoded image, replace the url value with the data URL:
"url": "data:image/jpeg;base64,iVBORw0KGgo..."
Use the same chat completions endpoint with image-generation-capable models.
The exact assistant payload may vary by model. Build against the documented response fields for the model you choose and the media format you request.
detail: "low" for lower-cost image understanding when supported.data: URLs for image input.client.chat.completions.create(...)client.chat.completions.create(...)client.Chat.Completions.Create(...)client.chat().completions().create(...)