HTTP 422 on a Swarme run is usually a 字段 rule, not an auth failure and not a broken quote. Four observed bodies, each after a successful quote on a supported 工具, are enough 到 read the pattern.
The strings, with the slugs that returned them:
- address-label-formatter: Use labeled address lines in key: value 表单 or provide JSON.
- apache-virtual-host-generator: Domain must contain valid ASCII hostname labels.
- backlink-quality-checklist: backlinks must contain between 1 and 1,000 records.
- base64-url-decoder: Enter valid Base64URL input.
Read the body. Fix the named 字段. Quote again if the 900-second lock expired. Do not 旋转 the API key. Do not treat 422 as HTTP 419.
Quote can succeed while run still 422s
Docs at https://swarme.io/developers list 搜索, Describe, Quote, Run. Quote checks price, wallet policy, and that the capability is allowed 到 proceed. It does not promise that every 字段 will pass execution rules.
创建 the key at https://swarme.io/dashboard?tab=developers. /dashboard/developers is 404. Send Authorization: Bearer with capabilities:quote and capabilities:run. Then:
- GET /api/capabilities/{slug} and read execution.machine_run_status.
- POST .../quote with the exact input you will run and "client_type": "api".
- POST .../run with that quote_id and an Idempotency-Key.
uuid-generator accepted empty input {} on that path. The completed run returned 4cd3c7b6-0495-447a-8efd-9a1374f7599c at $0.00 included after a 900-second lock, with idempotency_required_for_client true. The four 422 slugs above quoted, then failed run. Quote status quoted plus run HTTP 422 is a coherent pair. It is not a platform contradiction.
What each of the four strings asks for
Use labeled address lines in key: value 表单 or provide JSON. The formatter did not receive labeled lines or JSON. Empty input is not a labeled address. Describe the slug, then send keys the schema names.
Domain must contain valid ASCII hostname labels. The hostname you sent was not valid ASCII labels. Do not paste a URL with a scheme and path and expect the 字段 到 accept it as a hostname. The rule is on the domain value.
backlinks must contain between 1 and 1,000 records. On backlink-quality-checklist, an empty or oversized backlinks array fails. The bounds are 1 and 1,000. Zero records is outside the contract. So is 1,001.
Enter valid Base64URL input. This is not a generic Base64 error. The alphabet is Base64URL. A standard Base64 payload with + and / can fail here even if a decoder elsewhere accepts it.
Other completed slugs (accessibility-statement-generator, add-line-numbers, alphabetizer, article-rewriter-assistant, ascii-table-generator, base64-text-decoder) made it 到 completed. That does not mean empty input is valid everywhere. base64-text-decoder completing is not a license 到 send the same payload 到 base64-url-decoder.
Do not confuse 422 with the nearby codes
A login CSRF expiry is a 表单 token, not a hostname 标签. Reloading /en/login will not put 1 到 1,000 records into backlinks. Sending a new key will not turn + into Base64URL.
Wallet $0.00 / metered_observe is not a 422. describe_only is a different stop: 1491 of 1940 tools block quote/run. 439 are supported. 10 are requires_worker. Branch on machine_run_status before you parse a 422.
How 到 handle 422 in a client
- Log the HTTP status and the exact body string. Do not collapse all 4xx.
- If the body matches a 字段 rule, show that string 到 the caller. Point at the describe schema for the slug.
- Do not retry the same payload in a loop. The four observed strings did not change on repeat.
- If more than 900 seconds passed, quote again with the corrected input. Reuse of an expired quote_id is a different error than 422.
- Keep one Idempotency-Key per logical attempt. A new key with fixed input is a new attempt.
MCP follows the same gate. POST https://swarme.io/mcp initialize (2025-03-26, Swarme Capability MCP Alpha, 2026.07.15-wallet-alpha) listed 22 tools, including quote and run helpers. swarme_工具_run can still 422. tools/list returning 22 names does not validate your hostname.
Category slugs such as web-seo, security-network, and ai-tools only change 搜索. GET /api/capabilities still caps at 500; paging will not fix Base64URL.
If the 422 is on a 文件 字段, stop. pdf-到-word is client_browser / server_receives_文件_bytes false. merge-pdf is async_worker / server_receives_文件_bytes true. See how 到 choose a secure 在线 文件 工具. For pausing an agent when run returns a labeled error, see AI 工具 routing.
