Skip to main content
This is in development. Details may change before it is available.
Keep the SDK you use. Set its base URL to the AI Gateway and its API key to your virtual key. Each example reads the key from the ALTRUM_VIRTUAL_KEY environment variable.
Any of these clients can call any model your key allows: the provider prefix in the model name decides where the request goes. See Endpoints.

Handle a refusal

When a guardrail blocks a request, a budget is spent or a rate limit is reached, the SDK raises its usual API error with a message from Altrum that says what stopped the request and what to do. Catch it as you catch provider errors.