# -*- coding: utf-8 -*- import json, ssl, pathlib, urllib.request, urllib.error BASE = "https://192.168.31.88:8042" CFG = pathlib.Path(r"C:\Users\admin\.zcode\cli\config.json") pat = json.loads(CFG.read_text(encoding="utf-8-sig"))["mcp"]["servers"]["sorb"]["env"]["SORB_PAT"] ctx = ssl._create_unverified_context() for ref_id in [9043, 9047, 9048, 9057]: payload = { "project_id": 30, "model_config_id": 88, "task_type": "image", "references": [{"source_type": "media_asset", "id": ref_id, "asset_type": "image", "role": "reference_image"}], "parameters": {"prompt": "test", "aspect_ratio": "16:9", "image_size": "4K", "quality": "max", "output_format": "png", "n": 1}, } data = json.dumps(payload, ensure_ascii=False).encode("utf-8") req = urllib.request.Request(BASE + "/api/external/v1/tasks/estimate", data=data, method="POST", headers={"Authorization": "Bearer " + pat, "Content-Type": "application/json"}) try: with urllib.request.urlopen(req, context=ctx, timeout=60) as r: print(ref_id, "OK", r.status, r.read().decode("utf-8")[:200]) except urllib.error.HTTPError as e: print(ref_id, "ERR", e.code, e.read().decode("utf-8")[:300])