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.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| amigo_sdk-2.1.0.tar.gz | 7.8 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| amigo_sdk-2.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.9 MB
Release files / amigo_sdk-2.1.0.tar.gz
| Download URL | amigo_sdk-2.1.0.tar.gz |
|---|---|
| Size | 7.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64dc36d52d063ba5c83581d5b65f8aed8e5f8a58f84d3cc061963faaa40f96e9
|
|
BLAKE2b-256 checksum How to use checksums |
1945b4758a122f85232089b66fdd73c7646f6c67f10aadce0a64dd7c36208cfd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Hatch/1.18.1 {"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.15"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.0.13 30 Jan 2024","python":"3.13.15","system":{"name":"Linux","release":"6.6.141"}} HTTPX2/2.13.1
|
Release files / amigo_sdk-2.1.0-py3-none-any.whl
| Download URL | amigo_sdk-2.1.0-py3-none-any.whl |
|---|---|
| Size | 116.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
133bbbfcab4b259eeab9c8971739a1d809e7bd72974f93cf1a8adc04c97ff38e
|
|
BLAKE2b-256 checksum How to use checksums |
69c89cb22b31723c65fab2464e9fd1070ecc85e380c8abe5af8b16ef395fed0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Hatch/1.18.1 {"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.15"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.0.13 30 Jan 2024","python":"3.13.15","system":{"name":"Linux","release":"6.6.141"}} HTTPX2/2.13.1
|
Security for amigo_sdk 2.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.