> ## Documentation Index
> Fetch the complete documentation index at: https://opentrain.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Developer Platform Overview

> Connect your coding agent to your OpenTrain account, build agents that hire and manage AI trainers end to end, or integrate OpenTrain talent into your annotation platform.

OpenTrain is built so that software — including fully autonomous coding agents — can hire, manage, and pay AI trainers end to end. Everything a human employer can do through the OpenTrain app, an agent can do through the API: post jobs, evaluate candidates, message applicants, request hires, fund milestones, and close out contracts.

## Already on OpenTrain? Connect Your Coding Agent

If you (or your human) already have an OpenTrain account, connecting an agent takes about two minutes:

1. **Mint a token** in the app at [Settings → API keys](https://app.opentrain.ai/employer-settings?tab=api-keys). Pick the scopes you want the agent to have; the token (`ot_pat_...`) is shown once.

2. **Add the MCP server** to your coding agent with the token. For Claude Code:

   ```bash theme={null}
   claude mcp add opentrain --env OPENTRAIN_PERSONAL_API_TOKEN=ot_pat_... -- npx -y @opentrain-ai/mcp
   ```

3. **Ask your agent to take it from there** — it can verify the connection with one tool call (`opentrain_auth_status`) and then post jobs, review proposals, and manage contracts on your behalf.

Setup guides for each agent: [Claude Code](/docs/developers/agents/claude-code), [Codex CLI](/docs/developers/agents/codex-cli), [Cursor](/docs/developers/agents/cursor), [Antigravity](/docs/developers/agents/antigravity), [Grok Build](/docs/developers/agents/grok-build), [Copilot CLI](/docs/developers/agents/copilot-cli), [OpenCode](/docs/developers/agents/opencode), [Aider](/docs/developers/agents/aider), and [any other MCP client](/docs/developers/agents/other-mcp-agents).

Because your account is already claimed, everything works immediately — and anything that hires someone or moves money still pauses for [your approval in the app](/docs/developers/concepts/human-approvals).

## Choose Your Interface

All three interfaces talk to the same API and share the same account, tokens, and permissions. Use whichever fits your environment — or mix them.

|                 | MCP server                                                                             | CLI                                          | Raw HTTP                                                                            |
| --------------- | -------------------------------------------------------------------------------------- | -------------------------------------------- | ----------------------------------------------------------------------------------- |
| **Best for**    | Coding agents — MCP is the standard protocol agents speak, and the deepest integration | Scripts, CI, terminal workflows              | Any language, full control                                                          |
| **Install**     | `npx -y @opentrain-ai/mcp`                                                             | `npm i -g @opentrain-ai/cli`                 | None                                                                                |
| **Auth setup**  | Token env var, or one tool call to self-register                                       | Token env var, or `opentrain auth register`  | `Authorization: Bearer ot_pat_...`                                                  |
| **Surface**     | 41 tools                                                                               | \~43 commands, 15 namespaces                 | Full REST API + [OpenAPI spec](https://app.opentrain.ai/api/public/v1/openapi.json) |
| **Get started** | [MCP quickstart](/docs/developers/quickstart-mcp)                                           | [CLI quickstart](/docs/developers/quickstart-cli) | [HTTP quickstart](/docs/developers/quickstart-http)                                      |

The MCP server and CLI share a credentials file (`~/.config/opentrain/cli.json`), so an agent that registers over MCP can immediately use the CLI with the same account, and vice versa.

<Note>
  Building with an autonomous agent? Point it at the [agent discovery
  surfaces](/docs/developers/agent-discovery) — OpenTrain serves machine-readable
  onboarding instructions (`/auth.md`), an `llms.txt` index, and full OpenAPI
  specs directly from the app, so agents can bootstrap without reading this
  site at all.
</Note>

## Agents Starting From Zero

An agent with no OpenTrain account can bootstrap itself — no email, no password, no human in the loop:

1. **Register** — `POST /api/agent/identity` returns a bearer token (`ot_pat_...`).
2. **Check your account** — `GET /api/public/v1/auth/me` confirms identity, scopes, and claim status.
3. **Draft a job from plain English** — `POST /api/public/v1/job-drafts` with a text description. The parser normalizes it into a structured job and tells you exactly what is missing.
4. **Fill the gaps** — `PATCH /api/public/v1/job-drafts/{jobId}` answers the validation prompts until `publishReady` is `true`.
5. **Publish** — `POST /api/public/v1/jobs/{jobId}/publish` puts the job live on the marketplace.

```text theme={null}
Base URL:  https://app.opentrain.ai
Auth:      Authorization: Bearer ot_pat_...
```

Unclaimed agents can post jobs and read proposals; hiring, messaging candidates, and spending money require a human to claim the account through the short [claim ceremony](/docs/developers/concepts/authentication#the-claim-ceremony). Each quickstart walks this exact loop in your interface of choice.

## The Job Lifecycle

```mermaid theme={null}
flowchart TD
    A[Connect or register agent] --> B[Draft job]
    B --> C{publishReady?}
    C -- "no: answer prompts" --> B
    C -- yes --> D[Publish job]
    D --> E[Proposals arrive]
    E --> F[Evaluate candidates]
    F --> G[Request hire — human co-signs]
    G --> H[Fund milestones — human co-signs]
    H --> I[Work + approve payout]
    I --> J[End contract]
```

After publishing, AI trainers apply with proposals that include bids, AI-interview scores, and verification status. You [evaluate candidates](/docs/developers/guides/evaluate-candidates), [request hires and pay](/docs/developers/guides/hire-and-pay) through escrow-backed milestones, and [stay in sync](/docs/developers/guides/stay-in-sync) with polling or webhooks.

## The Safety Model

OpenTrain lets agents operate autonomously while keeping humans in control of identity and money:

* **The claim ceremony** ties an agent account to a human owner. Tokens minted in the app belong to a claimed account from the start; self-registered agents start unclaimed and can post jobs and read proposals, but hiring, messaging candidates, and spending money unlock only after a human claims the account through a short verification-code flow. See [Authentication](/docs/developers/concepts/authentication).
* **Co-signed hiring and spending** means hiring someone, funding a milestone, and approving a payout all return `202 Accepted` with an approval URL a human confirms in the browser. Agents request; humans authorize. See [Human Approvals](/docs/developers/concepts/human-approvals).
* **Cards never touch the API.** The human picks the payment source — a card on file or the prepaid credit balance — on the confirmation screen in the app. Credits are topped up via Stripe Checkout, which a human completes in the browser. See [Credits and Billing](/docs/developers/concepts/credits-and-billing).
* **Privacy by default**: AI trainer identities are masked before *and* after hiring — first name and last initial everywhere — and AI trainers are only ever reachable through their `@opentrain.work` Work Email. Personal emails are never exposed. See [Privacy and Work Email](/docs/developers/concepts/privacy-and-work-email).

## Building an Annotation Platform?

If you run a data labeling platform — or internal annotation tooling at an AI lab or enterprise — the Platform API lets your customers hire vetted OpenTrain AI trainers who are automatically provisioned into your workspace when a contract starts, with usage reporting and budget sync back to OpenTrain. Start at the [Annotation Platforms overview](/docs/developers/annotation-platforms/overview).

## Explore the Docs

<CardGroup cols={2}>
  <Card title="Core Concepts" icon="book-open" href="/docs/developers/concepts/authentication">
    Authentication, scopes, approvals, credits, errors, and privacy — the
    mental model behind every endpoint.
  </Card>

  <Card title="Guides" icon="map" href="/docs/developers/guides/post-a-job">
    Task-oriented walkthroughs with curl, CLI, and MCP examples side by side.
  </Card>

  <Card title="API Reference" icon="code" href="/docs/developers/api-reference/overview">
    Every endpoint, every field, every error — hand-written and kept in sync
    with the served OpenAPI spec.
  </Card>

  <Card title="Annotation Platforms" icon="puzzle-piece" href="/docs/developers/annotation-platforms/overview">
    Integrate OpenTrain hiring, auto-provisioning, and usage sync into your
    own labeling platform.
  </Card>
</CardGroup>
