Skip to content

Configuration

import os
from aura_sdk import AuraClient
async with AuraClient(api_key=os.environ["AURA_API_KEY"]) as aura:
projects = await aura.list_projects()
Argument Default Does
api_key required Your company API key (sk-aura-…), sent as Authorization: Bearer
base_url https://aura.strangeworks.com Which Aura to talk to
timeout 30.0 seconds Per-request HTTP timeout — not the chat-turn wait

AuraClient owns an httpx.AsyncClient, so it holds connections until you close it. Use it as an async context manager:

async with AuraClient(api_key=key) as aura:
...

Or close it yourself when the client outlives a single block — a module-level client shared by request handlers, for instance:

aura = AuraClient(api_key=key)
try:
...
finally:
await aura.aclose()

Leaving it to the garbage collector works until it doesn’t; you get warnings and, under load, exhausted connections.

The SDK reads nothing from the environment, so it can never pick up a credential you did not pass it. Reading os.environ[...] above is your code’s choice, not the SDK’s.

There is no dedicated ping; the cheapest real call is listing projects.

from aura_sdk import AuraApiError
try:
await aura.list_projects()
except AuraApiError as err:
if err.status == 401:
raise RuntimeError("AURA_API_KEY is missing or revoked") from err
raise