export type CreateApiMinimax08853fV1ImageGenerationArgs = {body: {prompt: string, aspect_ratio?: string | undefined, width?: number | undefined, height?: number | undefined, n?: number | undefined, response_format?: string | undefined, seed?: number | undefined, prompt_optimizer?: boolean | undefined, subject_reference?: Array | undefined}}; export type CreateApiMinimax08853fV1ImageGenerationOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Generate 1-9 images from a text prompt, optionally guided by a subject reference image (image-to-image). Model fixed to image-01. URLs expire after 24h. * * POST /minimax-08853f/v1/image_generation */ export const createApiMinimax08853fV1ImageGeneration = async (args: CreateApiMinimax08853fV1ImageGenerationArgs, options?: CreateApiMinimax08853fV1ImageGenerationOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/minimax-08853f/v1/image_generation${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };