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 original org-scoped Amigo backend at api.amigo.ai, with generated Pydantic models from the committed OpenAPI snapshot, typed errors, and NDJSON conversation streaming.
Classic Backend Context
amigo_sdk targets the original org-scoped Amigo backend. Existing deployments still use this surface for conversations, services, organizations, users, agents, context graphs, webhooks, and streaming events.
Product Status
amigo_sdk remains the supported Python client for the Classic API.
The Platform API is where new workspace-scoped capabilities land first, but the Classic API is not being switched off abruptly. Amigo will publish a migration path, compatibility notes, and upgrade guidance before asking customers to move production workloads.
Choose The Right Surface
| If you need | Start here |
|---|---|
Existing org-scoped integrations on api.amigo.ai from Python |
amigo_sdk |
New workspace-scoped integrations on api.platform.amigo.ai |
Platform API docs today. Use direct HTTP for Platform integrations from Python; this package remains Classic-only |
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 |
The docs site remains the primary reference. The repo-local examples stay close to the shipped package surface and the published package is validated in CI.
Installation
Python 3.11+ is required.
pip install amigo_sdk
Before making requests, obtain Classic organization credentials and a user authorized to read the target resources. Keep API keys in server-side environment variables or a secret manager. The examples below read conversation data; they require access to an existing organization.
For the 2.0.0 generated-model changes, review the current SDK upgrade guidance and recheck the package registry when choosing a version.
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. From a source checkout with development dependencies installed, refresh that snapshot before regenerating models:
python scripts/sync_openapi.py
python scripts/gen_models.py
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.
Metadata
Release files for amigo_sdk 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| amigo_sdk-2.0.1.tar.gz | 7.8 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| amigo_sdk-2.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.9 MB
Release files / amigo_sdk-2.0.1.tar.gz
| Download URL | amigo_sdk-2.0.1.tar.gz |
|---|---|
| Size | 7.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d16394a94bc03831b503aa989a7ba3a75c70353a55639facb5452090b811752
|
|
BLAKE2b-256 checksum How to use checksums |
9f06d5e3d4844773a1b34cf18b013d8dce18d55343aad3786ba5de28abbdef39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Hatch/1.18.0 {"ci":true,"cpu":"x86_64","distro":{"id":"noble","libc":{"lib":"glibc","version":"2.39"},"name":"Ubuntu","version":"24.04"},"implementation":{"name":"CPython","version":"3.13.11"},"installer":{"name":"hatch","version":"1.18.0"},"openssl_version":"OpenSSL 3.0.13 30 Jan 2024","python":"3.13.11","system":{"name":"Linux","release":"6.6.141"}} HTTPX2/2.12.0
|
Release files / amigo_sdk-2.0.1-py3-none-any.whl
| Download URL | amigo_sdk-2.0.1-py3-none-any.whl |
|---|---|
| Size | 116.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
258a157879289e6827a645c68b0cc4b73aa0cd6d510f5236801e94c48583cfc2
|
|
BLAKE2b-256 checksum How to use checksums |
95a80f33e91129cd78a4b5ad9ac0f893c5ae503da0bf9e531ad22e707cc3bf88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Hatch/1.18.0 {"ci":true,"cpu":"x86_64","distro":{"id":"noble","libc":{"lib":"glibc","version":"2.39"},"name":"Ubuntu","version":"24.04"},"implementation":{"name":"CPython","version":"3.13.11"},"installer":{"name":"hatch","version":"1.18.0"},"openssl_version":"OpenSSL 3.0.13 30 Jan 2024","python":"3.13.11","system":{"name":"Linux","release":"6.6.141"}} HTTPX2/2.12.0
|