Skip to main content

Python SDK for the Durable Agents public API.

Project description

Durable Agents Python SDK

First-party Python SDK for the Durable Agents public API.

Install

Production:

pip install durable-agents-sdk

The SDK defaults to https://www.durableagents.ai. You can override the API base URL at runtime with base_url or DURABLE_API_BASE_URL.

Quickstart

import os

from durable_agents import DurableClient

client = DurableClient(api_key=os.environ["DURABLE_API_KEY"])
models = client.models.list()
print(models)
client.close()

Override the API base URL explicitly:

client = DurableClient(
    api_key=os.environ["DURABLE_API_KEY"],
    base_url="https://www.durableagents.ai",
)

Agents And Runs

agent = client.agents.create({
    "name": "SDK smoke agent",
    "instructions": "Reply concisely.",
})

run = client.agents.start(agent["id"], {
    "prompt": "Reply with READY only.",
})

Stream run events:

for event in client.runs.watch(run["id"]):
    print(event.event, event.data)

Data Sources

sources = client.sources.list(limit=50)
print(sources)

Pagination

for agent in client.agents.iterate(limit=100):
    print(agent)

Errors

from durable_agents import DurableApiError

try:
    client.models.list()
except DurableApiError as error:
    print(error.status_code, error.code, error.request_id, error.details)
    raise

Generated Client

The public compatibility surface is DurableClient. Kiota-generated low-level code is also available under durable_agents.generated for advanced users, but it is not the primary ergonomic API.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

durable_agents_sdk-1.0.20260608003.dev0.tar.gz (69.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file durable_agents_sdk-1.0.20260608003.dev0.tar.gz.

File metadata

File hashes

Hashes for durable_agents_sdk-1.0.20260608003.dev0.tar.gz
Algorithm Hash digest
SHA256 8140f6bf00194cd3f4b1c317b07d261634f204a70d5c9d1f7f3e5c995601993e
MD5 0fd38e52f50442696f801e08e7a85408
BLAKE2b-256 6dda0766bdd5971b5aefad1fcf3f9adcb0d9f624e197f28ee6edfaae9fc82d78

See more details on using hashes here.

File details

Details for the file durable_agents_sdk-1.0.20260608003.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for durable_agents_sdk-1.0.20260608003.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 80b9f0c3d1410bc1d7d24fe354685746ed9139a873aab1d80465395c2560a592
MD5 edbd3c079f9ab1fcf7937919f30d5adc
BLAKE2b-256 2f6e4d59711d33f157e86f8b045e89c5f486f03ccb1105e49b5c9bbb89911a10

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page