Python SDK: Agents

⚠️
Preview — this feature is being built; the design below is the spec.

Agent definitions and their versions.

from syntic import Syntic
 
client = Syntic()  # reads SYNTIC_API_KEY
MethodEndpointReturns
agents.createPOST /v1/agentsAgent
agents.listGET /v1/agentsSyncPage[Agent]
agents.retrieveGET /v1/agents/{agent_id}Agent
agents.updatePATCH /v1/agents/{agent_id}Agent
agents.versions.listGET /v1/agents/{agent_id}/versionsSyncPage[AgentVersion]
agents.archivePOST /v1/agents/{agent_id}/archiveAgent

Methods

agents.create

Create a versioned agent definition. Maps to POST /v1/agents.

result = client.agents.create(
    name="refund-helper",
    model="Amara S1.2",
    instructions="You help customers with refunds.",
)

agents.list

List agents. Maps to GET /v1/agents.

for item in client.agents.list(limit=50):
    print(item.id if hasattr(item, 'id') else item)

agents.retrieve

One agent at its latest or a given version. Maps to GET /v1/agents/{agent_id}.

result = client.agents.retrieve('agt_01JC4R8W6Q2N9X3T5V7Y')

agents.update

Change the definition; creates a new version. Maps to PATCH /v1/agents/{agent_id}.

result = client.agents.update('agt_01JC4R8W6Q2N9X3T5V7Y', instructions="…")

agents.versions.list

All versions. Maps to GET /v1/agents/{agent_id}/versions.

for item in client.agents.versions.list('agt_01JC4R8W6Q2N9X3T5V7Y'):
    print(item.id if hasattr(item, 'id') else item)

agents.archive

Stop new sessions from using it. Maps to POST /v1/agents/{agent_id}/archive.

result = client.agents.archive('agt_01JC4R8W6Q2N9X3T5V7Y')

Conventions

Every method accepts extra_headers, extra_query, extra_body and timeout keyword arguments, and has an async twin on AsyncSyntic. List methods return pages that iterate across all pages automatically.

See the Python SDK overview for installation, errors and retries.

Was this page helpful?