APIs

The Motor CLI covers day-to-day work for both you and your agents. Reach for the HTTP APIs directly when you’re building custom automation or integrations.

  • Gauss Repositories, access, published artifacts, and merges.
  • Piston Sources, plans, runs, logs, outputs, secrets, and cached volumes.
  • Administration Accounts, teams, credentials, usage, billing, events, and webhooks.

API conventions

These conventions apply across every Motor API. Check each OpenAPI spec for how it scopes requests to a team.

Credentials

Pass your Motor key in the Authorization header. Keys that aren’t bound to a device use Bearer <key>.

Device-bound session keys use DPoP <key>, paired with a DPoP header containing a proof signed by that device’s private key.

  • Session key (motor_sk_): Created when you run motor auth and approve the sign-in in your browser. Lasts 24 hours and is bound to that device.
  • User key (motor_uk_): For scripts and services that need your permissions without a browser sign-in. Create one on the console’s Keys page.
  • Team key (motor_tk_): For team automation like CI, restricted to the key’s assigned scopes. Check each endpoint’s spec to see whether it accepts team keys.

Errors

Failed requests return an error object. Branch on code (like invalid_field) in your code; message explains what went wrong in plain language, and field points to the offending request field when relevant. When retryable is true, back off for retry_after_seconds (if present) before trying again.

Retries

On endpoints that support standard idempotency, send an Idempotency-Key header (1–128 printable ASCII characters, no spaces). Retrying with the same key and credential within 24 hours returns the original response; reusing a key for a different request returns a conflict.

Check each endpoint’s spec for exceptions. Gauss repository creation and artifact publishing handle idempotency differently, and artifact reservations take an idempotency_key field in the request body instead of a header.

Pagination

Paginated responses return data and next_cursor. Pass that cursor back using the parameter the endpoint expects (usually cursor or after). Page sizes, defaults, and end-of-list behavior vary by endpoint.

Billing

A 402 response means a billing issue blocked the request. For billing_required, a team admin needs to add a payment card in the console; for over_limit, an admin can raise the monthly spending limit. Once that’s sorted out, retry the request.