# akira-billing — Reference

Rust client for the [Akira Billing API](https://github.com/akira-foundation/billing). Mirrors the Go SDK; both crates pass the same shared signature test vectors. Built on `reqwest` with `rustls-tls`.

This reference documents every public surface of the crate. Each topic lives in its own file; module names match the file numbering.

## Meta

| File | Topic |
|------|-------|
| [01-installation](01-installation.md) | Add the crate, choose features (`tokio`, `loopback`, `desktop`) |
| [02-quickstart](02-quickstart.md) | 60-second working snippet for a server + a desktop app |
| [03-architecture](03-architecture.md) | Trust model, request signing, async runtime, feature flags |

## Core client

| File | Topic |
|------|-------|
| [10-client](10-client.md) | `Client` — full method table, payload shapes |
| [11-signature](11-signature.md) | HMAC canonical form, `canonical`, `sign`, `new_nonce` |
| [12-errors](12-errors.md) | `Error` enum, `Api { status, code }` branching |

## Storefront helpers

| File | Topic |
|------|-------|
| [24-oauth](24-oauth.md) | PKCE challenge, `BuildOauthInitUrl`, OAuth state |

The Rust crate intentionally stays server/desktop-focused — no pricing/checkout/UI helpers (those live in the [TypeScript SDK](https://github.com/akira-io/billing-sdk-js)).

## License + usage runtime

| File | Topic |
|------|-------|
| [30-license](30-license.md) | `decode_license`, `verify_license`, `compute_remaining`, grace, updates-window |
| [31-gate](31-gate.md) | `Gate` runtime — feature checks with offline + grace + local consumption |
| [32-usage](32-usage.md) | `UsageTracker`, `MemoryBuffer`, periodic flush, rollback semantics |
| [33-lifecycle](33-lifecycle.md) | `compute_state`, `trial_days_left`, `LicenseState` enum |

## Integrations (feature-gated)

| File | Topic |
|------|-------|
| [40-loopback](40-loopback.md) | Desktop loopback PKCE OAuth (`feature = "loopback"`) |
| [41-desktop](41-desktop.md) | Keystore, cipher, fingerprint, session, `AuthController` (`feature = "desktop"`) |

## Reference

| File | Topic |
|------|-------|
| [60-protocol](60-protocol.md) | HTTP protocol contract (headers, paths, error envelope) |

---

Navigation: [README](../README.md) · **Index** · [Installation →](01-installation.md)
