Docs
Build with ZeroShot
One key, one endpoint, and a robot that runs the task. The API and the MCP server do the same things as the app.
Quickstart
Create an account at app.autofab.net, then make a key in Settings, then Developers. Keys are shown once; the API stores only a hash.
export ZEROSHOT_API_KEY=zs_test_...
curl https://api.autofab.net/v1/tasks \
-H "Authorization: Bearer $ZEROSHOT_API_KEY" \
-H "content-type: application/json" \
-d '{"instruction": "Clear the print bed"}'The answer is a task, with an id you can read and a run log you can follow. Tasks run in ranger mode (work out a new task) or atlas mode (repeat a learned
routine). A test key runs against the test robot, instantly and uncharged; live tasks do not
reach a robot yet and answer robot_dispatch_unavailable.
API reference
The reference is the OpenAPI document the API serves: https://api.autofab.net/v1/openapi.json. It is generated with the Worker, so it matches the code.
Send your key as Authorization: Bearer zs_live_…. A key carries scopes
(tasks:read, tasks:write, robots:read, billing:read, farm:read, account:read, account:write); a call outside them answers insufficient_scope.
A POST may carry an Idempotency-Key: the first response is replayed
for the same key, so a retried request never runs twice.
MCP server
Point an agent at https://api.autofab.net/mcp with the same key as a bearer token. The server
lists its tools on tools/list — for example create_task, get_task, list_robots and get_balance. Each tool calls
the API route beside it with your key, so scopes, the request log and these error codes are
the same. There is no stop tool.
Errors
Every error is { "error": { "code", "message", "doc_url" } }. The code is
stable; match on it, not on the message.
| Code | HTTP | What it means |
|---|---|---|
authentication_required | 401 | No credential was sent. |
invalid_api_key | 401 | The key is not one we issued. |
api_key_revoked | 401 | The key was revoked. |
sign_in_required | 401 | This call needs a signed-in session, not an API key. |
insufficient_scope | 403 | The key lacks the scope this call needs. |
not_org_member | 403 | You are not a member of that organization. |
not_org_owner | 403 | Only an organization owner can do this. |
invalid_request | 400 | The body or query is malformed. |
authorization_pending | 400 | The CLI sign-in has not been approved yet. |
slow_down | 400 | Polling too fast; wait longer between polls. |
expired_token | 400 | The sign-in code expired; start again. |
access_denied | 400 | The sign-in was refused. |
too_many_requests | 429 | Rate limited; retry after the time given. |
api_version_invalid | 400 | The requested API version is not one we serve. |
not_found | 404 | No such resource. |
robot_not_found | 404 | No such robot in your organization. |
method_not_allowed | 405 | That method is not allowed on this path. |
idempotency_key_reused | 409 | That Idempotency-Key was used for a different request. |
idempotency_in_progress | 409 | The first request with that key is still running. |
insufficient_credit | 402 | Prepaid credit does not cover the task. |
monthly_limit | 402 | The organization's monthly limit is reached. |
robot_dispatch_unavailable | 503 | Live tasks cannot reach robots yet, or the robot was not reachable. |
insufficient_role | 403 | Your role in the organization does not allow this. |
staff_only | 403 | Only AutoFAB staff can do this. |
plan_required | 402 | This add-on needs an active plan first. |
billing_unavailable | 503 | Billing is not available right now. Nothing was charged. |
internal_error | 500 | Our fault. Retry, then tell us. |