DEVELOPER DOCUMENTATION
Developer Platform Overview
Connect coding agents to OpenTrain, build agents that hire and manage AI trainers, or integrate 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. Agents can also create and maintain the rich pages in each job’s real Instructions tab, assign and review Project To-dos and quizzes, and use the same canonical records as the web app through the API, CLI, and MCP.
Already on OpenTrain? Connect Your Coding Agent
Section titled “Already on OpenTrain? Connect Your Coding Agent”If you (or your human) already have an OpenTrain account, connecting an agent takes about two minutes:
-
Mint a token in the app at Settings → API keys. Choose Full access for a trusted, long-lived first-party agent that should automatically receive future self-serve scopes, or Fine-grained for a narrow integration. The token (
ot_pat_...) is shown once. -
Add the MCP server to your coding agent with the token. For Claude Code:
Terminal window claude mcp add opentrain --env OPENTRAIN_PERSONAL_API_TOKEN=ot_pat_... -- npx -y @opentrain-ai/mcp -
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. When it enters an existing live job, OpenTrain automatically teaches it to load shared context, inspect current priorities and conflicts, coordinate ownership, and keep other employer agents synchronized.
Setup guides for each agent: Claude Code, Codex CLI, Cursor, Antigravity, Grok Build, Copilot CLI, OpenCode, Aider, and any other MCP client.
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.
Choose Your Interface
Section titled “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 | Hiring, operations, job Instructions, and Project To-dos and quizzes | Hiring, operations, plus the job-scoped instructions and todos namespaces | Full REST API + OpenAPI spec |
| Get started | MCP quickstart | CLI quickstart | HTTP quickstart |
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. Current clients also carry private, server-issued synchronization state across covered operations. Agents see bounded sync guidance—conflicts, recommendations, and exact next operations—without putting raw delivery credentials into prompts.
For job documentation work, start with Job Instructions, then choose the CLI, MCP, or HTTP guide.
For post-hire requirements, start with Project To-dos, then choose the CLI, MCP, or HTTP reference.
When an agent manages an existing job across multiple sessions or employer team members, start with Shared Job Context. OpenTrain provides one evidence-backed view of objectives, readiness gates, blockers, decisions, action ownership, and recent changes, while the underlying job records remain authoritative. Every agent on the job also receives its Agent Guide: that typed projection plus the Playbook your team publishes, with exact section deltas whenever the guidance changes.
The shared context is automatic and optional at the product-UI level: a team does not need to open a command center or maintain a separate memory document. CLI and MCP clients learn the protocol through their built-in help and initialize guidance, receive real-time bounded updates on covered calls, and can discover useful OpenTrain workflows—such as proposing LMS retraining when repeated errors indicate a knowledge gap—without performing the suggested write until the employer approves it.
Agents Starting From Zero
Section titled “Agents Starting From Zero”An agent with no OpenTrain account can bootstrap itself — no email, no password, no human in the loop:
- Register —
POST /api/agent/identityreturns a bearer token (ot_pat_...). - Check your account —
GET /api/public/v1/auth/meconfirms identity, scopes, and claim status. - Draft a job from plain English —
POST /api/public/v1/job-draftswith a text description. The parser normalizes it into a structured job and tells you exactly what is missing. - Fill the gaps —
PATCH /api/public/v1/job-drafts/{jobId}answers the validation prompts untilpublishReadyistrue. - Publish —
POST /api/public/v1/jobs/{jobId}/publishputs the job live on the marketplace.
Base URL: https://app.opentrain.aiAuth: 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. Each quickstart walks this exact loop in your interface of choice.
The Job Lifecycle
Section titled “The Job Lifecycle”View diagram source
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, request hires and pay through escrow-backed milestones, and stay in sync with polling or webhooks.
The Safety Model
Section titled “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.
- Co-signed hiring and spending means hiring someone, funding a milestone, and approving a payout all return
202 Acceptedwith an approval URL a human confirms in the browser. Agents request; humans authorize. See 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.
- 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.workWork Email. Personal emails are never exposed. See Privacy and Work Email.
Building an Annotation Platform?
Section titled “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.
Explore the Docs
Section titled “Explore the Docs”Authentication, scopes, approvals, credits, errors, and privacy — the mental model behind every endpoint.
Task-oriented walkthroughs with curl, CLI, and MCP examples side by side.
Every endpoint, every field, every error — hand-written and kept in sync with the served OpenAPI spec.
Integrate OpenTrain hiring, auto-provisioning, and usage sync into your own labeling platform.