Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
How request units are calculated for text and image analysis
const requestUnits = Math.ceil(content.length / 1000);
import math request_units = math.ceil(len(content) / 1000)
import "math" requestUnits := int(math.Ceil(float64(len(content)) / 1000))
const pixelCount = imageWidth * imageHeight; let requestUnits = Math.ceil((pixelCount * 3) / (1024 * 1024)); // Add 3 units if image needs resizing (dimensions > 2048px) if (imageWidth > 2048 || imageHeight > 2048) { requestUnits += 3; }
import math pixel_count = image_width * image_height request_units = math.ceil((pixel_count * 3) / (1024 * 1024)) # Add 3 units if image was resized (dimensions > 2048px) if image_width > 2048 or image_height > 2048: request_units += 3
import "math" pixelCount := imageWidth * imageHeight requestUnits := int(math.Ceil(float64(pixelCount*3) / (1024 * 1024))) // Add 3 units if image was resized (dimensions > 2048px) if imageWidth > 2048 || imageHeight > 2048 { requestUnits += 3 }
Was this page helpful?