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

Get Contract

Read one contract in detail: status, milestone timeline, the hired AI trainer, budget state, and the post-hire conversation ID.

GET/api/public/v1/contracts/{contractId}

Reads one contract in full, in the same shape as the entries on GET /contracts plus two detail-only fields: jobDmConversationId — the post-hire 1:1 thread with the hired AI trainer, usable with GET /messages and POST /messages — and budget, the funded-vs-consumed budget snapshot.

Unknown contract IDs and contracts on other accounts both return 404, so contract IDs cannot be probed.

Requirements: payments:read scope. Works pre-claim.

contractIdstringpathrequired

The contract to read.

contractobject
contract
idstring

Contract ID.

statusstring

active or ended.

titlestring | null

Contract display title.

jobIdstring | null

The job this contract belongs to.

proposalIdstring | null

The proposal the hire came from.

paymentTypestring | null

FIXED_PRICE, PAY_PER_HOUR, or PAY_PER_LABEL.

rateUsdnumber | null

Contract rate in USD.

estimatedTotalUsdnumber | null

Estimated total contract value in USD.

estimatedVolumenumber | null

Estimated unit volume for per-unit contracts.

hasActiveMilestoneboolean

true when a funded milestone is in progress.

startDatestring | null

ISO contract start timestamp.

endDatestring | null

ISO contract end timestamp, null while active.

createdAtstring

ISO creation timestamp.

updatedAtstring

ISO last-change timestamp.

freelancerobject

The hired AI trainer: {userId, displayName, country, profilePath}. displayName is masked to first name + last initial ("Maria G.") — full last names and emails never appear (see privacy).

milestonesobject[]

Milestone timeline — same entry shape as on GET /contracts: {id, name, description, status, amountUsd, volume, milestoneNumber, dueDate, pendingApproval, needsReview, invoiceId, createdAt}.

jobDmConversationIdstring | null

The post-hire 1:1 conversation with the hired AI trainer. Pass to GET /messages to read it or POST /messages to message them.

budgetobject | null

Funded milestones vs work consumed: {contractId, paymentType, state, fundedVolume, fundedAmountUsd, consumed: {seconds, hours, labels, tasks}, consumedVolume, remainingVolume, consumedFraction, activeMilestone, lastUsageAt}. state is OK, LOW (≥ 80% of funded volume consumed), or DEPLETED (≥ 100%); volume is hours for PAY_PER_HOUR, labels for PAY_PER_LABEL; FIXED_PRICE contracts track progress only and always report OK. State changes emit the contract.budget_state_changed event — when it lands on LOW or DEPLETED, the usual move is to propose funding the next milestone. null when the budget cannot be computed. Only this detail endpoint returns it, not the list.

StatuscodeMeaning
401UNAUTHORIZEDMissing or invalid token
403FORBIDDENMissing payments:read scope
404NOT_FOUNDNo such contract, or the contract is on another account (details: {resource: "contracts", contractId})