Nano Banana 2 API: AI इमेज जेनरेशन

Muapi REST API के माध्यम से Nano Banana 2 का उपयोग करके छवियां उत्पन्न करें। प्रति-उपयोग भुगतान — कोई सदस्यता आवश्यक नहीं।

इंटरैक्टिव मॉडल नियंत्रण

मॉडल nano-banana-2, लचीली पे-एज-यू-गो बिलिंग और उच्च समवर्तीता के साथ MuAPI पर उपलब्ध है।

Nano Banana 2 API संदर्भ

Endpoint

POST https://api.muapi.ai/api/v1/nano-banana-2

x-api-key हेडर में अपनी Muapi API कुंजी के साथ एक कार्य सबमिट करें, फिर मतदान करें https://api.muapi.ai/api/v1/predictions/{request_id}/result until status is completed.

Parameters

Nameप्रकारRequiredविवरण
promptstringYesशीघ्रछवि.
aspect_ratiostringNoThe aspect ratio of the generated image.विकल्प: 1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9, Autoडिफ़ॉल्ट: "1:1"
google_searchbooleanNoGoogle खोज संकेत.डिफ़ॉल्ट: false
resolutionstringNoThe resolution of the generated image.विकल्प: 1k, 2k, 4kडिफ़ॉल्ट: "1k"
output_formatstringNoThe format of the output image.विकल्प: jpg, pngडिफ़ॉल्ट: "jpg"

cURL example

REQUEST_ID=$(curl -s -X POST https://api.muapi.ai/api/v1/nano-banana-2 \
  -H "x-api-key: $MUAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt":"<prompt>"}' | jq -r .request_id)

curl -s https://api.muapi.ai/api/v1/predictions/$REQUEST_ID/result -H "x-api-key: $MUAPI_API_KEY"

Python example

import os, time, requests

API = "https://api.muapi.ai/api/v1"
headers = {"x-api-key": os.environ["MUAPI_API_KEY"]}

r = requests.post(f"{API}/nano-banana-2", headers=headers, json={"prompt":"<prompt>"})
request_id = r.json()["request_id"]

while True:
    res = requests.get(f"{API}/predictions/{request_id}/result", headers=headers).json()
    if res["status"] == "completed":
        print(res["outputs"]); break
    if res["status"] == "failed":
        raise RuntimeError(res.get("error"))
    time.sleep(3)

Full docs and agent/MCP integration: llms.txt. Get an API key at muapi.ai/access-keys.