opentrain command surface on one page. Every command supports --json (raw API response) and --base-url <url> (override the API origin); those two flags are omitted from the per-command tables below. Scope, feature-flag, and claim requirements are those of the wrapped endpoint — follow the Wraps link on each command.
See the CLI overview for installation, credentials, and conventions.
Global
Auth and Identity
whoami
auth status — prints the authenticated user, token label, scopes, and account type.
Wraps GET /api/public/v1/auth/me.
auth register
ot_pat_ token plus the claim token to the credentials file. Fails if credentials already exist unless --force is passed.
| Flag | Description |
|---|---|
--agent-name <name> | Display name for the agent identity (alias --name) |
--org-name <name> | Name for the employer organization created with the account (alias --organization-name) |
--force | Overwrite existing saved credentials |
POST /api/agent/identity.
auth claim
auth register.
| Flag | Description |
|---|---|
--email <address> | Required. The human owner’s email address |
--claim-token <token> | Claim token to use; defaults to the saved one |
POST /api/agent/identity/claim.
auth claim-status
--wait it checks once and reports pending; with --wait it polls (respecting slow_down backoff) until claimed or the timeout elapses.
| Flag | Description |
|---|---|
--wait | Poll until the claim completes |
--timeout <seconds> | Give up waiting after this long (default 1800) |
--claim-token <token> | Claim token to check; defaults to the saved one |
POST /api/agent/oauth/token.
auth login
ot_pat_ token against the API, then saves it to the credentials file.
| Flag | Description |
|---|---|
--api-key <token> | Required. The personal API token (alias --token) |
GET /api/public/v1/auth/me for verification.
auth status
whoami. Wraps GET /api/public/v1/auth/me.
auth logout
tokens revoke for that.
Jobs
jobs draft create
ask: question, type, allowed enum values, and the field name to set with jobs draft update. Alias: jobs create.
| Flag | Description |
|---|---|
--description <text> | Plain-text job description or project brief |
--description-file <path> | Read the description from a file instead |
--canonical-file <path> | JSON file with an OpenTrain canonical job object |
--payload-file <path> | JSON file with a supported import payload (e.g. schema.org JSON-LD) |
--title <title> | Title to prepend to plain-text descriptions |
--external-id <id> | Source-system id for audit |
--idempotency-key <key> | Reuse to avoid duplicate drafts on retry |
POST /api/public/v1/job-drafts.
jobs draft update
--set values are auto-coerced (numbers, booleans, JSON arrays; everything else stays a string); repeat the loop until the draft is publish-ready. Alias: jobs update.
| Flag | Description |
|---|---|
--job-id <id> | Required. The draft job id |
--set <field=value> | Set one field (repeatable) — use the set: field names from the validation output |
--patch-file <path> | JSON file with a field patch object (alternative to --set) |
--patch-json <json> | Inline JSON patch object (alternative to --set) |
PATCH /api/public/v1/job-drafts/{jobId}.
jobs list
| Flag | Description |
|---|---|
--status <status> | Filter: DRAFT, OPEN, ONGOING, COMPLETED, ARCHIVED, PENDING_APPROVAL |
--limit <n> | Page size (max 100, default 25) |
--cursor <cursor> | Pagination cursor from the previous page |
GET /api/public/v1/jobs/mine.
jobs search
| Flag | Description |
|---|---|
--q <text> | Free-text query |
--category <slug> | Category filter |
--language <lang> | Language filter |
--country <iso> | ISO country code |
--pay-type <type> | PAY_PER_HOUR, FIXED_PRICE, or PAY_PER_LABEL |
--limit <n> / --cursor <c> | Pagination |
GET /api/public/v1/jobs.
jobs publish
POST /api/public/v1/jobs/{id}/publish.
jobs invite
POST /api/public/v1/jobs/{id}/invites.
jobs close
POST /api/public/v1/jobs/{id}/close.
jobs update-published
OPEN) job using the same field names and --set/--patch-file/--patch-json flags as jobs draft update. The revised listing is re-moderated; a blocked result unpublishes the job back to draft.
Wraps PATCH /api/public/v1/jobs/{id}.
Proposals and Candidates
proposals list
| Flag | Description |
|---|---|
--job-id <id> | Required. The job to list proposals for |
--status <status> | Filter, e.g. UNREVIEWED, SHORTLISTED, HIRED, DECLINED |
--limit <n> / --cursor <c> | Pagination (max 100, default 25) |
GET /api/public/v1/jobs/{id}/proposals.
proposals get
--interview also fetches the sanitized AI-interview transcript. Alias: proposal get.
Wraps GET /api/public/v1/proposals/{proposalId} and, with --interview, GET /proposals/{proposalId}/interview.
proposals hire
202 with an approvalUrl a signed-in human must confirm in the OpenTrain app; on confirm, the contract is created and the first escrow milestone funded. A 409 payment_method_required includes a billingUrl a human must visit. Alias: proposal hire.
| Flag | Description |
|---|---|
--proposal-id <id> | Required. The proposal to hire from |
--amount <usd> | Required. First milestone amount in USD |
--milestone-name <name> | Short milestone name |
--milestone-description <text> | What the first milestone delivers |
--due-date <iso> | Milestone due date (ISO 8601) |
--confirm-not-fit-override | Confirm hiring a candidate previously marked “Not a fit” after a 409 not_fit_confirmation_required |
POST /api/public/v1/proposals/{proposalId}/hire.
freelancers get
freelancer get.
Wraps GET /api/public/v1/freelancers/{idOrSlug}.
Messages
messages list
GET /api/public/v1/messages.
messages unread
messages list --unread-only — only conversations with unread messages.
messages read
GET /api/public/v1/messages?conversationId=....
messages send
--content-file <path> to read the message body from a file.
Wraps POST /api/public/v1/messages.
messages start-proposal-thread
conversationId to use with messages send.
Wraps POST /api/public/v1/proposals/{proposalId}/conversation.
Contracts and Milestones
contracts list
conversationId.
Wraps GET /api/public/v1/contracts.
contracts get
contract get.
Wraps GET /api/public/v1/contracts/{contractId}.
contracts end
approvalUrl a human must confirm.
Wraps POST /api/public/v1/contracts/{contractId}/end.
milestones create
| Flag | Description |
|---|---|
--contract-id <id> | Required. The contract to add to |
--description <text> | Required. What the milestone delivers |
--name <name> | Short milestone name |
--amount <usd> | Milestone amount in USD |
--volume <n> | Unit volume for per-unit milestones (e.g. label count) |
--due-date <iso> | Due date (ISO 8601) |
POST /api/public/v1/contracts/{contractId}/milestones.
milestones fund
approvalUrl a signed-in human must open and confirm (expires in ~72 h). Track with approvals get or updates poll.
Wraps POST /api/public/v1/milestones/{milestoneId}/fund.
milestones approve
milestones fund.
Wraps POST /api/public/v1/milestones/{milestoneId}/approve.
approvals get
pending, confirmed, declined, or expired, plus the execution result once confirmed. Alias: approval get.
Wraps GET /api/public/v1/approvals/{approvalId}.
Credits
credits show
credits balance.
Wraps GET /api/public/v1/credits.
credits ledger
GET /api/public/v1/credits/ledger.
credits top-up
checkoutUrl a human must open and pay — no money moves from the command itself.
Wraps POST /api/public/v1/credits/top-ups.
credits top-up-status
GET /api/public/v1/credits/top-ups/{topUpId}.
Updates
updates poll
nextCursor and pass it as --cursor on the next poll.
Wraps GET /api/public/v1/updates.
Webhooks
webhooks create
X-OpenTrain-Signature header.
| Flag | Description |
|---|---|
--url <url> | Required. HTTPS delivery endpoint |
--events <type,...> | Required. Comma-separated event types, e.g. proposal.received,message.received |
POST /api/public/v1/webhooks.
webhooks list
ACTIVE or DISABLED). Secrets are never included.
Wraps GET /api/public/v1/webhooks.
webhooks get
--webhook-id. Alias: webhook get.
Wraps GET /api/public/v1/webhooks/{webhookId}.
webhooks delete
DISABLED subscription is resumed (the new one gets a new secret).
Wraps DELETE /api/public/v1/webhooks/{webhookId}.
Tokens
tokens list
GET /api/public/v1/tokens.
tokens revoke
DELETE /api/public/v1/tokens/{tokenId}.
There is no
tokens create command — mint new tokens over HTTP with
POST /tokens or in the OpenTrain
app’s settings.Team
team show
GET /api/public/v1/team.
team invite
POST /api/public/v1/team/invites.
Payments
payments pending
GET /api/public/v1/payments/pending.