/** * Anthropic Batch API client for ralph-starter. * * Submits multiple requests as a batch for 50% cost reduction. * Batch requests are processed asynchronously (up to 24 hours). */ export interface BatchRequest { /** Unique identifier for this request within the batch */ customId: string; /** System message (project context, specs, etc.) */ system?: string; /** User message (the task prompt) */ prompt: string; /** Model to use */ model?: string; /** Max tokens for the response */ maxTokens?: number; } export interface BatchResult { /** The custom_id from the request */ customId: string; /** Whether this individual request succeeded */ success: boolean; /** The response content (if successful) */ content?: string; /** Error message (if failed) */ error?: string; /** Token usage */ usage?: { inputTokens: number; outputTokens: number; }; } export interface BatchStatus { /** The batch ID */ batchId: string; /** Current processing status */ status: 'in_progress' | 'canceling' | 'ended'; /** Number of requests in the batch */ totalRequests: number; /** Number of completed requests */ completedRequests: number; /** Number of failed requests */ failedRequests: number; /** When the batch was created */ createdAt: string; /** When the batch finished (if ended) */ endedAt?: string; } /** * Submit a batch of requests to the Anthropic Batch API. * Returns the batch ID for polling. */ export declare function submitBatch(apiKey: string, requests: BatchRequest[]): Promise; /** * Poll a batch for its current status. */ export declare function getBatchStatus(apiKey: string, batchId: string): Promise; /** * Retrieve results for a completed batch. */ export declare function getBatchResults(apiKey: string, batchId: string): Promise; /** * Poll a batch until it completes, with exponential backoff. * Calls onProgress on each poll for status updates. */ export declare function waitForBatch(apiKey: string, batchId: string, options?: { /** Callback on each poll */ onProgress?: (status: BatchStatus) => void; /** Maximum wait time in ms (default: 24 hours) */ maxWaitMs?: number; /** Initial poll interval in ms (default: 5 seconds) */ initialIntervalMs?: number; /** Maximum poll interval in ms (default: 60 seconds) */ maxIntervalMs?: number; }): Promise; //# sourceMappingURL=batch.d.ts.map