@bernierllc/anthropic-client
Version:
Type-safe Anthropic Claude API client with automatic rate limiting, retry logic, streaming support, and cost tracking
17 lines • 720 B
TypeScript
import { AnthropicClientConfig, CompletionOptions, CompletionResult, StreamChunkCallback, UsageStats, RateLimitStatus } from './types';
export declare class AnthropicClient {
private client;
private logger;
private rateLimiter;
private config;
private stats;
constructor(config: AnthropicClientConfig);
complete(prompt: string, options?: CompletionOptions): Promise<CompletionResult>;
stream(prompt: string, onChunk: StreamChunkCallback, options?: CompletionOptions): Promise<CompletionResult>;
getUsage(): UsageStats;
getRateLimitStatus(): RateLimitStatus | null;
resetUsage(): void;
private updateStats;
private sleep;
}
//# sourceMappingURL=AnthropicClient.d.ts.map