{"slug":"gemini-nano-banana-2.1","name":"Nano Banana 2.1","family":"gemini","family_name":"Gemini","developer":"Google","color":"#4285f4","status":"active","released":"2026-10-06","snapshot_of":null,"open":false,"context":65536,"max_output":58982,"knowledge_cutoff":null,"modalities":["text","image"],"output_modalities":["text","image"],"reasoning":true,"tools":true,"structured_output":true,"huggingface":null,"speed":null,"latency":null,"short":"Closed-weight Google model accepting text and image input, with tool calling, reasoning mode and structured output. It has no benchmark results, and its blended price sits well above the registry median.","strengths":["Supports tool calling, reasoning mode and structured output","Accepts both text and image input","Responses can run to 58,982 tokens, the largest response length listed","Built into the Pydantic AI Gateway"],"weaknesses":["No benchmark results, so its quality cannot be ranked","Blended price of $3 per million tokens, about three times the median","Context window of 65k tokens is small for long documents"],"best_for":"Agents that need tool calling, image input and structured output, and can proceed without benchmark evidence.","long":"Nano Banana 2.1 is a closed-weight model from Google, offered through Google Vertex and OpenRouter. It accepts text and image input and supports tool calling, reasoning mode and structured output. Its 65k-token context window is small, though responses can run to 58,982 tokens.\n\nThe registry holds no benchmark results for it, so its quality cannot be compared with other models. Pricing is $1.5 per million input tokens and $7.5 per million output tokens, giving a blended price of $3, roughly three times the registry median of about $1.\n\nIts popularity ranks 150 of 194 and its price ranks 132 of 194. No knowledge cutoff is recorded. It is built into the Pydantic AI Gateway, so it can be used there without a separate integration.","described":true,"gateway":true,"byok":true,"string":"gateway/google-cloud:gemini-nano-banana-2.1","input":1.5,"output":7.5,"cache_read":null,"blended":3,"efficiency":null,"bench":{},"offers":[{"provider":"google","name":"Google Vertex","model_id":"gemini-nano-banana-2.1","api":["anthropic","gemini"],"input":1.5,"output":7.5,"cache_read":null,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":null,"deprecated":false,"gateway":true,"gateway_route":"google-vertex","byok":true,"string":"google-cloud:gemini-nano-banana-2.1","gateway_string":"gateway/google-cloud:gemini-nano-banana-2.1"},{"provider":"openrouter","name":"OpenRouter","model_id":"google/gemini-nano-banana-2.1","api":["openai"],"input":1.5,"output":7.5,"cache_read":null,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":65536,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"openrouter:google/gemini-nano-banana-2.1","gateway_string":null}],"ranks":{"intelligence":null,"popularity":150,"efficiency":null,"speed":null,"price":132},"top_score":0.0952,"about":["Closed-weight Google model accepting text and image input, with tool calling, reasoning mode and structured output. It has no benchmark results, and its blended price sits well above the registry median.","Nano Banana 2.1 is a closed-weight model from Google, offered through Google Vertex and OpenRouter. It accepts text and image input and supports tool calling, reasoning mode and structured output. Its 65k-token context window is small, though responses can run to 58,982 tokens.","The registry holds no benchmark results for it, so its quality cannot be compared with other models. Pricing is $1.5 per million input tokens and $7.5 per million output tokens, giving a blended price of $3, roughly three times the registry median of about $1.","Its popularity ranks 150 of 194 and its price ranks 132 of 194. No knowledge cutoff is recorded. It is built into the Pydantic AI Gateway, so it can be used there without a separate integration."],"examples":[{"file":"hello.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport os\n\nfrom pydantic_ai import Agent\n\nos.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'\n\nagent = Agent('gateway/google-cloud:gemini-nano-banana-2.1', instructions='Be concise, reply with one sentence.')\n\nresult = agent.run_sync('Where does \"hello world\" come from?')\nprint(result.output)","soon":false},{"file":"structured_output.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport os\n\nfrom pydantic import BaseModel\nfrom pydantic_ai import Agent\n\nos.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'\n\n\nclass CityLocation(BaseModel):\n    city: str\n    country: str\n\n\nagent = Agent('gateway/google-cloud:gemini-nano-banana-2.1', output_type=CityLocation)\n\nresult = agent.run_sync('Where were the olympics held in 2012?')\nprint(result.output)\n#> city='London' country='United Kingdom'","soon":false},{"file":"tools.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport os\nimport random\n\nfrom pydantic_ai import Agent, RunContext\n\nos.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'\n\nagent = Agent(\n    'gateway/google-cloud:gemini-nano-banana-2.1',\n    deps_type=str,\n    instructions=\"You're a dice game, roll the die and see if it matches the user's guess.\",\n)\n\n\n@agent.tool_plain\ndef roll_dice() -> str:\n    \"\"\"Roll a six-sided die and return the result.\"\"\"\n    return str(random.randint(1, 6))\n\n\n@agent.tool\ndef get_player_name(ctx: RunContext[str]) -> str:\n    \"\"\"Get the player's name.\"\"\"\n    return ctx.deps\n\n\nresult = agent.run_sync('My guess is 4', deps='Anne')\nprint(result.output)","soon":false},{"file":"streaming.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport asyncio\nimport os\n\nfrom pydantic_ai import Agent\n\nos.environ['PYDANTIC_AI_GATEWAY_API_KEY'] = '...'\n\nagent = Agent('gateway/google-cloud:gemini-nano-banana-2.1')\n\n\nasync def main():\n    async with agent.run_stream('Explain prompt caching in three bullet points.') as response:\n        async for text in response.stream_text(delta=True):\n            print(text, end='', flush=True)\n\n\nasyncio.run(main())","soon":false},{"file":"pax.sh","lang":"sh","code":"export PYDANTIC_AI_GATEWAY_API_KEY='...'\n\nuvx pax --model 'gateway/google-cloud:gemini-nano-banana-2.1'","soon":true},{"file":"ai_sdk.ts","lang":"ts","code":"// npm install ai @ai-sdk/google-vertex\nimport { createVertex } from '@ai-sdk/google-vertex'\nimport { generateText } from 'ai'\n\nprocess.env.PYDANTIC_AI_GATEWAY_API_KEY = '...'\n\nconst googleCloud = createVertex({\n  baseURL: 'https://gateway.pydantic.dev/proxy/google-vertex',\n  apiKey: process.env.PYDANTIC_AI_GATEWAY_API_KEY,\n})\n\nconst { text } = await generateText({\n  model: googleCloud('gemini-nano-banana-2.1'),\n  system: 'Be concise, reply with one sentence.',\n  prompt: 'Where does \"hello world\" come from?',\n})\nconsole.log(text)","soon":false}],"benchmarks":[],"generated":"2026-11-25","gaps":{"speed":3,"index":80,"description":0}}