Skip to main content

For AI agents: the documentation index is at /llms.txt, and this page is available as Markdown at /sdks/authentication.md.

Authenticate the SDK

Point TM_KEY_FILE at your key file and the SDK mints and refreshes tokens for you. Both SDKs read it from your environment. The Python SDK also loads a .env file; with TypeScript, run Node or Bun with --env-file=.env.

If you don't have a key file yet, see Create your API key.

.env: the two variables the SDKs read
# .env
TM_ENV=prod
TM_KEY_FILE=/path/to/your-api-key.json
VariablePurpose
TM_KEY_FILEPath to the downloaded API key file (JSON, contains key_id and the private JWK)
TM_ENVWhich environment to target, e.g. prod
Treat the key file like a password

Anyone with the key file can mint tokens as you. Keep it out of git and out of shared environments. If it leaks, revoke the key and create a new one at app.truemarkets.co.


Next: Quickstart