{"slug":"gemini-2.5-flash","name":"Gemini 2.5 Flash","family":"gemini","family_name":"Gemini","developer":"Google","color":"#4285f4","status":"active","released":"2025-06-17","snapshot_of":null,"open":false,"context":1048576,"max_output":65536,"knowledge_cutoff":"2025-01","modalities":["text","image","audio","video","file"],"output_modalities":["text"],"reasoning":true,"tools":true,"structured_output":true,"huggingface":null,"speed":95,"latency":0.52,"short":"A closed, mid-priced multimodal model from Google with a 1M-token context window and reasoning mode. Its benchmark results sit below the registry median.","strengths":["1M token context window with up to 65k output tokens","Accepts text, image, audio, video and file inputs","Blended price of $0.85 per million tokens, below the $1.01 median","Ranks 48th of 194 for popularity"],"weaknesses":["Terminal-Bench 17.1%, 33rd of 35, against a 43.2% median","LMArena text rating 1416.9, 81st of 114, below the 1437.6 median","Listed on only two providers, Google Vertex and OpenRouter"],"best_for":"Cost-sensitive agents that need long context, multimodal input or tool calling, rather than terminal-based coding tasks.","long":"Gemini 2.5 Flash is a closed model from Google, released June 2025. For an agent, its main points are the 1M-token context window, support for tool calling and structured output, and inputs that include audio and video. At a blended $0.85 per million tokens it costs less than the registry median, and it ranks 48th of 194 for popularity.\n\nIts benchmark results are weaker. It scores 17.1% on Terminal-Bench, 33rd of 35 and well under the 43.2% median, and it ranks 81st of 114 on LMArena text with a rating of 1416.9, below the median of 1437.6. Both results sit below the registry median, so it is not a strong choice where those measures matter most.\n\nThe model is available only through Google Vertex and OpenRouter. It has a reasoning mode and a knowledge cutoff of January 2025. No intelligence index value per dollar is available for it.","described":true,"gateway":true,"byok":true,"string":"gateway/google-cloud:gemini-2.5-flash","input":0.3,"output":2.5,"cache_read":0.03,"blended":0.85,"efficiency":null,"bench":{"terminal":17.1,"lmarena":1416.9},"offers":[{"provider":"google","name":"Google Vertex","model_id":"gemini-2.5-flash","api":["anthropic","gemini"],"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":1048576,"deprecated":false,"gateway":true,"gateway_route":"google-vertex","byok":true,"string":"google-cloud:gemini-2.5-flash","gateway_string":"gateway/google-cloud:gemini-2.5-flash"},{"provider":"openrouter","name":"OpenRouter","model_id":"google/gemini-2.5-flash","api":["openai"],"input":0.3,"output":2.5,"cache_read":0.03,"cache_write":0.0833333333333333,"input_tiers":[],"output_tiers":[],"context":1048576,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"openrouter:google/gemini-2.5-flash","gateway_string":null}],"ranks":{"intelligence":null,"popularity":48,"efficiency":null,"speed":44,"price":86},"top_score":0.3381,"about":["A closed, mid-priced multimodal model from Google with a 1M-token context window and reasoning mode. Its benchmark results sit below the registry median.","Gemini 2.5 Flash is a closed model from Google, released June 2025. For an agent, its main points are the 1M-token context window, support for tool calling and structured output, and inputs that include audio and video. At a blended $0.85 per million tokens it costs less than the registry median, and it ranks 48th of 194 for popularity.","Its benchmark results are weaker. It scores 17.1% on Terminal-Bench, 33rd of 35 and well under the 43.2% median, and it ranks 81st of 114 on LMArena text with a rating of 1416.9, below the median of 1437.6. Both results sit below the registry median, so it is not a strong choice where those measures matter most.","The model is available only through Google Vertex and OpenRouter. It has a reasoning mode and a knowledge cutoff of January 2025. No intelligence index value per dollar is available for it."],"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-2.5-flash', 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-2.5-flash', 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-2.5-flash',\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-2.5-flash')\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-2.5-flash'","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-2.5-flash'),\n  system: 'Be concise, reply with one sentence.',\n  prompt: 'Where does \"hello world\" come from?',\n})\nconsole.log(text)","soon":false}],"benchmarks":[{"id":"terminal","name":"Terminal-Bench","unit":"%","desc":"Tasks completed in a terminal; the best result of any agent using the model","category":"coding","floor":0,"ceiling":100,"url":"https://www.tbench.ai/leaderboard/terminal-bench/2.0","credit":"Terminal-Bench, via Epoch AI (CC BY 4.0)"},{"id":"lmarena","name":"LMArena text","unit":"","desc":"Rating from blind human votes between pairs of chat responses","category":"preference","floor":1100,"ceiling":1600,"url":"https://lmarena.ai/leaderboard/text","credit":"LMArena (CC BY 4.0)"}],"generated":"2026-11-25","gaps":{"speed":3,"index":80,"description":0}}