Install the SDK
Install the Python SDK and configure your client.
Requirements
- Python 3.9 or higher
- pip (or any PEP 517 installer)
Install
The package installs one dependency: httpx for HTTP requests.
Import
For error handling:
Initialize the client
Constructor parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | Required | Your agent API key (starts with sr_agent_). |
base_url | str | https://agents.systemr.ai | API base URL. Override for local development. |
timeout | float | 30.0 | Request timeout in seconds. |
Custom base URL
For local development or self-hosted deployments:
Context manager
The client supports Python's context manager protocol for automatic cleanup:
Or close manually:
Error handling
Error types
| Exception | HTTP Status | Meaning |
|---|---|---|
AuthenticationError | 401 | Invalid or missing API key. |
AuthenticationError | 403 | Agent is suspended or terminated. |
InsufficientBalanceError | 402 | Compute credit balance too low. |
SystemRError | 4xx/5xx | All other API errors. |
Using raw REST calls
You do not need the SDK. Any HTTP client works:
Authentication
Every authenticated request requires the X-API-Key header:
The SDK handles this automatically. If you use raw HTTP, include the header in every request.
Public endpoints (no auth required):
GET /v1/billing/pricingGET /v1/tools/listGET /v1/guardian/statusGET /v1/broker/supported
System R AI
| Python SDK | pip install systemr |
| MCP Server | agents.systemr.ai/mcp/sse |
| OpenAPI Spec | agents.systemr.ai/openapi.json |
| Machine Docs | agents.systemr.ai/llms.txt |
| GitHub | System-R-AI |
| X | @Systemrai |
| YouTube | @systemr_ai |
| hello@systemr.ai | |
| Phone | 628 333 6693 |
| Address | 7901 4TH ST N, STE 28529, ST PETERSBURG, FL 33702 |
| Terms | Terms of Service |
| Privacy | Privacy Policy |
| Security | Security Policy |
© 2026 System R AI. Software platform. Not financial advice.