{"servers":[{"url":"https://api.modellix.ai/api/v1/openai/gpt-image-2"}],"post":{"description":"[Core Function] GPT Image 2 is a state-of-the-art text-to-image generation model. [Strengths] It excels at generating highly detailed, photorealistic images from text descriptions, with native support for ultra-high resolutions including 2K and 4K (up to 3840x2160). [Best For] Highly recommended for: cinematic landscapes, detailed character portraits, high-end commercial concept art, and any scenario requiring maximum resolution and visual fidelity. [Limitations] Do NOT use this model if you need a transparent background (e.g., for icons or UI assets), as it does not support the `background: transparent` parameter. [Routing] Use this model by default for all high-quality image generation requests. If the user explicitly asks for an image with a transparent background, route to GPT Image 1.5 instead.","operationId":"gptImage2Async","requestBody":{"content":{"application/json":{"examples":{"advanced_4k":{"summary":"4K high-resolution generation","value":{"prompt":"Cinematic landscape of a misty mountain range at golden hour, ultra detailed, photorealistic","quality":"high","size":"3840x2160"}},"basic":{"summary":"Basic image generation","value":{"prompt":"A children's book drawing of a veterinarian using a stethoscope to listen to the heartbeat of a baby otter"}}},"schema":{"description":"Request payload for GPT Image 2 generation model.","properties":{"prompt":{"description":"Image description text, supports up to 32,000 characters","example":"A children's book drawing of a veterinarian using a stethoscope to listen to the heartbeat of a baby otter","maxLength":32000,"minLength":1,"type":"string"},"quality":{"default":"low","description":"Image quality level. 'low': fast draft (default), 'medium': balanced, 'high': best quality","enum":["low","medium","high"],"example":"high","type":"string"},"size":{"default":"1024x1024","description":"Output size as width x height, or 'auto' for model-selected size. Presets are valid under OpenAI constraints (total pixels 655360-8294400, edges multiples of 16). Mapping: 1:1 1K/2K; 3:2 1K/2K; 2:3 1K/2K; 4:3 1K/2K; 3:4 1K/2K; 16:9 2K/4K; 9:16 2K/4K. No 1K for 16:9/9:16; no 4K for non-widescreen ratios.","enum":["auto","1024x1024","2048x2048","1536x1024","3072x2048","1024x1536","2048x3072","1024x768","2048x1536","768x1024","1536x2048","2048x1152","3840x2160","1152x2048","2160x3840"],"example":"1024x1024","type":"string"}},"required":["prompt"],"type":"object"}}},"description":"Request payload for GPT Image 2 generation model.","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"description":"Response object for asynchronous task submission.","properties":{"code":{"description":"Response code, 0 indicates success","example":0,"type":"integer"},"data":{"description":"Detailed data about the submitted asynchronous task.","properties":{"get_result":{"description":"API information to query the task result","properties":{"method":{"description":"HTTP method","example":"GET","type":"string"},"url":{"description":"Full URL to query the task result","example":"https://api.modellix.ai/api/v1/tasks/task-openai-abc123","type":"string"}},"type":"object"},"model_id":{"description":"Model ID","example":"gpt-image-2","type":"string"},"status":{"description":"Task status","enum":["pending","processing"],"example":"pending","type":"string"},"task_id":{"description":"Unique task identifier","example":"task-openai-abc123","type":"string"}},"required":["status","task_id","model_id"],"type":"object"},"message":{"description":"Response message","example":"success","type":"string"}},"required":["code","message","data"],"type":"object"}}},"description":"Task submitted successfully"},"400":{"content":{"application/json":{"examples":{"content_violation":{"summary":"Content policy violation","value":{"code":400,"message":"Content policy violation: prompt contains prohibited content"}},"invalid_size":{"summary":"Invalid size parameter","value":{"code":400,"message":"Invalid parameters: size must be one of the supported values"}},"missing_prompt":{"summary":"Missing required parameter","value":{"code":400,"message":"Invalid parameters: parameter 'prompt' is required"}}},"schema":{"description":"Standard error response object.","properties":{"code":{"description":"Error code (equals HTTP status code)","example":400,"type":"integer"},"message":{"description":"Error message in format 'Category: detail'","example":"Invalid parameters: parameter 'prompt' is required","type":"string"}},"required":["code","message"],"type":"object"}}},"description":"Invalid request parameters"},"401":{"content":{"application/json":{"example":{"code":401,"message":"Authentication failed: invalid API key"},"schema":{"description":"Standard error response object.","properties":{"code":{"description":"Error code (equals HTTP status code)","example":400,"type":"integer"},"message":{"description":"Error message in format 'Category: detail'","example":"Invalid parameters: parameter 'prompt' is required","type":"string"}},"required":["code","message"],"type":"object"}}},"description":"Unauthorized - Invalid or missing API Key"},"429":{"content":{"application/json":{"examples":{"insufficient_quota":{"summary":"Insufficient quota","value":{"code":429,"message":"Quota exceeded: insufficient quota, please check your plan and billing"}},"rate_limit":{"summary":"Rate limit exceeded","value":{"code":429,"message":"Rate limit exceeded: too many requests, retry after 20 seconds"}}},"schema":{"description":"Standard error response object.","properties":{"code":{"description":"Error code (equals HTTP status code)","example":400,"type":"integer"},"message":{"description":"Error message in format 'Category: detail'","example":"Invalid parameters: parameter 'prompt' is required","type":"string"}},"required":["code","message"],"type":"object"}}},"description":"Too many requests - Rate limit exceeded or insufficient quota","headers":{"Retry-After":{"description":"Seconds to wait before retrying (optional)","schema":{"example":20,"type":"integer"}},"X-RateLimit-Limit-Requests":{"description":"Maximum requests per minute","schema":{"example":5,"type":"integer"}},"X-RateLimit-Limit-Tokens":{"description":"Maximum tokens per minute","schema":{"example":100000,"type":"integer"}},"X-RateLimit-Remaining-Requests":{"description":"Remaining requests in current window","schema":{"example":0,"type":"integer"}},"X-RateLimit-Remaining-Tokens":{"description":"Remaining tokens in current window","schema":{"example":0,"type":"integer"}},"X-RateLimit-Reset-Requests":{"description":"Time when request limit resets (RFC3339 format)","schema":{"example":"2024-04-23T12:00:00Z","type":"string"}},"X-RateLimit-Reset-Tokens":{"description":"Time when token limit resets (RFC3339 format)","schema":{"example":"2024-04-23T12:00:00Z","type":"string"}}}},"500":{"content":{"application/json":{"examples":{"server_error":{"summary":"Server error","value":{"code":500,"message":"Internal server error: please try again later"}},"service_unavailable":{"summary":"Service unavailable","value":{"code":503,"message":"Service unavailable: OpenAI service is temporarily unavailable"}}},"schema":{"description":"Standard error response object.","properties":{"code":{"description":"Error code (equals HTTP status code)","example":400,"type":"integer"},"message":{"description":"Error message in format 'Category: detail'","example":"Invalid parameters: parameter 'prompt' is required","type":"string"}},"required":["code","message"],"type":"object"}}},"description":"Internal server error"}},"summary":"GPT Image 2","tags":["GPT Image"],"x-mint":{"href":"openai/gpt-image-2"}}}