Skip to main content
POST
Record a trajectory reward

Authorizations

Authorization
string
header
required

Short-lived token scoped to one rollout trajectory

Path Parameters

trajectory_id
string
required

Body

application/json
reward_id
string
required

Caller-owned id used to dedupe retries of the same reward component.

Required string length: 1 - 128
name
string
required

Reward component name. Each call adds one component; the trajectory's logged reward is the weighted average of its components' scaled values, (value - min_value) / (max_value - min_value).

Required string length: 1 - 64
value
number
required

Raw reward value within the declared inclusive bounds.

min_value
number
default:0

Minimum raw reward; must be less than max_value.

max_value
number
default:1

Maximum raw reward, must be larger than min_value

explanation
string
default:""

Human-readable reason for this component's value.

weight
number
default:1

Weight of this component in the trajectory's weighted average reward. Use 0 to store the component for diagnostics without counting it. If every component has weight 0, the trajectory's reward is 0.

Required range: x >= 0

Response

Successful Response

ok
boolean
required

True when the reward was stored or already present.

trajectory_id
string
required
status
string
required

Current trajectory status after the write.