import type { GetKeyData, ListData } from "@openrouter/sdk/models/operations"; import type { GetAnalyticsMetaData, QueryAnalyticsRequestBody } from "@openrouter/sdk/models/operations"; import type { Workspace } from "@openrouter/sdk/models"; export interface OpenRouterClientOptions { /** The Workspace to use if using something other than "Default" */ workspace?: Pick; /** * Request timeout in milliseconds * @default 30000 */ timeout?: number; /** * Whether to enable verbose logging * @default false */ verbose?: boolean; /** Override the OpenRouter API base URL. Primarily useful for testing. */ serverURL?: string; /** Override the fetch implementation used by the raw analytics transport. */ fetch?: typeof globalThis.fetch; } export type AnalyticsMetadata = GetAnalyticsMetaData; export type AnalyticsQuery = QueryAnalyticsRequestBody; export type RawAnalyticsRow = Record; export interface RawAnalyticsResult { data: RawAnalyticsRow[]; metadata: { queryTimeMs: number; rowCount: number; truncated: boolean; }; cachedAt?: number; warnings: string[]; } export declare class OpenRouterClient { private readonly client; private readonly workspaceId?; private readonly verbose; private readonly provisioningKey; private readonly timeout; private readonly serverURL; private readonly fetcher; constructor(provisioningKey: string, options?: OpenRouterClientOptions); private apiErrorForStatus; private toApiError; /** Return the live catalog of analytics metrics, dimensions, and operators. */ getAnalyticsMeta(): Promise; /** * Query analytics without dropping dynamic metric and dimension fields. * * The SDK request serializer is used, but the response is intentionally read * as JSON because the generated SDK response schema currently strips row * properties. */ queryAnalytics(query: AnalyticsQuery): Promise; private shouldRetryStatus; private canRetry; private isTimeoutError; private wait; private parseRawAnalyticsResult; createKey(keyName: string, limit: number, expiresAt?: string): Promise<{ key: string; hash: string; }>; listKeys(includeDisabled?: boolean): Promise; disableKey(hash: string): Promise; enableKey(hash: string): Promise; getKey(hash: string): Promise; setKeyLimit(hash: string, limit: number): Promise; deleteKeyByHash(hash: string): Promise; deleteKey(keyName: string): Promise; /** Workspaces */ listWorkspaces(): Promise; getWorkspace(workspaceId: string): Promise; createWorkspace(options: { name: string; slug?: string; description?: string; }): Promise; deleteWorkspace(workspaceId: string): Promise; } //# sourceMappingURL=api-client.d.ts.map