Skip to content

Clients

AtonixClient

AtonixClient(
    api_key: str | None = None,
    private_key: RSAPrivateKey | None = None,
    private_key_password: str | None = None,
    environment: AtonixEnvironment | str = US,
    timeout: float = 30.0,
    max_retries: int = 3,
)

Bases: _BaseAtonixClient

Synchronous client for interacting with the Atonix OI API.

Note

Authenticated requests are signed with a millisecond UTC timestamp. The server rejects requests whose clock is too far from server time, so the host running this client must keep its system clock synchronized (e.g. via NTP). Significant clock drift surfaces as a 401 AuthenticationError — the error message includes a hint when a clock-skew cause is suspected.

Initialize the Atonix Client.

Parameters:

Name Type Description Default
api_key str | None

API Key (defaults to ATONIX_API_KEY env var).

None
private_key RSAPrivateKey | None

RSA Private Key (defaults to loading from ATONIX_PRIVATE_KEY_PATH).

None
private_key_password str | None

Password for encrypted private key (defaults to ATONIX_PRIVATE_KEY_PASSWORD env var).

None
environment AtonixEnvironment | str

API target environment or custom URL.

US
timeout float

Request timeout in seconds.

30.0
max_retries int

Number of times to retry transient errors (429, 5xx).

3

close

close()

Close the underlying HTTP client.

request

request(method: str, endpoint: str, **kwargs: Any) -> Any

Executes a synchronous HTTP request to the Atonix API with retry logic.

Parameters:

Name Type Description Default
method str

HTTP method (GET, POST, etc.)

required
endpoint str

API endpoint (e.g., "/v1/assets")

required
**kwargs Any

Additional arguments passed to httpx.Client.request.

{}

Returns:

Type Description
Any

The parsed JSON or text response.

Raises:

Type Description
AtonixError

On API or network errors.

get

get(endpoint: str, **kwargs) -> Any

Perform a GET request.

post

post(endpoint: str, **kwargs) -> Any

Perform a POST request.

put

put(endpoint: str, **kwargs) -> Any

Perform a PUT request.

patch

patch(endpoint: str, **kwargs) -> Any

Perform a PATCH request.

delete

delete(endpoint: str, **kwargs) -> Any

Perform a DELETE request.

AsyncAtonixClient

AsyncAtonixClient(
    api_key: str | None = None,
    private_key: RSAPrivateKey | None = None,
    private_key_password: str | None = None,
    environment: AtonixEnvironment | str = US,
    timeout: float = 30.0,
    max_retries: int = 3,
)

Bases: _BaseAtonixClient

Asynchronous client for interacting with the Atonix OI API.

Note

Authenticated requests are signed with a millisecond UTC timestamp. The server rejects requests whose clock is too far from server time, so the host running this client must keep its system clock synchronized (e.g. via NTP). Significant clock drift surfaces as a 401 AuthenticationError — the error message includes a hint when a clock-skew cause is suspected.

Initialize the async Atonix Client.

Parameters:

Name Type Description Default
api_key str | None

API Key (defaults to ATONIX_API_KEY env var).

None
private_key RSAPrivateKey | None

RSA Private Key (defaults to loading from ATONIX_PRIVATE_KEY_PATH).

None
private_key_password str | None

Password for encrypted private key (defaults to ATONIX_PRIVATE_KEY_PASSWORD env var).

None
environment AtonixEnvironment | str

API target environment or custom URL.

US
timeout float

Request timeout in seconds.

30.0
max_retries int

Number of times to retry transient errors (429, 5xx).

3

aclose async

aclose()

Close the underlying HTTP client.

request async

request(method: str, endpoint: str, **kwargs: Any) -> Any

Executes an asynchronous HTTP request to the Atonix API with retry logic.

Parameters:

Name Type Description Default
method str

HTTP method (GET, POST, etc.)

required
endpoint str

API endpoint (e.g., "/v1/assets")

required
**kwargs Any

Additional arguments passed to httpx.AsyncClient.request.

{}

Returns:

Type Description
Any

The parsed JSON or text response.

Raises:

Type Description
AtonixError

On API or network errors.

get async

get(endpoint: str, **kwargs) -> Any

Perform a GET request.

post async

post(endpoint: str, **kwargs) -> Any

Perform a POST request.

put async

put(endpoint: str, **kwargs) -> Any

Perform a PUT request.

patch async

patch(endpoint: str, **kwargs) -> Any

Perform a PATCH request.

delete async

delete(endpoint: str, **kwargs) -> Any

Perform a DELETE request.

AtonixEnvironment

Bases: str, Enum

Available Atonix API environments.