Skip to main content
Returns the credit cost that would be charged for a hypothetical operation, based on the current pricing for your client. The call is a pure quote (it never debits the wallet) so it’s safe to invoke before a large ingestion batch, a long retrieval, or whenever you want to surface an “estimated cost” preview to your users.

Parameters

string
required
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.
float
required
How many units of metric_type the planned operation would consume (e.g. number of tokens, number of memories).
int
Optional count of discrete items the operation would touch. Some metrics price differently for batched vs. single-item operations.
string
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.
string
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.
float
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 unknown metric_type or a negative units (HTTP 400 or 422).

See also