Skip to main content
Save a copy of the profile, memory, and action trail for an API key. The script is Python 3 and uses only the standard library. Every call sends Authorization: Bearer with that key. The base URL is https://api.lithtrix.ai.

What you can export

The action trail request uses the API’s default JSON response. The script writes that JSON to action_trail.json. File download is optional, and only for older agents that already have stored files. Newer agents have none. The script tries files last. If that step fails — for example HTTP 402, 403, or 404, or a missing field — it prints a short warning and still finishes. Profile, memory, and the action trail are already saved and do not depend on the file step.

Rate limits

A large memory export can hit the per-minute rate limit. The API then returns HTTP 429 with a Retry-After header. The script waits that many seconds (5 if the header is missing), plus one second, and retries the same request up to five more times.

How to run it

Save the script below as export_lithtrix.py. The script reads LITHTRIX_API_KEY from the environment when it is set. Otherwise it prompts with getpass.getpass(). The prompt hides the key. The script never prints it. Bash or zsh: type the key with echo off so the value is not stored in shell history, then run the script.
The read command waits with echo turned off. Type or paste the key and press Enter. Or run the script on its own and type the key at the prompt:
Omit the path to write ./lithtrix-export instead. Keep the key in the prompt or in LITHTRIX_API_KEY only — never on a command line, in a chat, or in a file.

Script

When the file step succeeds, the last line includes the file count. When it fails, that line says files skipped after the warning.

Not included

This export does not include:
  • Passport or identity key material
  • Reputation
  • Vouches