/** * THE OPERATOR PRICE TABLE: a file an operator names, merged into the shipped * price catalog with its own provenance label. * * The shipped catalog only carries models whose price is published somewhere we * can cite, which leaves out every self-hosted model, every negotiated * enterprise rate and every gateway that prices per customer. The alternative * everyone reaches for is a default rate for an unknown model, and that is the * one thing this file exists to avoid: a fabricated figure sits in the same * column as a measured one and nothing in the report tells them apart. An * absent price can be chased; an invented one cannot even be noticed. * * So an operator supplies the rates instead, and every number they supply is * labelled as theirs all the way out to the report. Two rules make that honest: * a row that does not parse is REFUSED BY NAME rather than dropped, and the * table's own load status travels with the report, so a typo in the path shows * up as a named failure instead of as silently missing money. */ import type { ModelPriceContract } from './provider-pricing.js'; /** The environment variable naming the operator's price table. */ export declare const OPERATOR_PRICE_TABLE_ENV = "TOKEN_OPTIMIZER_PRICE_TABLE"; /** * HOW TO WRITE THE FILE, in the one place an operator will look for it. * * It sits next to the parser rather than in a document of its own so the two * cannot drift: a field renamed below is a field renamed here, in the same * edit, and the help text a reader sees is the schema the reader gets. */ export declare const PRICE_TABLE_NOTE: string; export interface OperatorPriceTableStatus { /** The path the environment named, or null when it named none. */ path: string | null; /** Contracts this table contributed to the catalog. */ contracts: number; /** * Why the table contributed nothing, naming the row and field at fault. Null * when there was nothing to load or the whole file loaded. */ error: string | null; } /** The label every rate from this file wears, wherever it is reported. */ export declare function operatorSourceLabel(path: string): string; interface LoadedOperatorPrices { readonly contracts: readonly ModelPriceContract[]; readonly status: OperatorPriceTableStatus; } /** * Read the table the environment names. Exported with the path and clock * injected so a test drives it without touching the process environment. */ export declare function loadOperatorPrices(path: string | null | undefined, now?: () => string): LoadedOperatorPrices; /** * The operator contracts for this process, read once per distinct path. * * A row here is matched BEFORE the shipped catalog, because an operator who has * written down a rate for a model knows something the public page does not -- * a negotiated discount, a gateway's margin, their own hardware. The label goes * with it, so the report still says which of the two priced the request. */ export declare function operatorPriceContracts(env?: NodeJS.ProcessEnv): readonly ModelPriceContract[]; export declare function operatorPriceTableStatus(env?: NodeJS.ProcessEnv): OperatorPriceTableStatus; /** * Forget the cached table. A test that writes a table and then prices against * it needs this, and so does an operator who edits the file under a long-lived * daemon -- without it the daemon serves the rates it read at boot forever. */ export declare function forgetOperatorPrices(): void; export {}; //# sourceMappingURL=operator-prices.d.ts.map