These examples use the production API address and adapt the trajectory request schema and reference client. They have not been run against production. The response fields shown are those used by the client.
Choose the API surface
Creating a Domain does not configure its trajectory learner. For the numeric pipeline, the mechanism lives inside the
config object sent to /trajectory/configure. It does not belong inside DomainCreateRequest.learning, query_templates, or a generic /schemas request.
Production URL and authentication
Authorization: Bearer <Unit API Key> and Content-Type: application/json. Keep the key server-side. The bearer token determines the owner; omit body session_id and never send a trusted owner header to select a tenant.
Define the vector schema
Consider a planar platform with two continuous control coordinates. This small example has four state coordinates and up to eight commands. Replace these choices with your own measured interface.
The goal is a desired state, not a successful control sequence.
goal_indices: [0, 1] maps the two goal coordinates into the state vector. Every index must be smaller than state_dimensions; the goal length must equal the number of goal indices.
Keep names, units, ordering, scaling, and invalid-measurement rules in an application-owned manifest. The trajectory API receives numeric arrays; it cannot infer the physical meaning of an array position.
Separate API configuration from executor configuration
For this example, the application holds each command for 0.5 seconds and uses a fixed eight-slot execution window. If structural deletion shortens the logical sequence, it appends neutral commands to the unused slots. That preserves the physical duration while the logical command list changes.
command_duration, action_bounds, and padding are not fields in the referenced trajectory configuration schema. Do not insert them into the API body. Implement and version them in your executor. A neutral command means the declared neutral actuator input; it does not imply that the moving platform stops immediately.
For a concrete outcome contract, define completion as finishing within 0.05 metres of the goal with speed at most 0.1 metres/second. Assess it after the eight-slot window, or at a declared earlier task-terminal state. A safety stop does not count as completion. The acquisition reward and structural completion objective both use float(completed). These tolerances are example application settings; choose and keep fixed the values appropriate to your task.
Create and configure
Choose a fresh run-specific Domain ID. POST tohttps://rei-neuroadapt-api.reilabs.org/api/v1/domains:
{} to /domains/control-example-UNIQUE-acquisition/trajectory/state. The reference client requires status: "not_configured" before configuring a fresh trajectory learner. This check concerns trajectory state; it does not assert that every possible Domain subsystem is empty.
POST to /domains/control-example-UNIQUE-acquisition/trajectory/configure, relative to the production base:
Acquisition fields
These limits come from the reference request schema. A deployed service can impose lower account or runtime limits. Read and save the resolved configuration; do not assume schema maxima are available capacity.
For
reward, explicitly return the application’s measured outcome after execution. Keep its direction and scale fixed. Use goal_error only with an adapter that implements the deployed goal-error contract; changing the string does not change your scorer automatically.
Optional acquisition profile
The reference sequence client explicitly enables the following options. They are supported field names from that configuration, not settings required for every task:config before initial configuration, not a separate endpoint or a live patch request. The minimal example leaves native defaults in place. Enable progress-related options only with a defined, measured per-command outcome stream; do not manufacture intermediate outcomes from the terminal value. Save the full resolved settings with the run.
Shared Python request helper
The following helper uses the Python standard library. SetADAPT1_API_KEY in the server process environment. All later snippets use these functions and the same PREFIX.
PREFIX once, then persist and reload it to resume. Regenerating it creates a new lineage. The helper performs HTTP requests; it is not a simulator, scheduler, durable journal, or retry manager. Add request-intent and response recording before using it for a long run, as described in Retained use and recovery.
Choose the next guide
Acquire a sequence
Propose, execute, validate, and return actual trajectory observations.
Structural stages
Export acquired records and run selection, deletion, and ordering.
Contextual refinement
Configure contexts and evaluate candidate offsets around a retained base.
Retained use and recovery
Use learned state without writes and reconcile interrupted operations.