Step 1: Declare the model as a run parameter
A connected agent declares its run parameters in the signature of the function, and aLiteral becomes a closed option list in the run dialog:
- Python
- TypeScript
Step 2: Run the suite on both models in one run
In the run dialog, click Compare agents, keep the same agent on both rows and setmodel=gpt-5 on one and model=gpt-5-mini on the other. From the CLI, name the target twice with the parameter after the question mark:
--repeat 3 runs every scenario three times per target, so the result does not rest on one lucky pass.
The run dialog with the same agent on two rows and a different model on each.
Step 3: Read the comparison
The run detail has one column per target: the column with the declared default model is labelled with the agent only, and the other one withmodel=gpt-5-mini. Decide from the four charts above the table, Pass rate, Total cost, Average reply latency and Pass rate over runs.
One column per model. The pass rate must hold; the cost and the latency should drop.
Step 4: The other levers
After the model, in order of effect:- Turns. Every avoided turn removes a whole prompt from the bill. See Reduce turns.
- Context size. The system prompt, the tool list and the history are paid for on every turn. The input tokens of the first and the last call of a conversation, on the trace, show how much of the bill is context; ask Langy or your coding agent to shorten the prompt or trim the history, and compare.
- Prompt caching. Providers charge cached input tokens at a fraction of the price, and you get the cache by keeping the static part of the prompt first and identical across calls.
- Provider. The
provider-cost-comparisonskill prices the traffic in your traces on other providers and tells you whether one of them would be cheaper.
Run the whole loop from one prompt
The four steps above are one request. Paste this into Langy or into your coding agent:Common failures
- The cost reads “across 3 of 6 runs”. The runs without a cost have no traces linked: see Linking your traces.
- The pass rate is the same and the cost went up. The cheaper model took more turns, so check the reply counts in the conversations before you decide, and see Reduce turns.
- The option list does not show the model. The agent connected before the parameter was added. Restart the agent process, because the platform reads the parameters when it connects.