RelayRunner docs: RelayRunner API
Page: https://relayrunner.dev/docs/reference/api
Markdown: https://relayrunner.dev/docs/reference/api.md
All pages: https://relayrunner.dev/docs/llms.txt

Other pages (Markdown):
- Route GitHub Actions jobs to any runner: https://relayrunner.dev/docs/get-started/overview.md
- How it works with GitHub Actions: https://relayrunner.dev/docs/get-started/github-actions.md
- Quickstart: https://relayrunner.dev/docs/get-started/quickstart.md
- Install the CLI: https://relayrunner.dev/docs/get-started/install.md
- RelayRunner for Mac: https://relayrunner.dev/docs/get-started/mac-app.md
- Set up with an agent: https://relayrunner.dev/docs/get-started/agents.md
- Move your workflows over: https://relayrunner.dev/docs/get-started/move-over.md
- Principles: https://relayrunner.dev/docs/concepts/principles.md
- Routing: https://relayrunner.dev/docs/concepts/routing.md
- Runner order: https://relayrunner.dev/docs/concepts/runner-order.md
- Optimized checks: https://relayrunner.dev/docs/concepts/optimized-checks.md
- Spend controls: https://relayrunner.dev/docs/guides/spend-controls.md
- Providers: https://relayrunner.dev/docs/runners/providers.md
- Your machines: https://relayrunner.dev/docs/runners/self-hosted.md
- GitHub-hosted: https://relayrunner.dev/docs/runners/github.md
- Hosted providers: https://relayrunner.dev/docs/runners/hosted.md
- Runner labels: https://relayrunner.dev/docs/reference/labels.md
- Add a provider: https://relayrunner.dev/docs/contribute/add-provider.md
- Run CI on your laptop while you work: https://relayrunner.dev/docs/guides/laptop-ci.md
- macOS and iOS builds on your Mac: https://relayrunner.dev/docs/guides/mac-builds.md
- Share your team's machines: https://relayrunner.dev/docs/guides/team-machines.md
- Keep up with coding agents: https://relayrunner.dev/docs/guides/agent-surge.md
- Activity and history: https://relayrunner.dev/docs/dashboard/activity.md
- Signals: https://relayrunner.dev/docs/dashboard/signals.md
- Performance: https://relayrunner.dev/docs/dashboard/performance.md
- Usage and savings: https://relayrunner.dev/docs/dashboard/usage.md
- Telemetry: https://relayrunner.dev/docs/dashboard/telemetry.md
- AI: https://relayrunner.dev/docs/dashboard/ai.md
- CLI: https://relayrunner.dev/docs/reference/cli.md
- relay.yml inputs: https://relayrunner.dev/docs/reference/relay-inputs.md
- Repo config: https://relayrunner.dev/docs/reference/repo-config.md
- MCP server: https://relayrunner.dev/docs/reference/mcp.md
- RelayRunner API: https://relayrunner.dev/docs/reference/api.md (this page)
- Workspaces and members: https://relayrunner.dev/docs/dashboard/workspaces.md
- GitHub App: https://relayrunner.dev/docs/reference/github-app.md
- Security: https://relayrunner.dev/docs/reference/security.md
- Data and privacy: https://relayrunner.dev/docs/reference/privacy.md
- Remove RelayRunner: https://relayrunner.dev/docs/dashboard/remove.md
- Troubleshooting: https://relayrunner.dev/docs/reference/troubleshooting.md
- Errors: https://relayrunner.dev/docs/reference/errors.md
- FAQ: https://relayrunner.dev/docs/reference/faq.md
- Feedback: https://relayrunner.dev/docs/contribute/feedback.md
- Changelog: https://relayrunner.dev/docs/changelog.md
- Agents can change your routing: https://relayrunner.dev/docs/changelog/agent-changes.md
- Confirm agent changes that pause or reorder runners: https://relayrunner.dev/docs/changelog/agents-ask-first.md
- Pick runner sizes on the dashboard: https://relayrunner.dev/docs/changelog/auto-runner-sizes.md
- CLI changelog: https://relayrunner.dev/docs/changelog/cli.md
- Failed checks show why a job couldn't route: https://relayrunner.dev/docs/changelog/couldnt-route-check.md
- Try a runner provider on your own workflows: https://relayrunner.dev/docs/changelog/evaluate-a-provider.md
- Routing retries through GitHub outages: https://relayrunner.dev/docs/changelog/github-outages.md
- Send job logs to OpenTelemetry or an S3 bucket: https://relayrunner.dev/docs/changelog/job-log-export.md
- Job time split into setup, build and test: https://relayrunner.dev/docs/changelog/job-phases.md
- Mac app changelog: https://relayrunner.dev/docs/changelog/mac.md
- RelayRunner for Mac: https://relayrunner.dev/docs/changelog/mac-app.md
- Send a crash report from the Mac app: https://relayrunner.dev/docs/changelog/mac-crash-reports.md
- Route jobs by os, arch and cpus: https://relayrunner.dev/docs/changelog/machine-shapes.md
- CI traces in your observability tool: https://relayrunner.dev/docs/changelog/opentelemetry-traces.md
- Platform changelog: https://relayrunner.dev/docs/changelog/platform.md
- Retries, queueing and provider usage: https://relayrunner.dev/docs/changelog/retries-queueing-and-provider-usage.md
- Route a repo from the dashboard: https://relayrunner.dev/docs/changelog/route-a-repo.md
- Per-workflow run times and job sizing for members: https://relayrunner.dev/docs/changelog/run-times.md
- Usual job times, job history and the Mac queue: https://relayrunner.dev/docs/changelog/usual-times-and-mac-queue.md

---

# RelayRunner API

> Read your workspace's runners, runs, routing and usage over HTTP, and change its routing.

The RelayRunner API is the HTTP API behind the [MCP server](/docs/reference/mcp). It reads a workspace's runners, runs, routing and usage, and changes its routing where you allow it.

> **Connecting an AI agent?:** Use the [MCP server](/docs/reference/mcp) instead. Claude, Cursor, VS Code and other MCP clients sign in on their own and get these routes as tools. Call the API directly only if you're writing your own OAuth client.

```text
https://api.relayrunner.dev/api
```

[API routes](/docs/reference/api/routes) lists every route with its parameters and responses, and you can try them there. The [OpenAPI spec](/openapi.json) has the same in JSON.

## Sign in

The API uses OAuth 2.1 with PKCE and the `workspace:read` scope. Clients can register themselves, and the authorization server publishes its endpoints at `https://app.relayrunner.dev/.well-known/oauth-authorization-server/api/auth`. While signing in, you pick which workspaces the token may read.

Send the access token as `Authorization: Bearer <token>`. Tokens last 15 minutes; use the refresh token for a new one. When a token covers more than one workspace, name the one you're asking about in the `x-relayrunner-workspace` header.

## Routes

| Route                                                    | What it returns                                                        |
| -------------------------------------------------------- | ---------------------------------------------------------------------- |
| `GET /me`                                                | You and the workspaces the token may read                              |
| `GET /workspaces/current`                                | One workspace, your role and its GitHub accounts                       |
| `GET /workspaces/{id}/runner-order`                      | The providers jobs are tried on, in order (`?repo=` for one repo's)    |
| `GET /workspaces/{id}/router-setup`                      | Recent workflows and how many of their runs were routed                |
| `GET /machines`                                          | Runners, their status, labels, pause state and current job             |
| `GET /runs`                                              | Workflow runs from the last 14 days                                    |
| `GET /runs/{repositoryId}/{runId}/{runAttempt}/jobs`     | One run's jobs and where each ran                                      |
| `GET /runs/{repositoryId}/{runId}/{runAttempt}/failures` | Why a run's jobs failed, with the end of each log                      |
| `GET /activity`                                          | The activity log, including where each job was routed and why          |
| `GET /usage`, `/usage/checks`, `/usage/actions`          | Short jobs and round-up cost, optimized check savings, Actions minutes |
| `GET /job-times`                                         | Typical job durations per runner                                       |
| `GET /signals`                                           | What's making CI slow, costly or busier than it needs to be            |
| `GET /workspaces/{id}/auto-jobs`                         | Auto jobs' sizes and first providers, and the default size             |
| `GET /workspaces/{id}/retry-settings`, `/ai`             | Automatic retries, and whether AI is on                                |
| `POST /feedback`                                         | Reports a bug, confusing result or missing feature to the team         |

These change settings. They work only in workspaces where the person turned on **Allow changes** for the connection under **Settings → Agents**, and only for changes the person could make in the dashboard: owners and admins for workspace settings, anyone who can push to a repo for its jobs' sizes and its own runner order (`?repo=owner/name` on the runner order routes), and pausing by the dashboard's rules. Elsewhere they answer `403` with `AGENT_CHANGES_OFF` or `FORBIDDEN`. Each change shows in the workspace's Activity, and each answer includes the value it replaced as `previous`.

| Route                                        | What it changes                                                       |
| -------------------------------------------- | --------------------------------------------------------------------- |
| `PUT /workspaces/{id}/runner-order`          | The runner order. Pass `version` from the GET to refuse a stale write |
| `DELETE /workspaces/{id}/runner-order?repo=` | Puts a repo with its own order back on the workspace's                |
| `PUT /workspaces/{id}/auto-size`             | The default size for auto jobs                                        |
| `PUT /workspaces/{id}/auto-jobs/{jobId}`     | One auto job's size and first provider                                |
| `PUT /workspaces/{id}/retry-settings`        | Automatic retries                                                     |
| `PUT /workspaces/{id}/ai`                    | AI features, on or off                                                |
| `POST /machines/{id}/pause`, `/resume`       | Whether jobs route to a runner                                        |

A failed request answers with a code and a message, such as `{"error": {"code": "INVALID_REQUEST", "message": "The request isn't valid."}}`. [Errors](/docs/reference/errors) lists every code.

## Rate limit

Each person's connection can make 300 requests a minute, counting requests from the MCP server too. Past that, the API answers `429` with the `RATE_LIMITED` code and a `Retry-After` header.
