# GPT Image 2 / WanJie Endpoint & Model Validation Notes Session: 2026-07-24. Context: user provided a new WanJie API key and asked to verify whether the existing cron job prompt would still work without changes. ## Key facts - Valid key tested: `sk-` (stored in `~/.bashrc` as `WANJIE_API_KEY`). - The environment variable name is `WANJIE_API_KEY`, not `WANJIEDATA_API_KEY`. - Termux has TLS issues with the WanJie image host; use `curl -sk` or `requests.post(..., verify=False)`. ## Validation matrix | Endpoint | Model name | Result | Notes | |---|---|---|---| | `https://api.wanjiedata.com/v1/images/generations` | `gpt-image-2` | **HTTP 410** | Aliyun Web Application Firewall HTML page, not JSON. The cron job prompt currently uses this combination. | | `https://maas-openapi.wanjiedata.com/api/v1/images/generations` | `gpt-image-2` | **HTTP 400** `model unauthorized` | Endpoint is correct, but model name is wrong. | | `https://maas-openapi.wanjiedata.com/api/v1/images/generations` | `"GPT Image 2"` (with space) | **HTTP 200** | Returns `{ "data": [{ "url": "..." }] }`. Image downloads successfully (~840 KB PNG). | ## Conclusion The cron job prompt must be updated to use the correct endpoint and the exact quoted model name `"GPT Image 2"`. Using the new key with the old prompt (wrong endpoint + wrong model name) will fail. ## Correct minimal curl ```bash bash -i -c 'curl -sk -X POST https://maas-openapi.wanjiedata.com/api/v1/images/generations \ -H "Authorization: Bearer $WANJIE_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"model\":\"GPT Image 2\",\"prompt\":\"...\",\"n\":1,\"size\":\"1024x1024\"}" \ | python3 -c "import sys,json; d=json.load(sys.stdin); print(d[\"data\"][0][\"url\"])"' ``` Use `bash -i -c` in cron/terminal so `.bashrc` is sourced and `WANJIE_API_KEY` is available.