// Generated by dts-bundle-generator v9.5.1

declare const REGIONS: {
	readonly global: "https://api.minimax.io";
	readonly cn: "https://api.minimaxi.com";
};
export type Region = keyof typeof REGIONS;
export interface Config {
	apiKey?: string;
	fileApiKey?: string;
	fileRegion?: Region;
	configPath?: string;
	region: Region;
	baseUrl: string;
	output: "text" | "json";
	timeout: number;
	defaultTextModel?: string;
	defaultSpeechModel?: string;
	defaultVideoModel?: string;
	defaultMusicModel?: string;
	verbose: boolean;
	quiet: boolean;
	noColor: boolean;
	yes: boolean;
	dryRun: boolean;
	nonInteractive: boolean;
	async: boolean;
	needsRegionDetection?: boolean;
}
export interface RequestOpts {
	url: string;
	method?: string;
	body?: unknown;
	headers?: Record<string, string>;
	timeout?: number;
	stream?: boolean;
	noAuth?: boolean;
	authStyle?: "bearer" | "x-api-key";
}
export interface MiniMaxSDKOptions {
	apiKey?: string;
	baseUrl?: string;
	region?: Region;
}
export type ModelPartial<T> = "model" extends keyof T ? Omit<T, "model"> & {
	model?: T["model"];
} : T;
declare class Client {
	protected config: Config;
	constructor(options: MiniMaxSDKOptions);
	protected request(opts: RequestOpts): Promise<Response>;
	protected requestJson<T>(opts: RequestOpts): Promise<T>;
	protected streamSSE<T>(res: Response): AsyncGenerator<T>;
}
export type ContentBlock = {
	type: "text";
	text: string;
} | {
	type: "thinking";
	thinking: string;
} | {
	type: "tool_use";
	id: string;
	name: string;
	input: Record<string, unknown>;
} | {
	type: "tool_result";
	tool_use_id: string;
	content: string;
};
export interface ChatMessage {
	role: "user" | "assistant";
	content: string | ContentBlock[];
}
export interface ChatTool {
	name: string;
	description?: string;
	input_schema: Record<string, unknown>;
}
export interface ChatRequest {
	model: string;
	messages: ChatMessage[];
	max_tokens: number;
	system?: string;
	temperature?: number;
	top_p?: number;
	stream?: boolean;
	tools?: ChatTool[];
	tool_choice?: {
		type: "auto" | "any" | "tool";
		name?: string;
	};
}
export interface ChatResponse {
	id: string;
	type: "message";
	role: "assistant";
	content: ContentBlock[];
	model: string;
	stop_reason: string;
	usage: {
		input_tokens: number;
		output_tokens: number;
	};
}
export interface StreamMessageStart {
	type: "message_start";
	message: ChatResponse;
}
export interface StreamContentBlockStart {
	type: "content_block_start";
	index: number;
	content_block: ContentBlock;
}
export interface StreamContentBlockDelta {
	type: "content_block_delta";
	index: number;
	delta: {
		type: "text_delta";
		text: string;
	} | {
		type: "thinking_delta";
		thinking: string;
	} | {
		type: "input_json_delta";
		partial_json: string;
	};
}
export interface StreamContentBlockStop {
	type: "content_block_stop";
	index: number;
}
export interface StreamMessageDelta {
	type: "message_delta";
	delta: {
		stop_reason: string;
	};
	usage: {
		output_tokens: number;
	};
}
export interface StreamMessageStop {
	type: "message_stop";
}
export type StreamEvent = StreamMessageStart | StreamContentBlockStart | StreamContentBlockDelta | StreamContentBlockStop | StreamMessageDelta | StreamMessageStop;
export interface SpeechRequest {
	model: string;
	text: string;
	voice_setting?: {
		voice_id?: string;
		speed?: number;
		vol?: number;
		pitch?: number;
	};
	audio_setting?: {
		format?: string;
		sample_rate?: number;
		bitrate?: number;
		channel?: number;
	};
	language_boost?: string;
	pronunciation_dict?: Array<{
		tone: string;
		text: string;
	}>;
	output_format?: "url" | "hex";
	stream?: boolean;
	subtitle_enable?: boolean;
}
export interface SpeechResponse {
	base_resp: BaseResp;
	data: {
		audio?: string;
		audio_url?: string;
		subtitle_file?: string;
		status: number;
	};
	extra_info?: {
		audio_length?: number;
		audio_sample_rate?: number;
		audio_size?: number;
		bitrate?: number;
		word_count?: number;
		invisible_character_ratio?: number;
	};
}
export interface SystemVoiceInfo {
	voice_id: string;
	voice_name: string;
	description: string[];
}
export interface ImageRequest {
	model: string;
	prompt: string;
	aspect_ratio?: string;
	n?: number;
	seed?: number;
	width?: number;
	height?: number;
	prompt_optimizer?: boolean;
	aigc_watermark?: boolean;
	response_format?: "url" | "base64";
	subject_reference?: Array<{
		type: string;
		image_url?: string;
		image_file?: string;
	}>;
}
export interface ImageResponse {
	base_resp: BaseResp;
	data: {
		image_urls?: string[];
		image_base64?: string[];
		task_id: string;
		success_count: number;
		failed_count: number;
	};
}
export interface VideoRequest {
	model: string;
	prompt: string;
	first_frame_image?: string;
	last_frame_image?: string;
	callback_url?: string;
	subject_reference?: Array<{
		type: string;
		image: string[];
	}>;
}
export interface VideoResponse {
	base_resp: BaseResp;
	task_id: string;
	status: string;
}
export interface VideoTaskResponse {
	base_resp: BaseResp;
	task_id: string;
	status: "Queueing" | "Processing" | "Success" | "Failed" | "Unknown";
	file_id?: string;
	video_width?: number;
	video_height?: number;
}
export interface MusicRequest {
	model: string;
	prompt?: string;
	lyrics?: string;
	is_instrumental?: boolean;
	lyrics_optimizer?: boolean;
	audio_url?: string;
	audio_base64?: string;
	seed?: number;
	audio_setting?: {
		format?: string;
		sample_rate?: number;
		bitrate?: number;
		channel?: number;
	};
	output_format?: "url" | "hex";
	stream?: boolean;
	aigc_watermark?: boolean;
}
export interface MusicResponse {
	base_resp: BaseResp;
	data: {
		audio?: string;
		audio_url?: string;
		status: number;
	};
	extra_info?: {
		audio_length?: number;
		audio_sample_rate?: number;
		audio_size?: number;
		bitrate?: number;
	};
}
export interface QuotaResponse {
	model_remains: QuotaModelRemain[];
}
export interface QuotaModelRemain {
	model_name: string;
	start_time: number;
	end_time: number;
	remains_time: number;
	current_interval_total_count: number;
	current_interval_usage_count: number;
	current_weekly_total_count: number;
	current_weekly_usage_count: number;
	weekly_start_time: number;
	weekly_end_time: number;
	weekly_remains_time: number;
}
export interface FileUploadResponse {
	base_resp: BaseResp;
	file: {
		file_id: string;
		bytes: number;
		created_at: number;
		filename: string;
		purpose: string;
	};
}
export interface FileListResponse {
	base_resp: BaseResp;
	files: Array<{
		file_id: string;
		bytes: number;
		created_at: number;
		filename: string;
		purpose: string;
	}>;
}
export interface FileDeleteResponse {
	base_resp: BaseResp;
	file_id: number;
}
export interface FileRetrieveResponse {
	base_resp: BaseResp;
	file: {
		file_id: string;
		bytes: number;
		created_at: number;
		filename: string;
		purpose: string;
		download_url?: string;
	};
}
export interface BaseResp {
	status_code: number;
	status_msg: string;
}
declare class TextSDK extends Client {
	private chatStream;
	chat(request: Partial<ChatRequest> & {
		stream: true;
	}): Promise<AsyncGenerator<StreamEvent>>;
	chat(request: Partial<ChatRequest>): Promise<ChatResponse>;
	private validateParams;
}
declare class SpeechSDK extends Client {
	synthesize(request: ModelPartial<SpeechRequest> & {
		stream: true;
	}): Promise<AsyncGenerator<SpeechResponse>>;
	synthesize(request: ModelPartial<SpeechRequest>): Promise<SpeechResponse>;
	private synthesizeStream;
	voices(language?: string): Promise<SystemVoiceInfo[]>;
	/**
	 * Save synthesized speech audio to a file. Decodes the hex-encoded audio
	 * from the API response and writes it to disk. Creates intermediate
	 * directories as needed.
	 *
	 * @param response — The response from `synthesize()`.
	 * @param outPath  — Target file path. Defaults to `speech_<timestamp>.mp3`.
	 * @param ext      — File extension (default: `"mp3"`).
	 * @returns The absolute path of the saved file.
	 */
	save(response: SpeechResponse, outPath?: string, ext?: string): string;
	private validateParams;
}
export interface ImageSaveOptions {
	/** Save to exact file path (single image only). */
	out?: string;
	/** Save images to directory (default: "."). */
	outDir?: string;
	/** Filename prefix (default: "image"). */
	prefix?: string;
	/** Response format used by generate() — "url" or "base64" (default: "url"). */
	responseFormat?: "url" | "base64";
	/** Suppress progress output. */
	quiet?: boolean;
}
declare class ImageSDK extends Client {
	generate(request: ModelPartial<ImageRequest>): Promise<ImageResponse>;
	/**
	 * Download and save images from a `generate()` response to disk.
	 *
	 * Handles both `"url"` (CDN download) and `"base64"` response formats
	 * and creates intermediate directories as needed. Returns the absolute
	 * paths of all saved files.
	 */
	save(response: ImageResponse, options?: ImageSaveOptions): Promise<string[]>;
	private validateParams;
}
export interface VideoAsyncGenerateRequest extends ModelPartial<VideoRequest> {
	async?: boolean;
	pollInterval?: number;
	timeout?: number;
}
export interface VideoDownloadRequest {
	fileId: string;
	outPath: string;
}
declare class VideoSDK extends Client {
	generate(request: VideoAsyncGenerateRequest & {
		async: true;
	}): Promise<{
		taskId: string;
	}>;
	generate(request: ModelPartial<VideoAsyncGenerateRequest>): Promise<VideoResponse>;
	getTask({ taskId }: {
		taskId: string;
	}): Promise<VideoTaskResponse>;
	download(request: VideoDownloadRequest): Promise<{
		size: number;
		save: string;
		downloadUrl: string;
	}>;
	private validateParams;
}
export interface MusicGenerateRequest extends MusicRequest {
	/** Vocal style, e.g. "warm male baritone", "bright female soprano", "duet with harmonies" */
	vocals?: string;
	/** Music genre, e.g. folk, pop, jazz */
	genre?: string;
	/** Mood or emotion, e.g. warm, melancholic, uplifting */
	mood?: string;
	/** Instruments to feature, e.g. "acoustic guitar, piano" */
	instruments?: string;
	/** Tempo description, e.g. fast, slow, moderate */
	tempo?: string;
	/** Exact tempo in beats per minute */
	bpm?: number;
	/** Musical key, e.g. C major, A minor, G sharp */
	key?: string;
	/** Elements to avoid in the generated music */
	avoid?: string;
	/** Use case context, e.g. "background music for video", "theme song" */
	use_case?: string;
	/** Song structure, e.g. "verse-chorus-verse-bridge-chorus" */
	structure?: string;
	/** Reference tracks or artists, e.g. "similar to Ed Sheeran, Taylor Swift" */
	references?: string;
	/** Additional fine-grained requirements not covered above */
	extra?: string;
	/** Generate instrumental music (no vocals) */
	instrumental?: boolean;
	/** Use case */
	useCase?: string;
}
declare class MusicSDK extends Client {
	private generateStream;
	generate(request: ModelPartial<MusicGenerateRequest> & {
		stream: true;
	}): Promise<AsyncGenerator<Uint8Array<ArrayBuffer>>>;
	generate(request: ModelPartial<MusicGenerateRequest>): Promise<MusicResponse>;
	/**
	 * Save generated music audio to a file. Decodes the hex-encoded audio
	 * from the API response and writes it to disk. Creates intermediate
	 * directories as needed.
	 *
	 * @param response — The response from `generate()`.
	 * @param outPath  — Target file path. Defaults to `music_<timestamp>.mp3`.
	 * @param ext      — File extension (default: `"mp3"`).
	 * @returns The absolute path of the saved file.
	 */
	save(response: MusicResponse, outPath?: string, ext?: string): string;
	private buildPrompt;
	private validateParams;
}
export interface SearchResult {
	title: string;
	link: string;
	snippet: string;
	date: string;
}
export interface SearchResponse {
	organic: SearchResult[];
}
declare class SearchSDK extends Client {
	query(query: string): Promise<SearchResponse>;
}
export interface VlmResponse {
	content: string;
}
export interface ImageDescribeRequest {
	prompt?: string;
	image: string;
}
declare class VisionSDK extends Client {
	describe(request: ImageDescribeRequest): Promise<VlmResponse>;
}
declare class QuotaSDK extends Client {
	info(): Promise<QuotaResponse>;
}
declare class FileSDK extends Client {
	/**
	 * Upload a file to MiniMax storage.
	 *
	 * @param filePath - Absolute or relative path to the file on disk.
	 * @param purpose  - File purpose, defaults to `"retrieval"`.
	 */
	upload(filePath: string, purpose?: string): Promise<FileUploadResponse>;
	/** List all files in MiniMax storage. */
	list(): Promise<FileListResponse>;
	/**
	 * Delete a file from MiniMax storage by its file ID.
	 *
	 * @param fileId - The ID of the file to delete (string or number).
	 */
	delete(fileId: string | number): Promise<FileDeleteResponse>;
	/**
	 * Retrieve metadata (and optional download URL) for a file.
	 *
	 * @param fileId - The ID of the file to retrieve.
	 */
	retrieve(fileId: string): Promise<FileRetrieveResponse>;
}
export declare class MiniMaxSDK extends Client {
	readonly text: TextSDK;
	readonly speech: SpeechSDK;
	readonly image: ImageSDK;
	readonly video: VideoSDK;
	readonly music: MusicSDK;
	readonly search: SearchSDK;
	readonly vision: VisionSDK;
	readonly quota: QuotaSDK;
	readonly file: FileSDK;
	constructor(options: MiniMaxSDKOptions);
}

export {};
