/** * Model discovery and schema tools */ export interface ModelsResult { models: Array<{ id: string; name: string; description?: string; category?: string; status?: string; tags?: string[]; thumbnail_url?: string; updated_at?: string; [key: string]: any; }>; total: number; next_cursor: string | null; has_more: boolean; } export interface SearchResult { models: Array<{ id: string; name: string; description?: string; category?: string; status?: string; tags?: string[]; thumbnail_url?: string; [key: string]: any; }>; total: number; next_cursor: string | null; has_more: boolean; } export interface SchemaResult { input_schema: any; output_schema: any; app_id: string; description?: string; [key: string]: any; } /** * List available models in the fal.ai model gallery */ export declare function listModels(category?: string, cursor?: string, limit?: number, status?: "active" | "deprecated", expand?: string[]): Promise; /** * Search for models in the fal.ai gallery using free-text query */ export declare function searchModels(query: string, cursor?: string, limit?: number, category?: string, status?: "active" | "deprecated", expand?: string[]): Promise; /** * Find specific model(s) by endpoint ID */ export declare function findModels(endpointIds: string[], expand?: string[]): Promise; /** * Get the OpenAPI schema for a specific model * Uses the v1 API with expand=openapi-3.0 */ export declare function getModelSchema(appId: string): Promise; export interface PriceEntry { endpoint_id: string; unit_price: number; unit: string; currency: string; } export interface PricingResult { prices: PriceEntry[]; next_cursor: string | null; has_more: boolean; } /** * Get pricing information for specific model endpoint(s) * Requires authentication */ export declare function getPricing(endpointIds: string[], cursor?: string): Promise; export type EstimateType = "historical_api_price" | "unit_price"; export interface HistoricalEstimateEndpoint { call_quantity: number; } export interface UnitPriceEstimateEndpoint { unit_quantity: number; } export interface HistoricalEstimateRequest { estimate_type: "historical_api_price"; endpoints: Record; } export interface UnitPriceEstimateRequest { estimate_type: "unit_price"; endpoints: Record; } export type EstimateRequest = HistoricalEstimateRequest | UnitPriceEstimateRequest; export interface EstimateResult { estimate_type: EstimateType; total_cost: number; currency: string; } /** * Estimate costs for model operations * Supports two methods: * 1. historical_api_price: Based on historical pricing per API call * 2. unit_price: Based on unit price × expected billing units * Requires authentication */ export declare function estimateCost(request: EstimateRequest): Promise; export interface UsageLineItem { endpoint_id: string; unit: string; quantity: number; unit_price: number; auth_method?: string; } export interface UsageTimeBucket { bucket: string; results: UsageLineItem[]; } export interface UsageResult { time_series?: UsageTimeBucket[]; summary?: UsageLineItem[]; next_cursor: string | null; has_more: boolean; } export type UsageTimeframe = "minute" | "hour" | "day" | "week" | "month"; export type UsageExpand = "time_series" | "summary" | "auth_method"; export interface UsageOptions { endpoint_ids: string[]; start?: string; end?: string; timezone?: string; timeframe?: UsageTimeframe; bound_to_timeframe?: boolean; expand?: UsageExpand[]; cursor?: string; limit?: number; } /** * Get usage records for workspace with filters * Requires authentication * * Returns paginated usage records with billing details including: * - Time series data grouped by time buckets * - Aggregate summary statistics * - Unit quantity and pricing information * - Optional auth method tracking */ export declare function getUsage(options: UsageOptions): Promise; export type AnalyticsTimeframe = "hour" | "day" | "week" | "month"; export type AnalyticsMetric = "total_requests" | "successful_requests" | "failed_requests" | "avg_latency_ms"; export interface AnalyticsOptions { endpoint_ids: string[]; start?: string; end?: string; timezone?: string; timeframe?: AnalyticsTimeframe; bound_to_timeframe?: boolean; metric?: AnalyticsMetric; cursor?: string; limit?: number; } export interface AnalyticsBucket { start: string; end: string; total_requests?: number; successful_requests?: number; failed_requests?: number; avg_latency_ms?: number; p50_latency_ms?: number; p95_latency_ms?: number; p99_latency_ms?: number; } export interface AnalyticsTimeseries { endpoint_id: string; buckets: AnalyticsBucket[]; } export interface AnalyticsResult { timeseries: AnalyticsTimeseries[]; next_cursor: string | null; has_more: boolean; } /** * Get analytics data for model endpoints * Requires authentication * * Returns time-bucketed metrics including: * - Request counts (total, successful, failed) * - Latency statistics (avg, p50, p95, p99) * - Success/error rates * * Supports flexible time windows and timezone handling */ export declare function getAnalytics(options: AnalyticsOptions): Promise; //# sourceMappingURL=models.d.ts.map