The Tally TypeScript SDK is published asDocumentation Index
Fetch the complete documentation index at: https://docs.tallyforagents.com/llms.txt
Use this file to discover all available pages before exploring further.
@tallyforagents/sdk. It targets Node 20+ and uses the platform’s native fetch — no extra dependencies for the network layer.
Install
pnpm, yarn, and bun work the same way. The SDK has no peer dependencies and ships its own type definitions.
Construct a client
new Tally({ apiKey }) is the only call you’ll make to set up. The returned client exposes agents, payments, and webhooks resources.
ClientOptions
| Field | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | A Tally API key starting with tly_test_ (test mode) or tly_live_ (live mode). |
baseUrl | string | No | Base URL of the Tally API. Defaults to http://localhost:3000. Production callers should set this explicitly. |
fetch | typeof fetch | No | Custom fetch implementation. Useful for tests, non-Node runtimes, or wrapping with retry middleware. |
API key validation
The constructor validates the key prefix and throws aTallyError (type: "validation_failed") if the key doesn’t start with tly_test_ or tly_live_. This catches misconfigured environments at startup, not at first request.
Setting baseUrl in production
The SDK defaults baseUrl to http://localhost:3000 so a fresh install Just Works against a locally running Tally. For any deployed environment, set it explicitly:
https://api.example.com/ and https://api.example.com are equivalent.
Custom fetch
If you want to wrap requests with logging, retries, or use a runtime where globalThis.fetch isn’t available, pass a custom implementation:
idempotency_key pattern.
Request shape
Every SDK call goes through one HTTP request. Headers Tally sends:| Header | Value |
|---|---|
Authorization | Bearer <apiKey> |
Content-Type | application/json (when there’s a body) |
Accept | application/json |
Minimal end-to-end example
The smallest working app: load an env, construct a client, upsert an agent.node --env-file=.env.local index.ts (Node 20+) and you should see agent smoke-test status=no_permissions.