mechane

API reference

Markdown

The API is at https://mechane-api.mechane.workers.dev. Every request needs Authorization: Bearer <workspace-key>. Bodies are JSON; unknown properties are rejected. Errors are JSON objects with an error message.

MethodPathDoes
POST/v1/mechsCreate { id, model, instructions?, reasoningEffort? }. Safe to retry.
GET/v1/mechs?after=<id>List up to 100 mechs as { items: [{ id }], next }.
GET/v1/mechs/{id}Read the profile, settings, current run, and checkpoint reference.
PATCH/v1/mechs/{id}Update { instructions?, reasoningEffort? } for future runs.
POST/v1/mechs/{id}/runsStart { input, settings? } with an Idempotency-Key header. Returns 202.
GET/v1/mechs/{id}/runs/{runId}Read the run's status, output, and resolved settings.
GET/v1/mechs/{id}/runs/{runId}/eventsStream events. Resume with Last-Event-ID or ?after=<id>.
POST/v1/mechs/{id}/runs/{runId}/cancelRequest cancellation. Safe to repeat.
GET/v1/mechs/{id}/creditsRead the mech's balance.
GET/v1/mechs/{id}/usageList the mech's recent usage.

Status codes

CodeMeaning
202The run was accepted.
400The request body or parameters are invalid.
401The key is missing, unknown, or revoked.
404No mech or run with that name in this workspace.
409The mech is busy, the name exists with a different profile, or an idempotency key was reused with a different request.