Parameters
The metered metric you want to price. Examples include
"llm_input_tokens", "llm_output_tokens", "memories_ingested", and "retrievals". Match the metric you’d expect to see in the ledger.How many units of
metric_type the planned operation would consume (e.g. number of tokens, number of memories).Optional count of discrete items the operation would touch. Some metrics price differently for batched vs. single-item operations.
Operation identifier the quote is scoped to. Lets the server apply the right rate when a metric has different pricing across operations. Leave unset to use the default rate for the metric.
Mode for the planned operation, matched against pricing rules that name a mode. Retrieval is charged per query at the rate of its retrieval mode (
"fast" or "accurate"; see Retrieval modes). Ingestion is charged on the language-model tokens it uses, and the ingestion mode does not change the pipeline (see Types and enums), so leave mode out when you quote an ingestion.Returns
CreditEstimate with the quoted cost.
The credit amount that would be debited if the operation ran with the supplied parameters at the current rate. No credits are spent by this call.
Example
Raises
AuthenticationError: when the API key is missing or invalid.InvalidInputError: when Synap rejects the quote request, for example an unknownmetric_typeor a negativeunits(HTTP 400 or 422).