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

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.22
File Size Uploaded
trajectory_sdk-0.6.22.tar.gz 81.7 kB Details

Built distribution (wheel)

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

Total release size: 237.3 kB

Release files / trajectory_sdk-0.6.22.tar.gz

Download URL trajectory_sdk-0.6.22.tar.gz
Size 81.7 kB
Tags Source
SHA-256 checksum
How to use checksums
57168ab491e144ed869b2d088628e8c8ab45eb4b0b1575415f11fcb305245b28
BLAKE2b-256 checksum
How to use checksums
c256be93f167c64407a3faefc218925c66968bd3e3b1b6293f4712d36c825953
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.22-py3-none-any.whl

Download URL trajectory_sdk-0.6.22-py3-none-any.whl
Size 155.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
717e348457b5f1a068fd65fa2fc7c96096c4bf9f0caa915fd0b1f31c621298cd
BLAKE2b-256 checksum
How to use checksums
d28ab78b8f7e785a0073e415ab3d14b388e4e9a5d5377ae4fda4f48df554498a
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

This release

0.6.22 This release

2 release files

0.6.21

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