Skip to main content
Rhetoric publishes official client libraries for TypeScript, Python, and Rust. Each one exposes every operation in the API reference with typed inputs and outputs, so you can call Rhetoric without hand-writing HTTP requests. They are meant to be used on your backend, where your API key lives.

Install

The Python package is installed as rhetoric_py but imported as rhetoric.

Create a client

Every client takes the API URL and an API key. Keep the key on your backend.

Make a request

Operations are methods on the client. This example creates a filer and then starts a filing session for them.
The session token is only returned once, at creation time. Pass it to your frontend so the Element can drive the session.

Error handling

Each library reports failures in the way that is idiomatic for its language:
  • TypeScript throws an error when an operation fails.
  • Python raises an exception when an operation fails.
  • Rust returns an Err when an operation fails.

Command line

If you would rather explore the API from a terminal, the Rhetoric CLI exposes the same operations as commands.