Skip to content
CodeBook

Model providers and token usage

Shared SSO model configuration, metered calls and CodeBook token limits.

Every run costs tokens. This page is where they come from and what stops them running away.

Two modes

AI runs through your Bookbag account, like sign-in does. An organization either uses managed models or brings its own keys, and neither falls back to the other.

Managed — runs use the platform's models. SSO applies the organization's provider configuration and platform allowance checks.

Bring your own keys — the organization configures its own provider credentials, including a supported OpenAI-compatible endpoint. Calls still go through the shared AI service and remain subject to CodeBook's operational policies. Consult SSO for platform billing and allowance behavior.

Where it is set

In the organization's settings, in the Bookbag account service. Keys are held there — encrypted at rest — rather than in CodeBook, so one organization's configuration serves every product in the suite.

Which model a run uses

By default, the organization's default model at SSO, unless the platform administrator has assigned a model to that feature on AI Models and the organization runs it. A factory, a station or a worker can instead pin a model, name a fallback chain, or let CodeBook choose from measured results among the models SSO already lists. See model policies and routing.

The local guardrail

Separately from the platform meter, factory policy can bound tokens per card and per day, run counts and concurrency. Worker routing can also use a token ceiling. These limits apply alongside permissions and autonomy settings.

These are operational bounds: available organization allowance does not remove a factory's limits. CodeBook records tokens rather than calculating dollar prices. See policies and operations.

Use them together with the retry limit on each station. Retries bound how many times a card comes back; the token budget bounds how much any single attempt can spend.

What to watch

  • A long back-and-forth with an agent in a card's thread. Each mention is a reply the agent spends tokens on. A comment that names no agent costs nothing.
  • A retry limit of 10. That is ten runs on one card before anybody looks at it.
  • An unstaffed escalation station. Cards land and nothing happens, which is cheap but useless.