rc@den ~/g/dela (main)> curl --request POST \ --url https://api.z.ai/api/paas/v4/chat/completions \ --header "Authorization: Bearer $Z_AI_API_TOKEN" \ --header "Content-Type: application/json" \ --data '{ "model": "glm-ocr", "temperature": 0, "response_format": { "type": "json_object" }, "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Read this restaurant receipt. Extract all ordered items. Return ONLY valid JSON using exactly this format:\n\n{\n \"items\": [\n {\n \"quantity\": 1,\n \"description\": \"Item name\",\n \"price\": 250,\n \"splits\": 1\n }\n ]\n}\n\nRules:\n- quantity is the number of units ordered\n- description is the item name exactly as printed\n- price is the unit price in cents (for example 250 means 2.50)\n- splits is the number of people sharing the item; default to 1 unless clearly indicated otherwise\n- Do not include totals, taxes, table numbers, dates, or explanations\n- Return JSON only, no markdown" }, { "type": "image_url", "image_url": { "url": "https://f.rcastellotti.dev/tmp/dela/mrcao.jpeg" } } ] } ] }' | jq % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 1229 0 150 100 1079 172 1242 0 { "error": { "code": "1214", "message": "OCR only supports PDF, JPG, PNG, JPEG formats; file size limit: images ≤ 10MB, PDF ≤ 50MB; PDF max 100 pages" } } wtf? rc@den ~/g/dela (main) [23]> curl -sfL -o /tmp/mrcao.jpeg https://f.rcastellotti.dev/tmp/dela/mrcao.jpeg rc@den ~/g/dela (main)> file /tmp/mrcao.jpeg /tmp/mrcao.jpeg: JPEG image data, JFIF standard 1.01, resolution (DPI), density 72x72, segment length 16, progressive, precision 8, 1196x1280, components 3 rc@den ~/g/dela (main)> eza -lh /tmp/mrcao.jpeg Permissions Size User Date Modified Name .rw-r--r-- 235k rc 29 Jul 15:58 /tmp/mrcao.jpeg rc@den ~/g/dela (main)> curl -IL https://f.rcastellotti.dev/tmp/dela/mrcao.jpeg HTTP/2 200 accept-ranges: bytes alt-svc: h3=":443"; ma=2592000 content-type: image/jpeg etag: "dkb0r4y7w1qu51ij" last-modified: Wed, 29 Jul 2026 11:30:04 GMT server: Caddy vary: Accept-Encoding content-length: 235243 date: Wed, 29 Jul 2026 13:58:51 GMT