{"openapi":"3.0.2","info":{"title":"minimax/minimax-nano-banana-2","description":"The request body Comfy Router accepts for the model \"minimax/minimax-nano-banana-2\", and the response body it returns. The INPUT schema is the same schema the server validates a call against before it reaches the provider, so what is published and what is enforced cannot differ. `x-comfy-router-input-modalities` records the media kinds the model is documented to accept; the request schema is shared across sibling models and may admit media kinds this model ignores. The OUTPUT schema describes the provider's native result document exactly as Router returns it: Router does not validate, narrow or re-envelope the response, so the output schema is descriptive rather than enforced, and Comfy owns no output shape of its own.","version":"0f6896cfed19"},"paths":{"/v2/models/minimax/minimax-nano-banana-2":{"post":{"operationId":"runRouterModel","summary":"Run minimax/minimax-nano-banana-2 synchronously.","security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"Request body for Google's Nano Banana image models served by MiniMax. It is Gemini's `generateContent` body: Comfy Router checks it and forwards it to MiniMax unchanged, and returns MiniMax's Gemini-shaped response. MiniMax accepts `contents`, `systemInstruction` (and the snake_case spelling `system_instruction`, held to the same shape), `generationConfig` and `safetySettings`. A body that sets both `systemInstruction` and `system_instruction` is refused. Tools are not accepted: omit `tools`, or send an empty array; a non-empty `tools` array, including `functionDeclarations`, is refused with a 400. Any other top-level field (a snake_case `generation_config` included) is refused with a 400. `minimax/minimax-nano-banana-2` takes `imageSize` `512px`, `1K`, `2K` or `4K`. Reference images go inline only: an `inlineData` part must be a PNG, JPEG or WebP of at most 7 MB decoded, and `minimax/minimax-nano-banana` takes at most 3 of them, `minimax/minimax-nano-banana-pro` at most 14. A `fileData` part, or an `inlineData` or `fileData` object anywhere but directly on `contents[].parts[]` or `systemInstruction.parts[]`, is refused with a 400. Location metadata is stripped from each image before it is forwarded. While Router's text-input-only switch for this provider is on, any part other than text is refused with a 400 before it reaches MiniMax.\nEach id has a SECOND route, which takes the native model's body instead: for example `vertexai/gemini-3.1-flash-image?model_provider=minimax` is validated against that model's own schema, and fields MiniMax does not accept are dropped and listed in `X-Comfy-Router-Dropped-Params` rather than forwarded.","example":{"contents":[{"parts":[{"text":"A watercolor fox curled up in fresh snow"}],"role":"user"}],"generationConfig":{"imageConfig":{"aspectRatio":"16:9"},"responseModalities":["IMAGE"]}},"properties":{"contents":{"description":"The conversation turns. Each part is a text part or an inline reference image.","items":{"$ref":"#/components/schemas/GeminiContent"},"minItems":1,"type":"array"},"generationConfig":{"$ref":"#/components/schemas/MinimaxRouterNanoBanana2GenerationConfig"},"safetySettings":{"items":{"$ref":"#/components/schemas/GeminiSafetySetting"},"type":"array"},"systemInstruction":{"$ref":"#/components/schemas/GeminiSystemInstructionContent"},"system_instruction":{"$ref":"#/components/schemas/GeminiSystemInstructionContent"},"tools":{"description":"Not accepted. Omit this field, or send an empty array. A non-empty array, including function declarations, is refused with a 400.","items":{"type":"object"},"maxItems":0,"type":"array"}},"required":["contents"],"type":"object"}}}},"responses":{"200":{"description":"OK - the model's native JSON output, returned unchanged; the schema describes the provider's terminal result document as Router returns it.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/GeminiGenerateContentResponse"}],"description":"Comfy Router output schema for the Nano Banana models MiniMax serves: Gemini's `generateContent` response. The generated image arrives as base64 bytes at `candidates[0].content.parts[].inlineData.data`, with its media type at `inlineData.mimeType`; a response may carry a text part alongside it, so select the part by the field you need rather than by index. Thought-stage parts are removed before the response is returned.\nRouter does not re-host anything on these routes: MiniMax returns the image as bytes and no link of its own, so there is no partner URL to rewrite. `uploadImagesToStorage` is not offered here.\nThe example's `inlineData.data` is the PLACEHOLDER `PGJhc2U2ND4=`, which decodes to the literal text `\u003cbase64\u003e`; a real image would be megabytes.","example":{"candidates":[{"content":{"parts":[{"inlineData":{"data":"PGJhc2U2ND4=","mimeType":"image/png"}}],"role":"model"},"finishReason":"STOP"}],"usageMetadata":{"candidatesTokenCount":1290,"promptTokenCount":11,"totalTokenCount":1301}}}}}}}}}},"components":{"schemas":{"GeminiCandidate":{"properties":{"citationMetadata":{"$ref":"#/components/schemas/GeminiCitationMetadata"},"content":{"$ref":"#/components/schemas/GeminiContent"},"finishReason":{"type":"string"},"safetyRatings":{"items":{"$ref":"#/components/schemas/GeminiSafetyRating"},"type":"array"}},"type":"object"},"GeminiCitation":{"properties":{"authors":{"items":{"type":"string"},"type":"array"},"endIndex":{"type":"integer"},"license":{"type":"string"},"publicationDate":{"format":"date","type":"string"},"startIndex":{"type":"integer"},"title":{"type":"string"},"uri":{"type":"string"}},"type":"object"},"GeminiCitationMetadata":{"properties":{"citations":{"items":{"$ref":"#/components/schemas/GeminiCitation"},"type":"array"}},"type":"object"},"GeminiContent":{"description":"The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history and the latest request.\n","properties":{"parts":{"items":{"$ref":"#/components/schemas/GeminiPart"},"type":"array"},"role":{"enum":["user","model"],"example":"user","type":"string"}},"required":["parts"],"type":"object"},"GeminiFileData":{"description":"URI based data.","properties":{"fileUri":{"description":"URI","type":"string"},"mimeType":{"$ref":"#/components/schemas/GeminiMimeType"}},"type":"object"},"GeminiGenerateContentResponse":{"properties":{"candidates":{"items":{"$ref":"#/components/schemas/GeminiCandidate"},"type":"array"},"createTime":{"description":"Timestamp when the response was created.","type":"string"},"modelVersion":{"description":"The model version used to generate the response.","type":"string"},"promptFeedback":{"$ref":"#/components/schemas/GeminiPromptFeedback"},"responseId":{"description":"Unique identifier for the response.","type":"string"},"usageMetadata":{"$ref":"#/components/schemas/GeminiUsageMetadata"}},"type":"object"},"GeminiInlineData":{"description":"Inline data in raw bytes. For gemini-2.0-flash-lite and gemini-2.0-flash, you can specify up to 3000 images by using inlineData.\n","properties":{"data":{"description":"The base64 encoding of the image, PDF, or video to include inline in the prompt. When including media inline, you must also specify the media type (mimeType) of the data. Size limit: 20MB\n","format":"byte","type":"string"},"mimeType":{"$ref":"#/components/schemas/GeminiMimeType"}},"type":"object"},"GeminiMimeType":{"description":"The media type of the file specified in the data or fileUri fields. Acceptable values include the following. For gemini-2.0-flash-lite and gemini-2.0-flash, the maximum length of an audio file is 8.4 hours and the maximum length of a video file (without audio) is one hour. For more information, see Gemini audio and video requirements. Text files must be UTF-8 encoded. The contents of the text file count toward the token limit. There is no limit on image resolution.","enum":["application/pdf","audio/mpeg","audio/mp3","audio/wav","image/png","image/jpeg","image/webp","text/plain","video/mov","video/mpeg","video/mp4","video/mpg","video/avi","video/wmv","video/mpegps","video/flv","image/heic","image/heif","audio/flac","video/webm"],"type":"string"},"GeminiPart":{"properties":{"fileData":{"$ref":"#/components/schemas/GeminiFileData"},"inlineData":{"$ref":"#/components/schemas/GeminiInlineData"},"mediaProcessing":{"description":"How the model reads this part's video. Set \"AGENTIC\" to let the model decide which segments to inspect, instead of fixed-rate frame sampling. Omit for the default fixed-rate sampling. Supported on gemini-3.7-flash and newer Flash models.\n","type":"string"},"text":{"description":"A text prompt or code snippet.","example":"Write a story about a robot learning to paint","type":"string"},"thought":{"description":"Indicates this part is a thinking/reasoning step from the model.","type":"boolean"}},"type":"object"},"GeminiPromptFeedback":{"properties":{"blockReason":{"type":"string"},"blockReasonMessage":{"type":"string"},"safetyRatings":{"items":{"$ref":"#/components/schemas/GeminiSafetyRating"},"type":"array"}},"type":"object"},"GeminiSafetyCategory":{"enum":["HARM_CATEGORY_SEXUALLY_EXPLICIT","HARM_CATEGORY_HATE_SPEECH","HARM_CATEGORY_HARASSMENT","HARM_CATEGORY_DANGEROUS_CONTENT"],"type":"string"},"GeminiSafetyRating":{"properties":{"category":{"$ref":"#/components/schemas/GeminiSafetyCategory"},"probability":{"description":"The probability that the content violates the specified safety category","enum":["NEGLIGIBLE","LOW","MEDIUM","HIGH","UNKNOWN"],"type":"string"}},"type":"object"},"GeminiSafetySetting":{"description":"Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.\n","properties":{"category":{"$ref":"#/components/schemas/GeminiSafetyCategory"},"threshold":{"$ref":"#/components/schemas/GeminiSafetyThreshold"}},"required":["category","threshold"],"type":"object"},"GeminiSafetyThreshold":{"enum":["OFF","BLOCK_NONE","BLOCK_LOW_AND_ABOVE","BLOCK_MEDIUM_AND_ABOVE","BLOCK_ONLY_HIGH"],"type":"string"},"GeminiSystemInstructionContent":{"description":"Instructions for the model to steer it toward better performance. For example, \"Answer as concisely as possible\" or \"Don't use technical terms in your response\". The text strings count toward the token limit. The role field of systemInstruction is ignored and doesn't affect the performance of the model. Note: Only text should be used in parts and content in each part should be in a separate paragraph.\n","properties":{"parts":{"description":"A list of ordered parts that make up a single message. Different parts may have different IANA MIME types. For limits on the inputs, such as the maximum number of tokens or the number of images, see the model specifications on the Google models page.\n","items":{"$ref":"#/components/schemas/GeminiTextPart"},"type":"array"},"role":{"description":"The identity of the entity that creates the message. The following values are supported: user: This indicates that the message is sent by a real person, typically a user-generated message. model: This indicates that the message is generated by the model. The model value is used to insert messages from the model into the conversation during multi-turn conversations. For non-multi-turn conversations, this field can be left blank or unset.\n","enum":["user","model"],"example":"user","type":"string"}},"required":["parts"],"type":"object"},"GeminiTextPart":{"properties":{"text":{"description":"A text prompt or code snippet.","example":"Answer as concisely as possible","type":"string"}},"type":"object"},"GeminiUsageMetadata":{"properties":{"cachedContentTokenCount":{"description":"Output only. Number of tokens in the cached part in the input (the cached content).","type":"integer"},"candidatesTokenCount":{"description":"Number of tokens in the response(s).","type":"integer"},"candidatesTokensDetails":{"description":"Breakdown of candidate tokens by modality.","items":{"$ref":"#/components/schemas/ModalityTokenCount"},"type":"array"},"promptTokenCount":{"description":"Number of tokens in the request. When cachedContent is set, this is still the total effective prompt size meaning this includes the number of tokens in the cached content.","type":"integer"},"promptTokensDetails":{"description":"Breakdown of prompt tokens by modality.","items":{"$ref":"#/components/schemas/ModalityTokenCount"},"type":"array"},"thoughtsTokenCount":{"description":"Number of tokens present in thoughts output.","type":"integer"},"toolUsePromptTokenCount":{"description":"Number of tokens present in tool-use prompt(s).","type":"integer"},"toolUsePromptTokensDetails":{"description":"Breakdown of tool-use prompt tokens by modality.","items":{"$ref":"#/components/schemas/ModalityTokenCount"},"type":"array"},"totalTokenCount":{"description":"Total number of tokens (prompt + candidates).","type":"integer"},"trafficType":{"description":"Traffic type used for the request (e.g., PROVISIONED_THROUGHPUT).","type":"string"}},"type":"object"},"MinimaxRouterNanoBanana2GenerationConfig":{"additionalProperties":false,"description":"The generationConfig fields MiniMax accepts. `imageSize` is `512px`, `1K`, `2K` or `4K`.","properties":{"candidateCount":{"description":"Number of candidates. These models answer exactly one per request.","maximum":1,"minimum":1,"type":"integer"},"imageConfig":{"additionalProperties":false,"properties":{"aspectRatio":{"description":"Aspect ratio of the generated image, for example `1:1` or `16:9`.","type":"string"},"imageSize":{"description":"Size of the generated image, in MiniMax's spelling: `512px`, `1K`, `2K` or `4K`.","enum":["512px","1K","2K","4K"],"type":"string"}},"type":"object"},"maxOutputTokens":{"maximum":65536,"minimum":16,"type":"integer"},"responseModalities":{"description":"Output modalities. When present it must include `IMAGE`: these are image models, and a text-only generation is refused.","items":{"enum":["TEXT","IMAGE"],"type":"string"},"type":"array"},"stopSequences":{"items":{"type":"string"},"type":"array"},"temperature":{"maximum":2,"minimum":0,"type":"number"},"thinkingConfig":{"additionalProperties":false,"properties":{"includeThoughts":{"description":"Thought-stage parts are never returned by this provider, so only `false` is accepted.","enum":[false],"type":"boolean"},"thinkingBudget":{"type":"integer"},"thinkingLevel":{"enum":["THINKING_LEVEL_UNSPECIFIED","LOW","MEDIUM","HIGH","MINIMAL"],"type":"string"}},"type":"object"},"topK":{"minimum":1,"type":"integer"},"topP":{"maximum":1,"minimum":0,"type":"number"}},"type":"object"},"Modality":{"description":"Type of input or output content modality.","enum":["MODALITY_UNSPECIFIED","TEXT","IMAGE","VIDEO","AUDIO","DOCUMENT"],"type":"string"},"ModalityTokenCount":{"properties":{"modality":{"$ref":"#/components/schemas/Modality"},"tokenCount":{"description":"Number of tokens for the given modality.","type":"integer"}},"type":"object"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"x-comfy-router-model-id":"minimax/minimax-nano-banana-2","x-comfy-input-schema-authored":true,"x-comfy-output-schema-authored":true,"x-comfy-router-input-modalities":["text","image"],"x-comfy-router-output-modalities":["image","text"],"x-comfy-router-alias-of":"vertexai/gemini-3.1-flash-image","x-comfy-router-alias-provider":"minimax"}
