Skip to main content

Trajectory SDK

Generated Python client for the Trajectory API, with high-level workflows for uploading trajectories, telemetry, and runtime-backed benchmarks.

Install

pip install trajectory-sdk

Quick start

Set TRAJECTORY_API_KEY, then create a client:

from trajectory import Client

client = Client()
benchmarks = client.benchmarks.list(limit=10)

Create a trajectory with an authenticated client, then pass its ID explicitly to inference, rewards, and completion. MODEL_ENDPOINT_ACCESS_TOKEN, when set, lets creation reuse the runtime's precreated trajectory instead of creating another one:

from trajectory import Client

client = Client(api_key="<your-api-key>")
tid = client.trajectories.create().tid
response = client.chat.completions.create(
    model="policy", messages=messages, x_trajectory_id=tid,
)
client.trajectories.log_reward(tid, reward_id="primary", name="correct", value=reward)
client.trajectories.complete(tid, termination_reason="ENV_DONE")

Client does not read TRAJECTORY_TID. Authentication and base URL environment defaults, and generated model endpoint token/ID defaults, remain supported.

SDK-owned HTTP clients use a 600-second read/write/pool timeout and a 5-second connection timeout. Supplying http_client= inherits that client's timeouts, including a bare HTTPX client's 5-second default. An explicit Client(timeout=...) overrides the supplied client; a resource method's timeout= overrides that request. timeout=None disables timeouts. Retry counts are unchanged.

The generated resource methods map directly to the public HTTP API. Benchmark submission and file-upload workflows are available from trajectory.lib; see the benchmark guide.

Development

uv run pytest
uv run ruff check .
uv run ruff format --check .

The generated client lives in src/trajectory/. Handwritten workflows live in src/trajectory/lib/, and tests live in tests/.

License

Apache 2.0

Release files for trajectory-sdk 0.6.21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trajectory-sdk 0.6.21
File Size Uploaded
trajectory_sdk-0.6.21.tar.gz 81.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for trajectory-sdk 0.6.21
File Interpreter ABI Platform
trajectory_sdk-0.6.21-py3-none-any.whl Python 3 none any Details

Total release size: 237.2 kB

Release files / trajectory_sdk-0.6.21.tar.gz

Download URL trajectory_sdk-0.6.21.tar.gz
Size 81.7 kB
Tags Source
SHA-256 checksum
How to use checksums
68a9834a68c0c1965f4980c5c56a099a452baaa01076b8eda7d0d0ca16597170
BLAKE2b-256 checksum
How to use checksums
c4a55838f2428596e67c7ec7787c1f381e687f99a989bd7e847bc3ee1f1febac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release files / trajectory_sdk-0.6.21-py3-none-any.whl

Download URL trajectory_sdk-0.6.21-py3-none-any.whl
Size 155.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6ea82ef5a4bdec976843cb687f7da61c83567307a70390647c80e93cd9c8a2e4
BLAKE2b-256 checksum
How to use checksums
b55d0d247d5f44eb85ab08a82aad4335e87993ac4668d13096c34b92d36159e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.26

2 release files

0.6.25

2 release files

0.6.24

2 release files

0.6.23

2 release files

0.6.22

2 release files

This release

0.6.21 This release

2 release files

0.6.20

2 release files

0.6.19

2 release files

0.6.18

2 release files

0.6.17

2 release files

0.6.16

2 release files

0.6.15

2 release files

0.6.14

2 release files

0.6.13

2 release files

0.6.12

2 release files

0.6.11

2 release files

0.6.10

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.11

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page