agents24
Last Updated: 2026-07-16
Unified Python SDK for Agents24.
Version 0.3.0 adds trusted client-deployment administration and server-side deployment-session minting while retaining protocol contract 0.2.0.
Interrupted runs use the strict V2 resume envelope: schema_version = "agents24.hitl.resume.v2", one exact interrupt_id, one approve | reject | connect | skip action, and an optional comment. Reattach after every successful or idempotent resolution.
Endpoint methods are generated from packages/agents24-sdk-contract/agents24.sdk.json.
Do not edit files under agents24/generated/ directly. For SDK maintenance, see docs/references/agents24_sdk_development_guide.md.
from agents24 import Agents24
client = Agents24(
base_url="http://localhost:8000",
api_key="tpk_...",
organization_id="org-id",
)
agent = client.agent({
"name": "Support Agent",
"instructions": "Answer briefly.",
}).create()
client.agents.publish(agent["id"])
Client Runtime Administration
Use organization credentials only in trusted server code to manage deployment clients and mint scoped end-user sessions:
deployment = client.client_deployments.create({
"agent_id": "agent-id",
"agent_version_id": "version-id",
"name": "Customer chat",
"auth_modes": ["backend_exchange"],
"allowed_origins": ["https://customer.example"],
})
session = client.client_sessions.create_backend_session(
deployment["id"],
{
"subject": "customer-user-42",
"browser_origin": "https://customer.example",
"requested_capabilities": ["chat.stream", "threads.read"],
},
)
Return only the deployment-session credentials required by the end-user client. Never expose the organization API key.
Published-Agent Runtime
Use client.embed from server code to call a published agent through the public embed runtime:
def on_event(event):
print(event["event"])
result = client.embed.stream_agent(
"published-agent-id",
{
"input": "Help me with my account.",
"external_user_id": "customer-user-123",
},
on_event=on_event,
)
The namespace also includes thread detail/delete, run-context, cancel, and attachment-upload methods.
Thread history can be listed for one agent or across several agents:
threads = client.embed.list_agent_threads(
"published-agent-id",
external_user_id="customer-user-123",
)
sidebar_threads = client.embed.list_agent_threads_multi({
"agent_ids": ["agent-a", "agent-b"],
"external_user_id": "customer-user-123",
})
Async backends can use AsyncAgents24.embed.list_agent_threads_multi(agent_ids, external_user_id=...).
Artifact Authoring
Artifact code imports lightweight helpers from agents24.artifacts:
from pydantic import BaseModel, Field
from agents24.artifacts import tool
class EchoInput(BaseModel):
text: str = Field(description="Text to echo.")
class EchoOutput(BaseModel):
text: str
@tool(
name="echo",
input_schema=EchoInput,
output_schema=EchoOutput,
)
async def echo(input, config, context):
return {"text": input["text"]}
The agents24.artifacts module is transport-free and safe for artifact runtime code. If artifact code imports Pydantic, declare pydantic as an artifact dependency.
Self-hosted Python services can expose decorated tools through the framework-neutral server helper:
from agents24.server import create_artifact_server
server = create_artifact_server(
exports=[echo],
signing_secret="shared-environment-secret",
)
manifest = server.manifest()
health = server.health()
response = await server.invoke(body=request_body, headers=request_headers)
Use a built-in adapter when the SDK should create the application and mount the protocol routes:
from agents24.server_adapters import create_artifact_fastapi_app
app = create_artifact_fastapi_app(
exports=[echo],
signing_secret="shared-environment-secret",
)
Adapters are available for FastAPI, Starlette, Flask, Django urlpatterns, and aiohttp. Application adapters create a new app by default or mount into an existing app passed as app=. Install only the selected extra, for example agents24[fastapi]; agents24[server] installs every supported framework adapter.
For custom providers, keep using ArtifactServer directly or wrap create_artifact_asgi_app() / create_artifact_wsgi_app(). server.routes() exposes the canonical method/path list and await server.dispatch(...) provides framework-independent routing and normalized JSON responses.
Development
pnpm run generate:sdk
pnpm run check:sdk-contract
pnpm run test:agents24-python
Generated endpoint methods stay in parity with the canonical TypeScript @agents24/node package.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agents24-0.3.0.tar.gz.
File metadata
- Download URL: agents24-0.3.0.tar.gz
- Upload date:
- Size: 38.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68e207a4b24e9a78ba9b9b152573353b4ccbba8d7ee050bdadc95ad5d07544a2
|
|
| MD5 |
d50842a4a24e2b8450e1efd70e89d0fb
|
|
| BLAKE2b-256 |
f1a340cb6e4e2524bbda8c6345273fc7671fd8bf51d5e314cbb88cd9cfc295ac
|
Provenance
The following attestation bundles were made for agents24-0.3.0.tar.gz:
Publisher:
agents24-sdk-release.yml on daniel5426/talmudpedia
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agents24-0.3.0.tar.gz -
Subject digest:
68e207a4b24e9a78ba9b9b152573353b4ccbba8d7ee050bdadc95ad5d07544a2 - Sigstore transparency entry: 2190103247
- Sigstore integration time:
-
Permalink:
daniel5426/talmudpedia@ad1af0d32a1743d224a5ac7b98eacd37aab495ce -
Branch / Tag:
refs/heads/main - Owner: https://github.com/daniel5426
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
agents24-sdk-release.yml@ad1af0d32a1743d224a5ac7b98eacd37aab495ce -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file agents24-0.3.0-py3-none-any.whl.
File metadata
- Download URL: agents24-0.3.0-py3-none-any.whl
- Upload date:
- Size: 30.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d320d2a34a9e6ad32ff99494495ec5089ad54c4de80736c8ef98884d8c160fe2
|
|
| MD5 |
b3061b371e4759d2a2ffb818d4e58034
|
|
| BLAKE2b-256 |
161c1c0884d20a872fbd70ffdeb742b9e6b00c061670f3f9758ab1a26576890f
|
Provenance
The following attestation bundles were made for agents24-0.3.0-py3-none-any.whl:
Publisher:
agents24-sdk-release.yml on daniel5426/talmudpedia
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agents24-0.3.0-py3-none-any.whl -
Subject digest:
d320d2a34a9e6ad32ff99494495ec5089ad54c4de80736c8ef98884d8c160fe2 - Sigstore transparency entry: 2190103272
- Sigstore integration time:
-
Permalink:
daniel5426/talmudpedia@ad1af0d32a1743d224a5ac7b98eacd37aab495ce -
Branch / Tag:
refs/heads/main - Owner: https://github.com/daniel5426
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
agents24-sdk-release.yml@ad1af0d32a1743d224a5ac7b98eacd37aab495ce -
Trigger Event:
workflow_dispatch
-
Statement type: