# Choose a model for a Pizza Ex Machina agent by cost per run

Pizza Ex Machina runs each agent on one of three ovens (models), `fornetto-1`, `forno-1` or `inferno-1`, which set its token rates and are fixed when the agent is created. Every run costs a flat $0.01 plus the oven's input and output token rates, drawn from prepaid credit. To choose an oven, create the same agent once on each, send each one the same input, and compare the `billed` breakdown that every run returns.

## At a glance

- **Endpoints:** `POST https://api.pizzaexmachina.com/v1/agents` creates an agent for free. `POST https://api.pizzaexmachina.com/v1/agents/{agentId}/runs` runs it.
- **Body:** Create takes `instructions` (required), `name` and `model` (`fornetto-1`, `forno-1` or `inferno-1`). Without `model`, the agent runs on `forno-1`. A run takes `input` (required).
- **Price per run:** $0.01 plus the oven's token rates (table below)
- **Payment:** prepaid credit on the Credits plan, from $0.50, bought on the storefront. Every API call sends the `pxm_live_` key as `Authorization: Bearer`.
- **Response:** `output`, `model`, a `billed` breakdown and `remainingCreditUsd`
- **Limits:** 4,000 characters of instructions, 4,000 characters of input and 1,200 output tokens per run
- **Rates without a key:** `GET https://api.pizzaexmachina.com/v1/models`
- **Full purchase flow:** [the buyer skill](https://agents.pizzaexmachina.com/zcj/7ymx0c7hm375/SKILL.md)

## The three ovens and their token rates

| Oven | `description` from `/v1/models` | Input | Output |
| --- | --- | --- | --- |
| `fornetto-1` | "The countertop oven: quick, cheap, fine for routine jobs." | $0.2625 per million tokens | $2.10 per million tokens |
| `forno-1` (default) | "The house oven: balanced quality and speed." | $1.05 per million tokens | $5.25 per million tokens |
| `inferno-1` | "Full heat for the hardest jobs." | $3.15 per million tokens | $15.75 per million tokens |

## Work out the cost of a run

A run costs the run fee, plus its input tokens times the oven's input rate, plus its output tokens times the oven's output rate. The run fee is the same on every oven. Only the token lines change.

| Oven | One run, 2,000 input and 1,000 output tokens | 1,000 such runs |
| --- | --- | --- |
| `fornetto-1` | $0.012625 | $12.625 |
| `forno-1` | $0.01735 | $17.35 |
| `inferno-1` | $0.03205 | $32.05 |

The token counts come from the oven itself. The same input can produce different counts on different ovens, so the rates alone do not settle which oven is cheapest for your job.

## Compare the ovens on one input

1. Get a `pxm_live_` key: buy Credits on the storefront with your buyer bearer, then redeem the key, which is shown once. [The buyer skill](https://agents.pizzaexmachina.com/zcj/7ymx0c7hm375/SKILL.md) has the full flow.

2. Create the agent on `fornetto-1`. Creating an agent is free:

   ```bash
   curl -X POST https://api.pizzaexmachina.com/v1/agents \
     -H "Authorization: Bearer $PXM_KEY" \
     -H "Content-Type: application/json" \
     -d '{"name": "Support Triage", "model": "fornetto-1", "instructions": "Sort a customer support email into exactly one of these categories: billing, bug, feature request, account access, other. Reply with the category on the first line and a one-sentence reason on the second."}'
   ```

   The response carries the agent and its `runUrl`:

   ```json
   {"agent": {"id": "chef_febg66BWzycq", "name": "Support Triage", "instructions": "Sort a customer support email into exactly one of these categories: billing, bug…", "model": "fornetto-1", "tools": []}, "runUrl": "https://api.pizzaexmachina.com/[path]"}
   ```

3. Send the same body twice more, with `"model": "forno-1"` and then `"model": "inferno-1"`. Keep the name and instructions unchanged so that the oven is the only difference. Each response names its own `model`.

4. Run each agent once with the same input, using the `agent.id` that each create call returned:

   ```bash
   curl -X POST https://api.pizzaexmachina.com/v1/agents/{agentId}/runs \
     -H "Authorization: Bearer $PXM_KEY" \
     -H "Content-Type: application/json" \
     -d '{"input": "Hello, since this morning the export button gives me an empty file, in both CSV and PDF. Nothing changed on our side. Could you look into it? Thanks, the operations team at a small logistics firm"}'
   ```

   An example `fornetto-1` response follows. It drew $0.010485 from credit.

   ```json
   {"agent": {"id": "chef_…", "name": "Support Triage"}, "output": "bug\nThe export button producing empty CSV and PDF files despite no changes on the user's side indicates a defect in the export functionality.", "model": "fornetto-1", "billed": {"runUsd": "…", "inputTokens": 146, "inputTokensUsd": "…", "outputTokens": 213, "outputTokensUsd": "…", "totalUsd": "…"}, "remainingCreditUsd": "…"}
   ```

5. Put the three `billed` breakdowns side by side. Check each `output` against your own pass criteria. Keep the cheapest oven whose output passes.

## Example: one triage agent on each oven

- The `fornetto-1` run billed 146 input and 213 output tokens and drew $0.010485.
- The `forno-1` run billed 148 input and 41 output tokens and drew $0.01037.
- The `inferno-1` run billed 148 input and 26 output tokens and drew $0.010876.

Output length moved the total more than the rate did. The `fornetto-1` run was billed for 213 output tokens against 41 on `forno-1`, so the `forno-1` run drew less credit despite its higher rate. Each output put `bug` first, with a reason after it.

## Boundaries

- An agent's oven and instructions are fixed at creation. To use a different oven, create a new agent.
- Creating and listing agents (`GET https://api.pizzaexmachina.com/v1/agents`) is free.
- The API refuses a run when the balance is below the run fee. The full cost is taken once the model answers, so the final run before the credit runs out can take the balance a little below zero.
- A run that fails with `502 run_failed` is not billed.
- The buyer bearer works only on the storefront, and the `pxm_live_` key works only on the API.

## Errors

| Status and code | Meaning | Action |
| --- | --- | --- |
| `400 invalid_request` | A field is missing or malformed, and `detail` names it | Fix the field, for example `model` outside the three ovens |
| `401 unauthorized` / `invalid_api_key` | No key was sent, or the key is unknown or revoked | Send `Authorization: Bearer pxm_live_...` with a current key |
| `402 insufficient_credit` | The balance can't cover the run fee | Top up on the storefront with `POST https://agents.pizzaexmachina.com/zcj/7ymx0c7hm375/extend`. The top-up goes to the same account and key. |

## Frequently asked questions

### Which Pizza Ex Machina oven is cheapest per run?

`fornetto-1` has the lowest token rates, and the run fee is the same on every oven. The total also depends on how many tokens each oven reads and writes for the same input. Compare `billed.totalUsd` across runs on your own input rather than the rates alone.

### Can I change an agent's model after creating it?

No. The oven and the instructions are fixed when the agent is created. To use another oven, create a new agent with the same instructions and the new `model`.

### What happens if I don't set a model?

The agent runs on `forno-1`, the default oven, and bills at its rates on every run.

### Can I compare the ovens without buying credit?

The Free trial gives free starting credit, one per human, with no payment. Claim it with `POST https://agents.pizzaexmachina.com/zcj/7ymx0c7hm375/plans/{planId}/purchase`, your buyer bearer and an empty body, using the Free trial's plan id from `https://agents.pizzaexmachina.com/zcj/7ymx0c7hm375/manifest.json`; the credential's human must have verified an email first. The trial is a standing account, so redeem a `pxm_live_` key for it with `POST https://agents.pizzaexmachina.com/zcj/7ymx0c7hm375/keys/redeem` as for any plan.

### Does creating test agents cost anything?

No. Creating and listing agents is free. Only runs draw credit.

## Keep reading

- [Buyer skill](https://agents.pizzaexmachina.com/zcj/7ymx0c7hm375/SKILL.md): the full purchase flow
- [Standing accounts](https://agents.pizzaexmachina.com/zcj/7ymx0c7hm375/accounts.md): key redemption, top-ups and recovery
- [Machine catalog](https://agents.pizzaexmachina.com/zcj/7ymx0c7hm375/manifest.json): plans and live rates
- [Pizza Ex Machina API reference](https://pizzaexmachina.com/docs): endpoints, limits and errors

---

Updated 2026-10-12. All Pizza Ex Machina guides: https://agents.pizzaexmachina.com/guides.md. Storefront: https://agents.pizzaexmachina.com/zcj/7ymx0c7hm375/llms.txt.
