import { ImageGenerationOptions } from '../types'; import { ImageModel, ImagesResponse } from 'openai/resources/images'; /** * Enhanced ImagesResponse that includes cost calculation */ export interface ImageResponseWithUsage extends ImagesResponse { usage?: ImagesResponse['usage'] & { provider: string; model: ImageModel; cost: number; }; } /** * Makes a call to the OpenAI Images API to generate images based on a text prompt. * * This function provides access to OpenAI's image generation capabilities with support for: * - Different output formats (JPEG, PNG, WebP) * - Various image sizes and quality settings * - Multiple image generation in a single call * - Base64 encoded image data return * * @example * // Basic image generation * const response = await makeImagesCall('A beautiful sunset over mountains'); * * @example * // Custom options * const response = await makeImagesCall('A birthday cake', { * size: '1024x1024', * outputFormat: 'png', * quality: 'high', * count: 2 * }); * * @param prompt - The text prompt describing the image to generate * @param options - Configuration options for image generation. Includes: * - size: Image dimensions (uses OpenAI's size options) * - outputFormat: Image format ('jpeg', 'png', 'webp') - defaults to 'webp' * - compression: Compression level (number) - defaults to 50 * - quality: Quality setting (uses OpenAI's quality options) - defaults to 'high' * - count: Number of images to generate - defaults to 1 * - background: Background setting for transparency support * - moderation: Content moderation level * - apiKey: OpenAI API key (optional, falls back to environment variable) * @returns Promise - The image generation response with cost information * @throws Error if the API call fails or invalid parameters are provided */ export declare function makeImagesCall(prompt: string, options?: ImageGenerationOptions): Promise;