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.20

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.20
File Size Uploaded
trajectory_sdk-0.6.20.tar.gz 81.6 kB Details

Built distribution (wheel)

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

Total release size: 237.1 kB

Release files / trajectory_sdk-0.6.20.tar.gz

Download URL trajectory_sdk-0.6.20.tar.gz
Size 81.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e65a6ce7129f6afb43cbb3179816e84a1c0f14d3ebaa156bc5d56aef4b864cb1
BLAKE2b-256 checksum
How to use checksums
68173b939d27c5bbcdaf9e3d7e2bdf2b296c11b0ab388d33f38ae40af3316daa
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.20-py3-none-any.whl

Download URL trajectory_sdk-0.6.20-py3-none-any.whl
Size 155.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ea9ddbd3b3ad6a54b0f3ab5b61fd201b670c621bd9c2932bbe5868419ff74e0
BLAKE2b-256 checksum
How to use checksums
d899e1cc337d231e41182a1c2644b04336176a3f3541d4adcb4ec62e71c03d8d
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

0.6.21

2 release files

This release

0.6.20 This release

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