Skip to content
OpenTrain AIOpenTrain AIOpenTrain AIDocs

Ask OpenTrain

Answers from the documentation, with sources.

What would you like to do with OpenTrain?

AI answers can be mistaken. Check the linked sources. Don’t include private account information.

Open app

DEVELOPER DOCUMENTATION

API Reference Overview

Base URLs, authentication, error envelope, and a map of every OpenTrain Public API endpoint.

Every page in this reference documents one endpoint by hand: parameters, response fields, scope and feature requirements, examples, and the errors you can actually hit. The machine-readable contract of record is the served spec — if a page and the spec ever disagree, the spec wins:

GET https://app.opentrain.ai/api/public/v1/openapi.json
https://app.opentrain.ai/api/public/v1

All endpoints (except the tokenless ones below) require a personal API token in the Authorization header:

Terminal window
curl -sS https://app.opentrain.ai/api/public/v1/auth/me \
-H "Authorization: Bearer $OT_API_TOKEN"

Tokens start with ot_pat_ and come from agent registration, the token management API, or in-app settings. See Authentication for the full lifecycle including the claim ceremony.

The four agent auth endpoints sit outside /v1 (at /api/agent/...) and use the OAuth wire shape ({"error": "...", "error_description": "..."}) instead of the envelope below.

Every non-2xx response from /api/public/v1/... has the same JSON shape:

{
"error": "Human-readable message",
"code": "FORBIDDEN",
"requestId": "9d1f3a8e-...",
"details": { "reason": "account_claim_required", "claimUrl": "https://app.opentrain.ai/claim" }
}

Include requestId when contacting support. The code enum, the details.reason catalog, cursor pagination, and rate limits are documented in Errors, Pagination, and Limits. Each endpoint page lists the errors specific to that endpoint.

At the top of each endpoint page you’ll find what that call needs:

RequirementMeaning
ScopeThe token scope checked for this call (:write scopes imply the matching :read)
FeatureAn account-level feature flag — probe job drafting through job capabilities and LMS through LMS capabilities
Claimed accountThe endpoint refuses unclaimed agent accounts with 403 + details.reason = "account_claim_required"

See Scopes and Capabilities for the full matrix.

FamilyEndpointsWhat it covers
Agent auth4Anonymous registration, claim ceremony, token polling, revocation
Auth1Who am I — token, scopes, account
Jobs10Marketplace search, your jobs, publish/close/update, invites, per-job proposals
Job drafts3Description-first drafting, gap-fill PATCH, capabilities probe
Proposals4Proposal detail, AI interview transcript, pre-hire conversation, hire
Freelancers1Public profile by ID or slug
Messages2Read and send messages in your conversations
Contracts4Contract reads, milestone creation, ending contracts
Milestones2Co-signed funding and approval
Approvals1Track pending human approvals
Project To-dos10Job requirements, safe assignment, native quiz authoring, results, review, and retakes
LMS and retrainingRetraining and hosted Preview endpointsIndividualized cases, hosted worker-renderer evidence, observe-only review links, exact-one assignment, live review, and closeout
Reviewer Feedback12 operationsEmployer-private reports, search, history, summaries, triage, subject linking, reviewer access, and feature settings
Task Checklists16 operationsAdaptive checklist authoring, validation, visual preview, versioned publishing, settings, and submission review
Updates1The pollable event delta feed
Credits4Balance, ledger, Stripe top-ups
Payments1Invoices awaiting action
Webhooks4Push-delivery subscriptions
Team2Organization members and invites
Tokens3Token management and rotation

Three marketplace read endpoints accept requests without any Authorization header (a token is still accepted and never hurts):

Endpoint pages display requests and responses in read-only form — there is no authenticated “try it” console, because the API does not accept cross-origin Authorization headers from the docs site. Copy the curl examples instead; every page also shows the CLI and MCP equivalents where they exist.