Get started
Introduction
The shape of the system, and where your code touches it.
There are two surfaces and one path. The **gateway** is the path: it is the only thing on the hot route, and it proxies inference to the provider while measuring what went through. The **console** is where your staff configure what is for sale. The **portal** is where your customers see what they spent.
The four things you configure
| Thing | What it decides | Where |
|---|---|---|
| Bundle | Which models, at what markup, under what cap | Console → Bundles |
| Alias | The model name your users type | Console → Models |
| Credential | Whose provider key pays for the call | Console → Provider keys |
| Key | Which end user a request belongs to | POST /v1/keys |
Attribution is by key, never by header
An end user is identified by the ak_ key the request arrives with. There is no X-User-Id header to set, because a header is a claim the caller makes about themselves and a key is a fact we minted. If a key leaks, you rotate that one key and one user is affected.
This is why you mint a key per end user rather than sharing one. Sharing a key means every number on every page is an aggregate you cannot break down later.
Money is integers
Every amount is a bigint of micro-dollars, a millionth of a dollar. Columns end in _micros and the API returns them that way. $3.00 per million tokens is 3000000. There is no float anywhere on the money path, and no rounding until the moment something is displayed.