DEVUP Docs
Back to Dashboard
Multimodal Input

Vision & OCR

Send images to supported multimodal chat models for visual understanding, document analysis, and text extraction.

DEVUP AI exposes multimodal capabilities through the standard OpenAI Chat Completions API format. Vision support and OCR quality vary strictly by the selected model. Check the live model catalog to identify models that accept image inputs.

Capabilities

Visual Understanding

Describe scenes, analyze charts, and answer questions about uploaded images. Suitable for generalized visual reasoning workflows.

Accuracy relies heavily on the model's spatial reasoning limits.

OCR & Document Extraction

Extract raw text from scanned documents, receipts, invoices, and screenshots using structured prompts.

Handwriting, tables, and low-res scans may require app-side validation.

Input methods

The API accepts images via the content array of a user message. You can provide images as either public URLs or Base64 data strings.

Public Image URL

Pass a standard HTTPS link. The URL must be publicly accessible and directly fetchable by our infrastructure.

Base64 Data URL

Encode the image locally as data:<mime>;base64,.... Increases payload size but guarantees delivery without public hosting.

Sending an Image URL

Illustrative example using a public image URL.

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["DEVUP_API_KEY"],
    base_url="https://api.devupai.com/v1",
)

response = client.chat.completions.create(
    model="Qwen/Qwen3-VL-235B-A22B-Instruct",
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "https://example.com/sample-image.jpg"
                    }
                },
                {
                    "type": "text",
                    "text": "Describe this image in detail."
                }
            ]
        }
    ]
)

print(response.choices[0].message.content)

Sending a Base64 string

Local paths cannot be fetched by the API. If your image is not publicly hosted, read it as Base64 and use a data URL.

import os
import base64
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["DEVUP_API_KEY"],
    base_url="https://api.devupai.com/v1",
)

# Read local image and encode
with open("document.png", "rb") as image_file:
    base64_image = base64.b64encode(image_file.read()).decode("utf-8")

response = client.chat.completions.create(
    model="Qwen/Qwen3-VL-235B-A22B-Instruct",
    messages=[
        {
            "role": "user",
            "content": [
                {
                    "type": "image_url",
                    "image_url": {
                        # Ensure the MIME type matches the file
                        "url": f"data:image/png;base64,{base64_image}"
                    }
                },
                {
                    "type": "text",
                    "text": "Extract all text from this document."
                }
            ]
        }
    ]
)

print(response.choices[0].message.content)

OCR Workflow

We treat OCR as an advanced prompting pattern atop multimodal models. Because extraction quality varies natively by image complexity, we recommend a robust validation loop.

1. Image Input
2. Multimodal Request
3. Extracted Text
4. Application Validation

Suggested OCR prompts:

  • Extract all visible text.
  • Preserve document structure where possible.
  • Convert the visible table into Markdown.

Multiple images

Appending multiple inputs

If supported by the underlying model, you can include multiple image_url objects in the same message. Be aware that each additional image increases the payload size and potential processing cost. Always provide clear text instructions regarding the order of the images.

Pricing & Tokens

Vision requests are billed according to the selected model and workload. If the upstream provider generates input tokens for images, those values will be reflected in the usage.prompt_tokens field of the API response. Review the live model pricing before sending production traffic.

Limitations

  • Supported formats typically include JPG, PNG, and WebP.
  • Base64 encoding increases payload size; do not log these requests.
  • The detail parameter for specific image resolution scaling is not universally supported.

What's next