Fallback Credits

When a request fails on the primary provider but succeeds on a fallback provider, Allternit can credit the primary failure back to your organization’s spend limit. This prevents double-charging for retried requests. The fallback credit policy is organization-scoped and gated to owners and admins.

Base URL

For local development:

Policy configuration

Eligible statuses: refusal, error, rate_limited, budget_exceeded, dlp_blocked, client_disconnected, in_progress.

Endpoints

Get the policy

Response

Update the policy

Response

Reconcile credits

Reconciliation scans llm_usage_events for eligible primary failures that were followed by a successful fallback event within the configured window, then creates pending credit ledger rows.
If start and end are omitted, the API uses the policy’s credit_window_hours to define the window.

Response

When auto_apply is enabled, eligible credits are applied during reconciliation and count toward applied.

List credits

Response

Apply a pending credit

Response

Applying a credit decrements the organization’s current_month_spend by the credit amount.

Error codes