Skip to main content

ChatATP Studio SDK

Python SDK for building and interacting with agents created in ChatATP Studio.

  • Async-first API
  • Conversation lifecycle management
  • Streaming support
  • Fully typed

PyPI Python

chatatp-studio

Official Python SDK for the ChatATP Studio Developer API.

Requirements

  • Python 3.10+

Installation

Install the SDK core package:

pip install chatatp-studio

To enable the bundled CLI, install the optional CLI extra:

pip install "chatatp-studio[cli]"

CLI quick start

studio --help
studio auth login
studio agents --help

Quick start

import asyncio
from chatatp_studio import ChatATPClient

async def main():
    client = ChatATPClient(api_key="chatatp_sk_...")

    # Send a message — conversation lifecycle handled automatically
    result = await client.chat(
        agent_id=7,
        external_user_id="user_12345",
        message="Do you ship to Lagos?",
    )

    print(result.agent_message.content)
    # → "Yes, shipping is available."

    await client.aclose()

asyncio.run(main())

Context manager

async with ChatATPClient(api_key="chatatp_sk_...") as client:
    result = await client.chat(
        agent_id=7,
        external_user_id="user_12345",
        message="Hello!",
    )

Streaming

import sys

async for event in await client.chat_stream(
    agent_id=7,
    external_user_id="user_12345",
    message="Give me a summary of your return policy.",
):
    if event.type == "agent.response.delta":
        sys.stdout.write(event.data.get("delta", ""))
        sys.stdout.flush()
    elif event.type == "tool.execution.started":
        print(f"\n[Running tool: {event.data.get('name')}]")
    elif event.type == "tool.execution.completed":
        print(f"\n[Tool completed. Result: {event.data.get('result')}]")
    elif event.type == "error":
        print(f"\n[Error: {event.data.get('message')}]")
    elif event.type == "agent.response.completed":
        print("\nFinished!")

Resources

# Agents
page  = await client.agents.list()
agent = await client.agents.retrieve(7)

# Conversations
conv = await client.conversations.create(7, "user_12345")
page = await client.conversations.list(agent_id=7)
await client.conversations.delete(conv.id)

# Messages
history = await client.messages.list(conv.id)
reply   = await client.messages.send(conv.id, "Hello")

# Usage
usage = await client.usage.retrieve()

Error handling

from chatatp_studio import NotFoundError, RateLimitError

try:
    await client.agents.retrieve(999)
except NotFoundError:
    print("Not found")
except RateLimitError:
    print("Rate limited")

License

MIT

Download files

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

Source Distribution

chatatp_studio-0.2.0.tar.gz (33.0 kB view details)

Uploaded Source

Built Distribution

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

chatatp_studio-0.2.0-py3-none-any.whl (46.0 kB view details)

Uploaded Python 3

File details

Details for the file chatatp_studio-0.2.0.tar.gz.

File metadata

  • Download URL: chatatp_studio-0.2.0.tar.gz
  • Upload date:
  • Size: 33.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for chatatp_studio-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bbc4a1070d0d0caada1b320543066a3f11da7402103cd710a64c8e25facc6ac2
MD5 7b266ef1f30a6b6ef60b5f29ab2788b6
BLAKE2b-256 4e6ae474f52bef777278435f33e03e2a04c1a075d97a5027b345a0391218340b

See more details on using hashes here.

File details

Details for the file chatatp_studio-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: chatatp_studio-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 46.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for chatatp_studio-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14f1614c6154e3bc79c80658920e231074438db644cf1100bd01893534d4a150
MD5 5c40a0224cca870da86d0d54c8db113b
BLAKE2b-256 83184d9ffe3a91db506a2984797ff12a0a1d4a3b08d9ee6709017155289bdd72

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