Skip to content

Python SDK

The Python SDK is a typed client for Python 3.10 and later. Its run method runs a script and returns the result in one call, however long the script takes. Every other API operation is a method too. Each method and response takes its shape from the same definitions the API uses to validate requests, so the SDK always matches the API reference. It depends on httpx and pydantic.

Terminal window
pip install reminix

Create an API key in the app under Settings → Developers, and keep its access at Run scripts.

  • Reminix() reads your key from the REMINIX_API_KEY environment variable. If you haven’t set it, it reads REMINIX_TOKEN, the variable the CLI uses. With neither variable set, it raises an error.
  • To pass the key yourself, use Reminix(api_key=key).
  • With an API key, every call acts in the key’s workspace.
  • With a personal access token, pass it as token and name the workspace: Reminix(token=token, workspace="acme").
from reminix import Reminix
reminix = Reminix() # uses the REMINIX_API_KEY environment variable
run = reminix.run("monthly-report", {"month": "2026-09"})
print(run.output)

run returns once the script has finished:

  • A long run keeps going after the API call returns. run checks on it until it ends.
  • A run that needs a person’s approval waits for them. Pass on_approval to show them where to approve it: reminix.run(slug, inputs, on_approval=notify).
  • A run that fails or ends as cancelled raises a RunError. A run ends as cancelled when a person stops it, an approver denies it, or its approval expires. The error’s run has the run’s status, and the run’s error says why.
  • To get the run back straight away, pass wait=False. Later, reminix.wait_for_run(run) follows it until it ends. It also takes the run’s id.
  • poll_interval= sets how often run checks on a run that hasn’t ended, in seconds. It’s 2 by default.
  • timeout= limits each request run makes, as on every other method. If a request times out, run tries it again.
  • To limit the whole wait, use asyncio.timeout() with AsyncReminix. The run carries on when the wait stops.
  • To make calling again safe, such as from a job that reruns, pass idempotency_key=. A second call with the same key and inputs returns the first run instead of starting another.

The inputs are the script’s own fields, with the names the script gives them.

Give a file input as a pathlib.Path, a file opened with "rb", or a FileUpload. The SDK uploads the file first and passes its id. In this example, the monthly report takes an optional CSV file of manual adjustments and saves the report as a CSV file:

from pathlib import Path
from reminix import Reminix
reminix = Reminix() # uses the REMINIX_API_KEY environment variable
run = reminix.run(
"monthly-report",
{"month": "2026-09", "adjustments": Path("adjustments.csv")},
)
for file in run.files or []:
if file.origin == "saved":
print(file.name, file.download_url)

The files a run saves come back in run.files, each with a download link. Files has the details.

from reminix import Reminix
reminix = Reminix() # uses the REMINIX_API_KEY environment variable
runs = reminix.runs.list(script="monthly-report", limit=10)
print(runs.items)

Every API operation is a method, named after its CLI command. For example, reminix runs list becomes reminix.runs.list().

  • Ids in the path are arguments, and everything else is a keyword argument:

    reminix.scripts.update("monthly-report", name="Monthly report")
  • Keyword arguments use Python naming, so the API’s approvalPolicy becomes approval_policy=.

  • Creating a schedule or trigger needs a personal access token, not a workspace API key. Schedules and triggers explains why.

  • Because the types come from the API itself, your editor completes every method, keyword argument and response field.

A method returns a model of the response. Its fields are attributes in Python naming, so the API’s durationMs is run.duration_ms.

from reminix import Reminix
reminix = Reminix() # uses the REMINIX_API_KEY environment variable
run = reminix.runs.get("run_620f14ad-32e8-4f5e-89fd-1c80de7e9124")
print(run.status, run.duration_ms)
print(run.to_dict()) # the API's own field names
print(run.to_json())
  • to_dict() and to_json() return the fields the API sent, with the API’s field names.
  • The models are in reminix.types, such as reminix.types.Run. Each one is a pydantic model.
  • The SDK keeps a field the API adds later. You can read it by its API name until you update the SDK.
  • The SDK also keeps a value it doesn’t know yet, such as a new status, as it came. It never raises an error.
  • Timestamps are datetime objects.

A list method returns its first page. When you iterate over the page, the SDK fetches the next pages as it goes, so the loop sees every item:

from reminix import Reminix
reminix = Reminix() # uses the REMINIX_API_KEY environment variable
for run in reminix.runs.list(script="monthly-report"):
print(run.id, run.status)

To work one page at a time, use the page itself:

from reminix import Reminix
reminix = Reminix() # uses the REMINIX_API_KEY environment variable
page = reminix.runs.list(script="monthly-report", limit=10)
print(page.items, page.next_cursor)
if page.has_next_page():
page = page.get_next_page()

Pagination has the details.

Every error a call raises is a ReminixError. When the API returns an error, the SDK raises an APIError of the class for its HTTP status:

Status Error
400 BadRequestError
401 AuthenticationError
402 PlanLimitError
403 PermissionDeniedError
404 NotFoundError
409 ConflictError
422 UnprocessableEntityError
429 RateLimitError
500 or above InternalServerError
Any other APIError

An APIError carries these attributes:

Attribute What it holds
status_code The HTTP status.
code The error’s code, such as not_found.
message What went wrong.
request_id The request’s id. Quote it when you contact us.
details What was wrong with each field, as {"path", "message"} entries.
docs A link to the code’s entry on the Errors page.
headers The response’s headers, such as Retry-After.

When the SDK can’t reach the API, it raises an APIConnectionError. An attempt that runs out of time raises an APITimeoutError, a kind of APIConnectionError. Either one keeps the network error as its __cause__.

A run that fails raises a RunError, which is a ReminixError too:

from reminix import APIConnectionError, NotFoundError, Reminix, RunError
reminix = Reminix() # uses the REMINIX_API_KEY environment variable
try:
run = reminix.run("monthly-report", {"month": "2026-09"})
except NotFoundError:
print("No such script")
except RunError as error:
print(error.run.error)
except APIConnectionError:
print("The API couldn't be reached. Try again later.")

The SDK retries a failed attempt twice: after a network error, a timeout, a 408, a 429, a 500, 502, 503 or 504, or a 409 with the code idempotency_in_progress.

  • It waits as long as Retry-After asks, up to 60 seconds. When the API asks for longer, the SDK raises the error instead.

  • Every write sends an idempotency key, the same on each retry, so the write happens only once.

  • To make your own retries safe too, pass your key:

    from reminix import Reminix
    reminix = Reminix() # uses the REMINIX_API_KEY environment variable
    run = reminix.runs.create(
    "monthly-report",
    inputs={"month": "2026-09"},
    idempotency_key="monthly-report-2026-09",
    )
  • To change how often it retries, pass max_retries= to the client or to with_options().

Each attempt waits up to 60 seconds for a response. The SDK retries a timed-out attempt with the same key. To change the limit, pass timeout= in seconds to the client, to one call, or to with_options() for the calls made through it:

from reminix import Reminix
reminix = Reminix() # uses the REMINIX_API_KEY environment variable
reminix.scripts.get("monthly-report", timeout=5)
reminix.with_options(timeout=5, max_retries=0).scripts.get("monthly-report")

To limit a whole AsyncReminix call, retries included, wrap it in asyncio.timeout(). Past it, the call stops at once, even while it waits to retry, and raises a TimeoutError.

Option What it does
api_key Your API key. Without it, REMINIX_API_KEY, then REMINIX_TOKEN.
token A personal access token, used with workspace.
workspace The workspace a personal access token acts in.
environment The environment to act in, sent as X-Environment. Without it, the workspace’s default.
base_url The API’s address, without /v1. Without it, REMINIX_BASE_URL, then the live API.
timeout The seconds each attempt may take. 60 by default.
max_retries How many times to retry a failed attempt. 2 by default.
default_headers Headers to send with every call.
http_client Your own httpx.Client, or httpx.AsyncClient for AsyncReminix.

Every method also takes these keyword arguments:

Argument What it does
idempotency_key Your key for this write. Writes only.
extra_headers Headers to send with this call only.
timeout The seconds each attempt of this call may take.

with_options() takes timeout, max_retries and default_headers. It returns the same client with those defaults. Its default_headers go with the client’s own, not in place of them.

Here is every method. Each one links to its fields and a full example under Endpoints:

Scripts

scripts.archive()
Archive a script
scripts.create()
Create a script
scripts.get()
Get a script
scripts.list()
List scripts
scripts.restore()
Restore an archived script
scripts.update()
Change a script

Runs

runs.cancel()
Cancel a run
runs.create()
Run a script
runs.get()
Get a run
runs.list()
List runs
runs.log()
Get a run's log

Versions

script_versions.get()
Get a version
script_versions.list()
List a script's versions
script_versions.publish()
Publish a version
script_versions.test_run()
Test-run a version
script_versions.upload()
Upload a version

Schedules

schedules.create()
Schedule a script
schedules.delete()
Delete a schedule
schedules.get()
Get a schedule
schedules.list()
List a script's schedules
schedules.update()
Change a schedule

Triggers

triggers.create()
Run a script when something happens
triggers.delete()
Delete a trigger
triggers.get()
Get a trigger
triggers.list()
List a script's triggers
triggers.rotate_secret()
Rotate a webhook trigger's secret
triggers.update()
Change a trigger

Files

files.content()
Get a file's content
files.get()
Get a file
files.list()
List files
files.upload()
Upload a file

Environments

environments.create()
Add an environment
environments.delete()
Delete an environment
environments.get()
Get an environment
environments.list()
List environments
environments.update()
Change an environment

Secrets

secrets.delete()
Delete a secret
secrets.get()
Get a secret
secrets.list()
List secrets
secrets.update()
Update a secret
secret_values.delete()
Remove a secret's value from an environment
secret_values.set()
Save a secret's value

Script settings

script_settings.get()
Get the workspace's script settings
script_settings.update()
Change the workspace's script settings

Trigger calls

trigger_calls.list()
List a webhook trigger's calls

Workspace

workspace.get()
Get the current workspace
workspace.invitations.list()
List pending invitations
workspace.members.list()
List workspace members
workspace.plan_usage.get()
Get your plan's usage this period
workspace.teams.list()
List teams

Webhooks

workspace.event_types.list()
List event types
workspace.webhook_deliveries.list()
List an endpoint's deliveries
workspace.webhook_deliveries.redeliver()
Redeliver an event
workspace.webhook_endpoints.create()
Add a webhook endpoint
workspace.webhook_endpoints.delete()
Remove a webhook endpoint
workspace.webhook_endpoints.enable()
Re-enable a webhook endpoint
workspace.webhook_endpoints.get()
Get a webhook endpoint
workspace.webhook_endpoints.list()
List webhook endpoints
workspace.webhook_endpoints.test()
Send a test event
workspace.webhook_endpoints.update()
Update a webhook endpoint

Approvals

workspace.approval_actions.list()
List the actions you can ask approval for
workspace.approval_requests.create()
Ask a person to approve an action
workspace.approval_requests.get()
Check an approval request
workspace.approval_requests.redeem()
Redeem an approved request

Audit events

workspace.audit_events.list()
List workspace audit events

Personal access tokens

user.me()
Get the current user
user.revoke_token()
Revoke the token making this request

AsyncReminix has the same methods, and you await each call. A list is the exception. You await it for its first page, or use async for to go through every item:

import asyncio
from reminix import AsyncReminix
async def main() -> None:
async with AsyncReminix() as reminix: # uses the REMINIX_API_KEY environment variable
run = await reminix.run("monthly-report", {"month": "2026-09"})
print(run.output)
async for past in reminix.runs.list(script="monthly-report"):
print(past.id, past.status)
asyncio.run(main())

async with closes the client when the block ends. Without it, call await reminix.close() when you’re done.