On this page
Sommatic Docs
Open portal

OpenAI - GPT-4o Vision

Invoke OpenAI GPT-4o (Omni) via the Chat Completions API for image understanding, vision-based OCR, and visual reasoning over diagrams and charts.

View as Markdown
Open in
Integrations Available integrations.openai.gpt-4o.vision Version 1.0.0 Execution: async

Sends one image and a prompt to a vision-capable LLM provider registered in Sommatic AI and returns the model's text. The call goes through the Sommatic AI backend, which resolves the provider and its secret.

Routes through the backend POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke endpoint using an llm_provider_id registered in the cognitive-assets registry. Billing is handled directly by OpenAI or Azure OpenAI against your subscription. Compatible with any GPT-4 class model that exposes the vision capability (GPT-4o, GPT-4o mini, GPT-4 Turbo with vision).

Operations:

  • Image captioning: Natural-language descriptions of photographs, screenshots, and product imagery.
  • Chart and diagram interpretation: Structured extraction of data series, labels, and relationships from bar charts, line charts, flow diagrams, and images containing tables.
  • Vision-based OCR: Reads text in layouts that defeat classical OCR — low contrast, unusual typography, handwriting, skewed scans, stylized signage.
  • Scene understanding: Identifies objects, activities, and contextual cues to support moderation, tagging, and routing workflows.

Inputs: base64-encoded image or a public image URL. Controls: system prompt, user prompt (expression-enabled), temperature, and max tokens exposed as node configuration so the same node can run deterministic OCR-style calls or creative captioning.

How it works

  1. Resolves the node config and requires llm_provider_id.
  2. Takes the image from content_base64 (with content_type, default image/png) or from image_url, reading each key from the config first and then from the incoming item. Base64 content is sent as a data: URL.
  3. Builds a chat request with system_prompt, a user message containing prompt and the image, max_tokens (default 1024) and temperature (default 0.2).
  4. Calls the backend LLM provider invocation endpoint with a timeout of execution.timeout_ms (default 120000).
  5. Trims the returned text and builds { text, chars, empty, method: "llm.vision", metadata: { llm_provider_id, usage } }; empty text goes to empty, otherwise extracted.

In a workflow

The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.

{
  "node_id": "node-read-receipt",
  "label": "Read receipt image",
  "operator_slug": "integrations.openai.gpt-4o.vision",
  "operator_version": "1.0.0",
  "config": {
    "llm_provider_id": "<llm_provider_id>",
    "prompt": "Extract the store name, total and date from this receipt.",
    "max_tokens": 512,
    "temperature": 0
  }
}

Configuration

llm_provider_id string Required

Select a vision-capable LlmProvider from the cognitive-assets registry (e.g. an Azure OpenAI GPT-4o deployment).

prompt string Optional Accepts expressions

Default: Describe the content of this image as accurately as possible. Include any visible text verbatim.

system_prompt string Optional

Default: You are a vision assistant that describes images accurately and extracts any visible text verbatim.

max_tokens number Optional

Default: 1024

temperature number Optional

Lower values produce more deterministic output, better for OCR-style tasks.

Default: 0.2

Its configuration shows the shared execution settings, but this node does not apply retries (retryOnFail, maxTries) yet. continueOnFail is not applied by any node.

Behaviour in the code

What the implementation does with these keys beyond what the schema says.

llm_provider_id
The model is whatever this provider is configured with; the node name does not force GPT-4o. Pick a vision-capable deployment.
content_base64 Read by the code, not declared
Undeclared in the config schema; normally comes from the incoming item together with content_type. image_url is used only when content_base64 is absent.
temperature
Must be a number; any other type falls back to 0.2. A max_tokens of 0 or empty falls back to 1024.
execution
Only timeout_ms is read (default 120000). The retry settings are not applied.

Output ports

extracted default

The model returned text.

Data
{
  "text": "Receipt from Example Store. Total: $42.10. Date: 2026-11-25.",
  "chars": 60,
  "empty": false,
  "method": "llm.vision",
  "metadata": {
    "llm_provider_id": "<llm_provider_id>",
    "usage": {
      "prompt_tokens": 1146,
      "completion_tokens": 21,
      "total_tokens": 1167
    }
  }
}
empty

The call succeeded but the text is empty.

Data
{
  "text": "",
  "chars": 0,
  "empty": true,
  "method": "llm.vision",
  "metadata": {
    "llm_provider_id": "<llm_provider_id>",
    "usage": {
      "prompt_tokens": 1146,
      "completion_tokens": 0,
      "total_tokens": 1146
    }
  }
}
error

Validation failed, the backend answered with HTTP 400 or more or success: false, or the request timed out.

Data
{
  "error": "Either content_base64 or image_url is required."
}

In expressions

What a later node can read from this node's output with $("OpenAI - GPT-4o Vision").item.json.<path> (write your node's label instead of OpenAI - GPT-4o Vision). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through extracted, from the output shown in Ports.

ExpressionEditorWorker
$("OpenAI - GPT-4o Vision").item.json.textstring= "Receipt from Example Store. Total: $42.10. D…"
$("OpenAI - GPT-4o Vision").item.json.charsnumber= 60
$("OpenAI - GPT-4o Vision").item.json.emptyboolean= false
$("OpenAI - GPT-4o Vision").item.json.methodstring= "llm.vision"
$("OpenAI - GPT-4o Vision").item.json.metadataobject= {…}
$("OpenAI - GPT-4o Vision").item.json.metadata.llm_provider_idstringNot suggested by the editor= "<llm_provider_id>"—
$("OpenAI - GPT-4o Vision").item.json.metadata.usageobjectNot suggested by the editor= {…}—

— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).

Errors

Message Port Cause and fix
llm_provider_id is required. error No LLM provider selected.
Either content_base64 or image_url is required. error Neither the config nor the incoming item carries an image.
LLM provider invoke returned HTTP <status> error The backend rejected the call without a message. When it sends one (for example LLM Invocation Error (SDK): <detail>), that message is returned instead.
timeout of <ms>ms exceeded error The provider did not answer within execution.timeout_ms.

Input contract

content_base64 string Optional
content_type string Optional

Default: image/png

image_url string Optional

Public URL to an image (alternative to content_base64).

Output contract

text string Optional
chars number Optional
empty boolean Optional
method string Optional
metadata object Optional

Contracts (JSON Schema)

The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.

{
  "slug": "integrations.openai.gpt-4o.vision",
  "name": "OpenAI - GPT-4o Vision",
  "category": "integrations",
  "group": [
    {
      "key": "openai",
      "name": "OpenAI",
      "icon_url": "/icons/integrations/openai/openai.svg"
    }
  ],
  "icon_url": "/icons/integrations/openai/openai.svg",
  "version": "1.0.0",
  "description": "Invoke OpenAI GPT-4o (Omni) via the Chat Completions API for image understanding, vision-based OCR, and visual reasoning over diagrams and charts.\n\n  Routes through the backend `POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke` endpoint using an `llm_provider_id` registered in the cognitive-assets registry. Billing is handled directly by OpenAI or Azure OpenAI against your subscription. Compatible with any GPT-4 class model that exposes the `vision` capability (GPT-4o, GPT-4o mini, GPT-4 Turbo with vision).\n\n  **Operations:**\n  - **Image captioning:** Natural-language descriptions of photographs, screenshots, and product imagery.\n  - **Chart and diagram interpretation:** Structured extraction of data series, labels, and relationships from bar charts, line charts, flow diagrams, and images containing tables.\n  - **Vision-based OCR:** Reads text in layouts that defeat classical OCR — low contrast, unusual typography, handwriting, skewed scans, stylized signage.\n  - **Scene understanding:** Identifies objects, activities, and contextual cues to support moderation, tagging, and routing workflows.\n\n  **Inputs:** base64-encoded image or a public image URL.\n  **Controls:** system prompt, user prompt (expression-enabled), temperature, and max tokens exposed as node configuration so the same node can run deterministic OCR-style calls or creative captioning.",
  "capabilities": [
    "openai",
    "gpt-4o",
    "vision",
    "image-understanding",
    "ocr",
    "llm"
  ],
  "config_schema": {
    "type": "object",
    "properties": {
      "llm_provider_id": {
        "type": "string",
        "title": "LLM Provider",
        "description": "Select a vision-capable LlmProvider from the cognitive-assets registry (e.g. an Azure OpenAI GPT-4o deployment).",
        "x-ui-widget": "llm-provider-picker"
      },
      "prompt": {
        "type": "string",
        "title": "User Prompt",
        "default": "Describe the content of this image as accurately as possible. Include any visible text verbatim.",
        "format": "expression"
      },
      "system_prompt": {
        "type": "string",
        "title": "System Prompt",
        "default": "You are a vision assistant that describes images accurately and extracts any visible text verbatim."
      },
      "max_tokens": {
        "type": "number",
        "title": "Max Tokens",
        "default": 1024
      },
      "temperature": {
        "type": "number",
        "title": "Temperature",
        "default": 0.2,
        "description": "Lower values produce more deterministic output, better for OCR-style tasks."
      },
      "execution": {
        "type": "object",
        "title": "Execution Settings",
        "properties": {
          "alwaysOutputData": {
            "type": "boolean",
            "title": "Always Output Data",
            "description": "Always output data, even on error (if configured).",
            "default": false
          },
          "retryOnFail": {
            "type": "boolean",
            "title": "Retry On Fail",
            "description": "Retry the execution if it fails.",
            "default": false
          },
          "maxTries": {
            "type": "integer",
            "title": "Max Retries",
            "description": "Number of retries.",
            "default": 3,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "waitBetweenTries": {
            "type": "integer",
            "title": "Wait Between Retries (ms)",
            "default": 1000,
            "displayOptions": {
              "show": {
                "retryOnFail": [
                  true
                ]
              }
            }
          },
          "continueOnFail": {
            "type": "boolean",
            "title": "Continue On Fail",
            "description": "Do not crash workflow on error.",
            "default": false
          },
          "timeout_ms": {
            "type": "integer",
            "title": "Timeout (ms)",
            "description": "Max execution time for this node before it is killed, in milliseconds. Honored by long-running operators (e.g. OCR/extraction, inline code). Default 300000 (5 min).",
            "default": 300000
          }
        }
      }
    },
    "required": [
      "llm_provider_id"
    ]
  },
  "input_contract_schema": {
    "type": "object",
    "properties": {
      "content_base64": {
        "type": "string"
      },
      "content_type": {
        "type": "string",
        "default": "image/png"
      },
      "image_url": {
        "type": "string",
        "description": "Public URL to an image (alternative to content_base64)."
      }
    }
  },
  "output_contract_schema": {
    "type": "object",
    "properties": {
      "text": {
        "type": "string"
      },
      "chars": {
        "type": "number"
      },
      "empty": {
        "type": "boolean"
      },
      "method": {
        "type": "string"
      },
      "metadata": {
        "type": "object"
      }
    }
  },
  "ports": [
    {
      "port_id": "extracted",
      "label": "Extracted",
      "is_default": true,
      "supports_condition": true
    },
    {
      "port_id": "empty",
      "label": "Empty",
      "is_default": false,
      "supports_condition": true
    },
    {
      "port_id": "error",
      "label": "Error",
      "is_default": false,
      "supports_condition": false
    }
  ],
  "execution_mode": "async",
  "required_resources": [],
  "compatible_worker_pools": [
    "standard-io",
    "cloud-io"
  ],
  "tags": [
    "openai",
    "gpt-4o",
    "vision",
    "llm",
    "image"
  ],
  "is_stateful": false,
  "publisher": {
    "identity": "org_sommatic_ai",
    "profile": {
      "name": "Sommatic AI",
      "verified": true,
      "url": "https://sommatic.ai",
      "logo_url": null
    }
  }
}

Execution

Execution
async
Stateful
No
Retries (retryOnFail)
No
Capabilities
openaigpt-4ovisionimage-understandingocrllm
Tags
openaigpt-4ovisionllmimage

Notes and limits

  • The worker never calls OpenAI directly and holds no provider key; usage is billed to the provider's own account.
  • usage is passed through from the provider response and may be absent. The node does not retry.

Reviewed against the orchestrator code · 31e874b · 2026-11-26

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs