TypeScript & Python SDKs
One client for prompts, the gateway, and tracing.
Install one package and you get cached prompt rendering, an OpenAI-compatible chat call, tool loops that stay in a single trace, and feedback — with the same surface in both languages.
The surface
Six methods cover the whole platform.
The Python client is a full async port of the TypeScript one, so every capability below exists in both — only the naming convention changes.
prompts.render()Resolve a prompt by name and alias
Returns the templated messages plus the version's attached tools. Cached locally per prompt and alias: a fresh entry answers with no network call, a stale one answers immediately and refreshes in the background, so promoting a new version never adds latency to the call that noticed.
gateway.chat()Call any model through the gateway
One OpenAI-compatible completion. Pass stream for token-by-token output, and read the gateway metadata — provider, priced cost, cache status — off the same result.
gateway.runToolLoop()gateway.run_tool_loop()Run the whole function-calling loop
Hand it messages, tools, and a dispatch map. It runs the turns, dispatches tool calls concurrently, and threads a single trace id through all of them — so a five-turn agent is one trace, not five orphans.
traces.ingest()Record a step the gateway never saw
Report a span yourself for work that happens outside a model call — a retrieval step, a database read, a validation pass — and it joins the same trace tree.
traces.submitFeedback()traces.submit_feedback()Attach feedback in code
Send a rating, label, or comment against a trace or one span, then update it later. This is the raw material an evaluation dataset is built from.
traces.get() · traces.list()Read traces back
Fetch one trace with its spans, tokens, latency, and cost, or list traces with filters — useful for assertions in your own test suite.
TypeScript
TypeScript SDK
Node 18 or newer · ships its own types
Tutorials
- Register and fetch a prompt
- Call the gateway with chat()
- Register a tool with a decorator
- Group calls into sessions and traces
- Leave feedback on a trace
Python
Python SDK
Python 3.9 or newer · async, built on httpx
Tutorials
- Register and fetch a prompt
- Call the gateway with chat()
- Register a tool with a decorator
- Group calls into sessions and traces
- Leave feedback on a trace
No SDK? No problem
Everything is plain REST underneath.
The SDKs are conveniences, not gatekeepers. Every capability on this page is an HTTP endpoint you can call from any language — and the gateway speaks the OpenAI wire format, so most existing clients already work.