Documentation

Documentation

Sector-agnostic AI infrastructure

Nia Gateway is a multi-tenant gateway that sits between your application and an AI provider. It gives every tenant an isolated balance, a choice of billing model, and a choice of how to fund that balance — without your application ever having to talk to Anthropic or a payment provider directly.

The gateway itself has no opinion about what industry you're in. The same per-tenant isolation, the same billing model, and the same rate limits apply whether you're routing legal research, financial analysis, or clinical documentation through it. Legal practice management is this project's flagship integration — Yawakili, a legal practice management platform, runs its AI-assisted drafting and research features through Nia Gateway today, billed transparently per matter with the same strict tenant isolation described throughout these docs. Nothing about the gateway is legal-specific; Yawakili is simply the first real integration built on it.

What's in these docs

  • Getting Started — what you need before your first request, and a real, working curl example.
  • Authentication — the x-api-key header and how it's distinct from the dashboard's session login.
  • Endpoint Reference — POST /v1/ai/complete's request/response shape and every real error case it can return.
  • Billing — metered KES billing vs. bring-your-own-key, and exactly how a request's cost is computed.
  • Deposits — funding your balance with M-Pesa through your SMPLY PAY wallet.
  • Rate Limits — the default per-tenant limit and how it can be adjusted.

Every request/response example in these docs was run against a live instance of this gateway before being written down here — none of it is invented or aspirational.