Skip to content
HALOWERK

Denkwerk

image token estimate

Implements the published formulas: OpenAI patch-based models (32-px patches, model and detail-specific maximum dimension and patch budget, model multiplier, 30,000-patch rejection) and tile-based models (2048 fit, 768 shortest side, 512-px tiles, base plus tile tokens); Anthropic visual tokens ceil(w/28) x ceil(h/28) after the documented resize to the standard (1568 px, 1568 tokens) or high-resolution tier (2576 px, 4784 tokens, Claude 4.7 and later) with half-to-even rounding; Gemini 3 and.

POST https://denk.halowerk.com/v1/image-token-estimate

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
widthintegerYes
heightintegerYes
imagesintegerNoNumber of images of this size.
price_per_mtok_usdnumberNoOptional input price for a cost estimate.
targetsarrayYes
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "width",
    "height",
    "targets"
  ],
  "properties": {
    "width": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100000
    },
    "height": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100000
    },
    "images": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100000,
      "default": 1,
      "description": "Number of images of this size."
    },
    "price_per_mtok_usd": {
      "type": "number",
      "minimum": 0,
      "maximum": 1000,
      "description": "Optional input price for a cost estimate."
    },
    "targets": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider",
          "model"
        ],
        "properties": {
          "provider": {
            "type": "string",
            "enum": [
              "openai",
              "anthropic",
              "gemini"
            ]
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "detail": {
            "type": "string",
            "enum": [
              "low",
              "high",
              "original",
              "auto"
            ],
            "default": "auto",
            "description": "OpenAI only."
          },
          "tier": {
            "type": "string",
            "enum": [
              "standard",
              "high_resolution"
            ],
            "description": "Anthropic: override the tier derived from the model."
          },
          "media_resolution": {
            "type": "string",
            "enum": [
              "unspecified",
              "low",
              "medium",
              "high",
              "ultra_high"
            ],
            "default": "unspecified",
            "description": "Gemini 3 and 4."
          }
        }
      }
    }
  }
}

Open original schema

Published input example

{
  "width": 1920,
  "height": 1080,
  "targets": [
    {
      "provider": "openai",
      "model": "gpt-5.4",
      "detail": "high"
    },
    {
      "provider": "anthropic",
      "model": "claude-sonnet-4-6"
    },
    {
      "provider": "gemini",
      "model": "gemini-3.8-flash",
      "media_resolution": "high"
    }
  ]
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’