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
Processing mode for the planned operation (for example "fast" or "long-range" for ingestion: the ingestion axis of Retrieval Modes). Some metrics price differently per mode.

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

  • SynapAuthError: when the API key is missing or invalid.
  • SynapValidationError: when metric_type is not recognized or units is negative.

See also