Python installation
Requirements
- Python 3.10 or later.
- The SDK depends on
httpx, installed automatically.
Install
pip install cargo-core-api-sdk
or, with uv:
uv add cargo-core-api-sdk
Configure
import os
from cargo_core_api_sdk import CargoClient
client = CargoClient(api_key=os.environ["CARGO_API_KEY"], environment="dev")
| Argument | Type | Default | Description |
|---|---|---|---|
api_key | str | required | Your user-token. |
environment | "dev", "co", "mx", "ar", "uy", "br", "cl", "cr", "ec", "pe" | "dev" | Which gateway to call. See Environments. |
base_url | str | resolved from environment | Overrides the base URL, e.g. for a proxy. |
timeout | float | 15.0 | Request timeout in seconds. |
Close the client
CargoClient keeps an HTTP connection pool. Use it as a context manager so it is closed for you:
with CargoClient(api_key=os.environ["CARGO_API_KEY"], environment="dev") as client:
groups = client.authorization.list_permission_groups()
or call client.close() yourself when you are done.
Next: Quickstart.