Skip to main content
EDSL provides methods to estimate a job before running it and inspect recorded costs afterward. Cost estimation can retrieve pricing information or request an estimate from Expected Parrot; it does not run the survey or generate model responses.

Estimate a prepared job

Combine a survey with the agents, scenarios, and models you plan to use. For example:
Call estimate_job_cost() to get a dictionary of estimated costs and token counts:
To inspect the breakdown as a table:
This method estimates tokens from rendered prompt lengths and applies the pricing table. Its text approximation uses four characters per input token and output tokens equal to 75% of input tokens, rounded up. Prompt text containing unresolved Jinja placeholders receives a multiplier of two before token estimation. These are estimation assumptions; no answers are generated. For question-specific estimates and adjustable assumptions, see Detailed estimates.

Estimate hosted execution in credits and USD

With Expected Parrot authentication configured, request the server’s estimate for the same job:
The returned dictionary includes usd and credits_hold, along with estimate metadata such as estimate_kind, assumptions, and warnings when available. remote_inference_cost() also accepts a Survey; pass a Jobs object when you want the estimate to use your selected agents, scenarios, and models. The CLI equivalent is ep jobs cost jobs.ep --iterations 3. See Credits for account balances and usage.

Inspect prompts and their estimated costs

job.prompts() returns the rendered prompts and an estimated cost for each question in each planned interview:
Each estimated_cost is in USD for one question in one interview, before multiplying by iterations. The preview includes scenario values and agent instructions; answers to earlier questions become available when the survey runs. See Prompts and instructions for inspecting the prompts recorded with completed responses.

Detailed estimates

For a breakdown that accounts for question types, file inputs, and survey memory, use estimate_remote_job_cost():
Despite its name, this method calculates the estimate locally, using retrieved prices unless you supply a price_lookup. It returns a JobCostEstimate for one iteration; it does not submit a remote job. You can supply your own expected response lengths. For example, estimate a 100-token answer to the favorite_flower question:
TokenOverride also accepts comment_tokens and thinking_tokens; omitted fields retain their estimates. Optional service and model fields restrict an override to a particular model. These values change the estimate, not the model’s output limits. For surveys with branching, branch_weights={("from_question", "to_question"): probability} supplies expected transition probabilities. Without branch weights, the estimator assumes every question is reached. chars_per_token adjusts the text-to-token approximation.

Reuse a pricing table

Coop.fetch_prices() returns a pricing dictionary keyed by (inference_service, model). You can reuse that table across estimates:
The table contains input and output price entries. If a model is missing, the estimator falls back to available service prices or default rates; inspect the prices used in the breakdown.

Inspect recorded costs

Load completed results and compute the recorded job cost:
By default this excludes cached responses. include_cached_responses_in_cost=True includes their recorded costs for comparison; those costs are not necessarily new charges. Missing provider usage or pricing information can limit the estimate. Use your account or provider’s billing record to reconcile actual charges.

Keep a cost ledger

The CLI can record an estimate or the cost from a saved result package:
The first amount is an illustrative manual estimate. Recording it does not reserve credits or enforce a limit. See Credits for Expected Parrot account usage, Token limits for execution constraints, and Caching for response reuse.