SETUP GUIDE
AntOps Python SDK
Call the production API from Python through the published client and a workspace API key.
Before you start
- Python 3.12 or later
- A workspace API key stored in an environment or secret manager
Setup
- Install the current release with python -m pip install antops==0.2.1.
- Provide ANTOPS_API_KEY through the runtime environment.
- Create AntOpsClient.from_environment().
- Call a bounded operation such as company.lookup.
from antops import AntOpsClient
with AntOpsClient.from_environment() as client:
profile = client.company.lookup("GB", "00000006")Verify and expected result
The client defaults to https://api.antops.dev, uses a 15-second timeout and converts authentication, rate-limit and safe request failures into typed client errors.
ANTOPS_BASE_URL is unnecessary for production and should only be set for a compatible non-production endpoint.
Common safe checks
Authentication or rate limit error
Check that the API key is active and scoped for the operation. Do not log the key while diagnosing.
Timeout
Treat the request outcome as unknown and retry the bounded read only when appropriate.
Security and revocation
Never hardcode the API key. The SDK caps responses and does not include the key in its error messages.
Remove the environment secret from the deployment or developer machine and revoke the associated API key in AntOps.