Runs API
Full programmatic control: create a run per request, choose the instruction, follow the status, cancel, and receive completion webhooks.
Webhook trigger
A dedicated URL for external tools. The instruction is fixed on the trigger; every accepted event becomes a run.
Authentication
Every API request is authenticated with an API token. Create one in the Leme dashboard under Settings → API tokens.read_only tokens can check statuses and list runs; creating or canceling runs requires a read_write token. The token is shown once at creation — store it in your secret manager.
Runs are asynchronous
Agent work takes seconds to minutes, so the API never blocks waiting for it. Creating a run returns202 Accepted immediately with a run resource you can follow:
GET /api/v1/runs/:id, or register a callbackUrl and let Leme notify you — see Completion webhooks.
Idempotency
Network calls fail and get retried. To make retries safe, send anIdempotency-Key header with every POST:
409 idempotency_conflict. Keys are remembered for 24 hours.
Errors
Errors always use the same envelope, with a stable machine-readablecode:
Handle errors by
code, not by message — messages may change, codes will not.
Rate limits
Requests over a limit return
429 with a retry-after header telling you how long to wait.
OpenAPI
The full machine-readable specification is available atGET https://app.leme.ai/api/openapi — use it to generate clients or import the API into your tooling.