Official Python SDK for the classic Amigo API
Project description
amigo_sdk
Official Python SDK for the classic Amigo API.
Product Docs · Developer Guide · API Reference · Examples · Changelog
Synchronous and asynchronous Python clients for the classic org-scoped Amigo API, with generated Pydantic models from the committed OpenAPI snapshot, typed errors, and NDJSON conversation streaming.
Classic API Context
amigo_sdk is the Python client boundary for teams that integrate with the classic org-scoped Amigo API today. It keeps sync and async application code close to the live contract while a platform-native migration path is prepared.
Product Status
amigo_sdk remains the supported Python client for the classic Amigo API.
The Platform API is the long-term direction for new workspace-scoped capabilities, but classic Python customers are not facing an abrupt end-of-life event. As equivalent platform surfaces become available, Amigo will publish a migration path and upgrade guidance before asking customers to move.
Choose The Right Surface
| If you need | Start here |
|---|---|
| The current org-scoped Amigo API from Python | amigo_sdk |
| New workspace-scoped Platform API capabilities | Platform API docs today. Python migration guidance will follow as platform-native coverage expands |
API Context
This SDK is the Python client boundary for the classic Amigo API at https://api.amigo.ai. It covers the current org-scoped resource model used by existing Amigo deployments, including conversations, services, organizations, users, agents, context graphs, and streaming events.
Documentation
| Need | Best entry point |
|---|---|
| Product overview and deployment context | docs.amigo.ai |
| Integration guidance and developer docs | Developer Guide |
| Generated API reference | amigo-ai.github.io/amigo-python-sdk |
| Runnable examples | examples/ |
| Release history | CHANGELOG.md |
Installation
Python 3.11+ is required.
pip install amigo_sdk
Quick Start
Sync Client
from amigo_sdk import AmigoClient
from amigo_sdk.models import GetConversationsParametersQuery
with AmigoClient(
api_key="your-api-key",
api_key_id="your-api-key-id",
user_id="user-id",
organization_id="your-organization-id",
) as client:
conversations = client.conversations.get_conversations(
GetConversationsParametersQuery(limit=10, sort_by=["-created_at"])
)
print(conversations.conversations[0].id if conversations.conversations else None)
Async Client
import asyncio
from amigo_sdk import AsyncAmigoClient
from amigo_sdk.models import GetConversationsParametersQuery
async def main() -> None:
async with AsyncAmigoClient(
api_key="your-api-key",
api_key_id="your-api-key-id",
user_id="user-id",
organization_id="your-organization-id",
) as client:
conversations = await client.conversations.get_conversations(
GetConversationsParametersQuery(limit=10, sort_by=["-created_at"])
)
print(len(conversations.conversations))
asyncio.run(main())
Configuration
| Option | Type | Required | Description |
|---|---|---|---|
api_key |
str |
Yes | API key from the Amigo dashboard |
api_key_id |
str |
Yes | API key ID paired with api_key |
user_id |
str |
Yes | User ID on whose behalf the request is made |
organization_id |
str |
Yes | Organization ID for the classic API |
base_url |
str |
No | Override the API base URL. Defaults to https://api.amigo.ai |
Environment variables are also supported:
export AMIGO_API_KEY="your-api-key"
export AMIGO_API_KEY_ID="your-api-key-id"
export AMIGO_USER_ID="user-id"
export AMIGO_ORGANIZATION_ID="your-organization-id"
export AMIGO_BASE_URL="https://api.amigo.ai"
Generated Models
The SDK ships with generated Pydantic models and exposes them from amigo_sdk.models:
from amigo_sdk.models import (
ConversationCreateConversationRequest,
GetConversationsParametersQuery,
)
Public builds are generated from the committed specs/openapi-baseline.json snapshot in this repo so generated models stay deterministic across machines and CI runs. Refresh that snapshot before regenerating models:
sync-openapi
gen-models
Error Handling
from amigo_sdk import AmigoClient
from amigo_sdk.errors import AuthenticationError, NotFoundError, RateLimitError
try:
with AmigoClient() as client:
organization = client.organizations.get()
print(organization.id)
except AuthenticationError as error:
print("Authentication failed:", error)
except NotFoundError as error:
print("Resource not found:", error)
except RateLimitError as error:
print("Rate limited:", error)
Support
Use the issue tracker for bugs and feature requests. For responsible disclosure, see SECURITY.md.
Project details
Release history Release notifications | RSS feed
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 amigo_sdk-1.3.1.tar.gz.
File metadata
- Download URL: amigo_sdk-1.3.1.tar.gz
- Upload date:
- Size: 7.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.13.11 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2d757a6e0859f8a84921c432dceb815614151a02fc7ea6d47b878c693a19e7b
|
|
| MD5 |
dff853e1a68ba393d1272aec5b3863bc
|
|
| BLAKE2b-256 |
c2ab78d3a3dd412266be5cae82653f63ae645dffd67b0f82e597920ab5a7f2c8
|
File details
Details for the file amigo_sdk-1.3.1-py3-none-any.whl.
File metadata
- Download URL: amigo_sdk-1.3.1-py3-none-any.whl
- Upload date:
- Size: 116.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.5 cpython/3.13.11 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1c48b0e87870a2e58c6a5e3381904b32ca8348a579d7e718aceb2a3c9b1ac68
|
|
| MD5 |
ce39f411c83a5c18daad50573b1a6560
|
|
| BLAKE2b-256 |
7230f6d4c25d6976c9f80c28101a878c3f75608493790d030220b631800f1ef9
|