Skip to main content
Read agent records from a server-side Python script using Requests. This example checks your API key, limits network waits, validates the response fields it uses, and supports pagination.
The first-party Threetone Python SDK is planned. No verified installable release has been identified. requests is an HTTP library, and the example below calls the public REST API directly.

Before you start

Use a supported Python release and a personal API key with permission to read agents. Set THREETONE_API_KEY in the environment where your script runs. Keep it out of source files and logs. Install the HTTP dependency:

Read a page of agents

Save this as list_agents.py. It reads up to 20 agents through List agents.
list_agents.py
Run the script in the environment that contains your key:
A successful request prints the ID and name of each returned agent, followed by whether another page is available. An empty list prints no agent rows. The example checks only the fields it consumes, not the complete response schema. The timeout sets a five-second connection wait and a 30-second read inactivity limit. It is not a deadline for the entire download. Redirects are disabled to avoid forwarding the API key to another destination.

Read the next page

When has_more is true, call list_agents(cursor=next_cursor) to read the next page. Continue with each newly returned cursor until has_more is false. Do not alter or construct cursor values. page_size accepts 1 to 100 and defaults to 30 when omitted. The example uses 20. If you add filters, keep them the same while following a cursor. Use Get agent when you need one agent’s complete saved configuration.

Troubleshoot a request

For 401, check the key and its expiry. For 403, check its permissions and workspace access. For 429, follow Retry-After when supplied. See Errors and retries before adding automatic retries. The error context includes the method, path, status, and an escaped request ID limited to 128 characters. It excludes the key and response body. A connection failure or timeout may have no response status or request ID.

Frequently asked questions

No. It is a general-purpose Python HTTP library. The Threetone Python SDK is planned, and no first-party package name is documented for installation yet.
No. It sends a GET request and reads existing records. A successful read does not start a conversation or verify execution availability.
Confirm that the key belongs to the intended workspace and can access its agents. The list excludes archived agents by default. Check the filters in List agents.