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. Pick the scopes you want the agent to have; the token (
ot_pat_...) is shown once. -
Add the MCP server to your coding agent with the token. For Claude Code:
-
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.
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 |
| Get started | MCP quickstart | CLI quickstart | HTTP quickstart |
~/.config/opentrain/cli.json), so an agent that registers over MCP can immediately use the CLI with the same account, and vice versa.
Building with an autonomous agent? Point it at the agent discovery
surfaces — 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.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.
The Job Lifecycle
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
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?
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
Core Concepts
Authentication, scopes, approvals, credits, errors, and privacy — the
mental model behind every endpoint.
Guides
Task-oriented walkthroughs with curl, CLI, and MCP examples side by side.
API Reference
Every endpoint, every field, every error — hand-written and kept in sync
with the served OpenAPI spec.
Annotation Platforms
Integrate OpenTrain hiring, auto-provisioning, and usage sync into your
own labeling platform.