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.

bash
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.

CodeHTTPWhat it means
authentication_required401No credential was sent.
invalid_api_key401The key is not one we issued.
api_key_revoked401The key was revoked.
sign_in_required401This call needs a signed-in session, not an API key.
insufficient_scope403The key lacks the scope this call needs.
not_org_member403You are not a member of that organization.
not_org_owner403Only an organization owner can do this.
invalid_request400The body or query is malformed.
authorization_pending400The CLI sign-in has not been approved yet.
slow_down400Polling too fast; wait longer between polls.
expired_token400The sign-in code expired; start again.
access_denied400The sign-in was refused.
too_many_requests429Rate limited; retry after the time given.
api_version_invalid400The requested API version is not one we serve.
not_found404No such resource.
robot_not_found404No such robot in your organization.
method_not_allowed405That method is not allowed on this path.
idempotency_key_reused409That Idempotency-Key was used for a different request.
idempotency_in_progress409The first request with that key is still running.
insufficient_credit402Prepaid credit does not cover the task.
monthly_limit402The organization's monthly limit is reached.
robot_dispatch_unavailable503Live tasks cannot reach robots yet, or the robot was not reachable.
insufficient_role403Your role in the organization does not allow this.
staff_only403Only AutoFAB staff can do this.
plan_required402This add-on needs an active plan first.
billing_unavailable503Billing is not available right now. Nothing was charged.
internal_error500Our fault. Retry, then tell us.