/** * Ollama Cloud usage HTTP client. * * Talks to `https://ollama.com/api/usage` — an undocumented but live endpoint. * Rewritten upstream (observed 2026-10-10) to return usage analytics * (`{range, totals:{usage_usd, request_count, …}, buckets}`); the accepted * ranges are 24h / 7d / 30d. We request the 30d rolling window — the closest * match to a credit plan's monthly billing period, and the numerator for the * derived monthly percent. Auth is a plain Bearer API key (docs.ollama.com). * No rate-limit headers exist on any Ollama endpoint, so the body is the only * data source. */ /** The undocumented usage endpoint (verified live 2026-09). */ export declare const USAGE_URL = "https://ollama.com/api/usage"; /** * The rolling window we request — the numerator window for the derived * monthly percent. Not the billing month itself: the API offers no * billing-period range, so the percent is an approximation near the reset. */ export declare const USAGE_RANGE = "30d"; /** * Fetch the usage JSON body. * * @throws on network errors or timeout. The caller maps these to * `unavailable`. Auth failures are NOT thrown — the status is * returned so the orchestrator can classify 401/403 as `auth_error`. */ export declare function fetchOcUsage(apiKey: string, fetchImpl?: typeof globalThis.fetch): Promise<{ status: number; text: string; }>; /** The undocumented account-status endpoint (verified live 2026-09). */ export declare const ME_URL = "https://ollama.com/api/me"; /** * Fetch the account-status JSON body (plan tier, subscription period end, * suspended flag) — the only source for the monthly billing-period reset. * * Same contract as {@link fetchOcUsage}: throws on network errors/timeout, * returns the status so the caller classifies 401/403. */ export declare function fetchOcMe(apiKey: string, fetchImpl?: typeof globalThis.fetch): Promise<{ status: number; text: string; }>; //# sourceMappingURL=client.d.ts.map