chloejsnpm i chloejs

Docs

Models

A job picks its own model in one line, and a call goes out by key or by subscription.


A job can choose its own model, and that is the whole reason this runtime exists. One line, in the job:

model: "anthropic/claude-haiku-4.5"

No model means the agent's own, from its agent.ts. Most jobs that still ask a model should ask a small one: the cheapest model that can do the step is the right model for the step, and picking it per job is how that stays true.

If you are ever tempted to move onto a framework, check that it can do this first.

A key or a subscription

A model call goes one of two ways, and model.via settles it. Everything above the one function that makes the call is the same either way, which is why that function is the only seam.

{ "model": { "via": "gateway" } }
{ "model": { "via": "claude" } }

Empty means gateway when there is a key and the CLI when there is not, so a fresh install runs whichever way that machine can.

gateway is the plain one: one fetch, a model named anthropic/claude-sonnet-5, and model.gateway points it at anything that speaks the same shape, so another provider works without touching the code. It needs model.key.

claude exists for the credential rather than the model. A subscription authorises the Claude Code CLI and is not an API key, so there is nothing to put in a bearer header and HTTP is not an option. It shells out to claude -p once per step, with --tools "", --restricted and --strict-mcp-config, so the CLI brings none of its own tools, none of that machine's settings and no MCP servers. Chloe still runs every tool itself, checks it against its schema and writes it down, because a model that quietly read a file would leave nothing in the run record.

Two things to know before choosing it. The tools are described in the prompt and asked for as JSON rather than through the provider's own tool calling, which is a little less reliable and costs about 500 tokens of instructions per step. And the cost on the run is what the call would have cost on the API: a subscription is not billed per call, so that number prices the run rather than charging it.

Only Anthropic models run this way. A job asking for anything else says so rather than failing at the provider.