/** * @license * Copyright 2025 Vybestack LLC * SPDX-License-Identifier: Apache-2.0 */ import { z } from 'zod'; /** * Schema for a single usage period from Anthropic OAuth usage endpoint */ export declare const UsagePeriodSchema: z.ZodObject<{ utilization: z.ZodNumber; resets_at: z.ZodOptional>; }, "strip", z.ZodTypeAny, { utilization: number; resets_at?: string | null | undefined; }, { utilization: number; resets_at?: string | null | undefined; }>; /** * Schema for Anthropic OAuth usage response * Based on https://api.anthropic.com/api/oauth/usage endpoint * * The response includes multiple quota types: * - five_hour: 5-hour rolling window usage * - seven_day: 7-day rolling window usage (general) * - seven_day_oauth_apps: OAuth apps specific quota * - seven_day_opus: Opus model specific quota * - seven_day_sonnet: Sonnet model specific quota (if applicable) * * Uses passthrough() to allow for unknown fields from the API */ export declare const AnthropicUsageInfoSchema: z.ZodObject<{ five_hour: z.ZodOptional>; }, "strip", z.ZodTypeAny, { utilization: number; resets_at?: string | null | undefined; }, { utilization: number; resets_at?: string | null | undefined; }>>>; seven_day: z.ZodOptional>; }, "strip", z.ZodTypeAny, { utilization: number; resets_at?: string | null | undefined; }, { utilization: number; resets_at?: string | null | undefined; }>>>; seven_day_oauth_apps: z.ZodOptional>; }, "strip", z.ZodTypeAny, { utilization: number; resets_at?: string | null | undefined; }, { utilization: number; resets_at?: string | null | undefined; }>>>; seven_day_opus: z.ZodOptional>; }, "strip", z.ZodTypeAny, { utilization: number; resets_at?: string | null | undefined; }, { utilization: number; resets_at?: string | null | undefined; }>>>; seven_day_sonnet: z.ZodOptional>; }, "strip", z.ZodTypeAny, { utilization: number; resets_at?: string | null | undefined; }, { utilization: number; resets_at?: string | null | undefined; }>>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ five_hour: z.ZodOptional>; }, "strip", z.ZodTypeAny, { utilization: number; resets_at?: string | null | undefined; }, { utilization: number; resets_at?: string | null | undefined; }>>>; seven_day: z.ZodOptional>; }, "strip", z.ZodTypeAny, { utilization: number; resets_at?: string | null | undefined; }, { utilization: number; resets_at?: string | null | undefined; }>>>; seven_day_oauth_apps: z.ZodOptional>; }, "strip", z.ZodTypeAny, { utilization: number; resets_at?: string | null | undefined; }, { utilization: number; resets_at?: string | null | undefined; }>>>; seven_day_opus: z.ZodOptional>; }, "strip", z.ZodTypeAny, { utilization: number; resets_at?: string | null | undefined; }, { utilization: number; resets_at?: string | null | undefined; }>>>; seven_day_sonnet: z.ZodOptional>; }, "strip", z.ZodTypeAny, { utilization: number; resets_at?: string | null | undefined; }, { utilization: number; resets_at?: string | null | undefined; }>>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ five_hour: z.ZodOptional>; }, "strip", z.ZodTypeAny, { utilization: number; resets_at?: string | null | undefined; }, { utilization: number; resets_at?: string | null | undefined; }>>>; seven_day: z.ZodOptional>; }, "strip", z.ZodTypeAny, { utilization: number; resets_at?: string | null | undefined; }, { utilization: number; resets_at?: string | null | undefined; }>>>; seven_day_oauth_apps: z.ZodOptional>; }, "strip", z.ZodTypeAny, { utilization: number; resets_at?: string | null | undefined; }, { utilization: number; resets_at?: string | null | undefined; }>>>; seven_day_opus: z.ZodOptional>; }, "strip", z.ZodTypeAny, { utilization: number; resets_at?: string | null | undefined; }, { utilization: number; resets_at?: string | null | undefined; }>>>; seven_day_sonnet: z.ZodOptional>; }, "strip", z.ZodTypeAny, { utilization: number; resets_at?: string | null | undefined; }, { utilization: number; resets_at?: string | null | undefined; }>>>; }, z.ZodTypeAny, "passthrough">>; /** * Single usage period information (may be null) */ export type UsagePeriod = z.infer | null; /** * Anthropic usage information from OAuth endpoint */ export type AnthropicUsageInfo = z.infer; /** * Fetch usage information from Anthropic OAuth endpoint * Requires an OAuth token (sk-ant-oat01-...) from Claude Code/Max authentication * * @param accessToken - OAuth access token * @returns Usage info if available, null on error */ export declare function fetchAnthropicUsage(accessToken: string): Promise; /** * Format a usage period for display */ export declare function formatUsagePeriod(period: UsagePeriod, label: string): string | null; /** * Format all available usage periods for display * Handles both known and unknown quota types from the API */ export declare function formatAllUsagePeriods(usage: AnthropicUsageInfo): string[];