Supply
In short
- Where model calls would go: direct, your AWS, DIEM keys, resellers.
- No real supplier is connected.
- Every answer today is a fixture.
Models (cheaper inference) are Petrova's second product. Tools come first (tools).
Petrova is not live. No real supplier is connected. The build refuses to spend real money on models: LIVE_SPEND_BUILT is false in apps/api/src/live-spend.ts, and LIVE_SPEND=true is refused at startup even when every other condition is met. Test: tests/unit/live-spend.test.ts, "even with every condition met, this build refuses LIVE_SPEND=true".
Every model call today is answered by an in-process fixture.
Supply routes
| Route | What the code does | Status |
|---|---|---|
| Direct (Anthropic API) | No direct upstream exists in the code. | Planned |
| Your own AWS (Bedrock) | Claude runs in your AWS account through a role you create from a CloudFormation template (infra/aws/petrova-bedrock-role.yaml). Petrova assumes the role with an external id, signs requests itself, and maps Bedrock errors to Claude's. Your AWS bills you for tokens; Petrova charges 5% of list price above the first $3,000 of list spend per UTC month. A connected account runs only on its own AWS: no fallback to Petrova supply. | Built, fixture only. Only a local AWS emulator can be called. Not wired into npm run dev |
| DIEM keys (Venice-style, OpenAI format) | Requests are translated to OpenAI format. Each Claude Code session keeps one key for an hour so the cache stays warm. A key that hits its daily limit is parked until UTC midnight and the next key is used. | Built, fixture only. No network code; no DIEM key has been used |
| Resellers | A reseller (Anthropic or OpenAI format) is an upstream with its own configured cost and a daily capacity, paid per call. It is used only when its cost is below list, and you pay its cost plus the savings fee (25% of the saving, at most 6% of spend; billing). | Built, fixture only (apps/api/src/resellers.ts). None is integrated or signed |
Planned sale price through DIEM keys and resellers: 35–40% of list. Planned only. It depends on supply that is not signed.
How a supplier is chosen
- Suppliers are tried in order. A 429, 529, 5xx, a connection error, or an overloaded event before the first content moves to the next one.
- A session sticks to the supplier that served it for one hour.
- Each supplier can have a daily capacity in dollars. Petrova holds the call's supplier-cost ceiling against that capacity before each attempt. When every supplier is out, the answer is 529 and nothing is charged. Test:
tests/integration/capacity.test.ts.
Which supplier served each call
The receipt's upstream field names the supplier that served the call. Test: tests/integration/sellers.test.ts, "a sampled call that matches the reference passes and is marked checked on its receipt".
upstreams_attempted lists every supplier an attempt went to, in order, and a failed call names the last one tried. Test: tests/integration/messages.test.ts, "receipts list every supplier attempted, name the supplier on a failed call, and show the real model id".
Limit: supplier names are internal names (for example fixture-primary), not company names.
Last checked against the code: 16 November 2026. Something wrong? The source of this page is in the repository, so a fix is one edit.