{"slug":"glm-4.7-flash","name":"GLM 4.7 Flash","family":"zai","family_name":"Z.ai","developer":"Z.ai","color":"#12b5cb","status":"active","released":"2026-01-19","snapshot_of":null,"open":true,"context":131072,"max_output":131072,"knowledge_cutoff":"2025-04","modalities":["text"],"output_modalities":["text"],"reasoning":true,"tools":true,"structured_output":true,"huggingface":"zai-org/GLM-4.7-Flash","speed":39.5,"latency":0.96,"short":"A small open-weights model from Z.ai with a 131k context window and very low prices. Its benchmark scores sit near the bottom of the registry, and it ranks high on value.","strengths":["Input costs $0.06 per million tokens, 14th cheapest of 194 models","Output costs $0.40 per million tokens, a low price for a reasoning model","Efficiency rank of 10 of 194 on intelligence points per dollar","Supports tool calling, reasoning mode and structured output"],"weaknesses":["Intelligence index of 36.9, 109th of 114 models, against a median of 59.5","GPQA Diamond score of 60.5%, 93rd of 94, against a median of 89.8%","OTIS Mock AIME score of 58.3%, 94th of 95, against a median of 94.2%"],"best_for":"Cost-sensitive agents and high-volume simple tasks where tool calling matters more than benchmark accuracy.","long":"GLM 4.7 Flash is an open-weights text model from Z.ai, released in January 2026, with a 131k token context window and support for tool calling, reasoning mode and structured output. It is available through Cloudflare Workers AI, OpenRouter and Novita. Its main appeal is price. Input costs $0.06 per million tokens and output costs $0.40 per million tokens, far below the registry median blended price, and it ranks 10th of 194 on intelligence points per dollar.\n\nOn capability the model ranks near the bottom of the registry. Its intelligence index is 36.9, 109th of 114, against a median of 59.5. It scores 60.5% on GPQA Diamond and 58.3% on OTIS Mock AIME, both among the lowest results tested, and 1350.7 on LMArena text, 109th of 114. Its knowledge cutoff is April 2025.\n\nThe model suits agents where cost per call matters more than accuracy on hard reasoning or mathematics, such as routing, extraction or simple tool-driven workflows. Tasks needing high accuracy on difficult problems would be better served by a model ranked higher on the benchmarks above.","described":true,"gateway":false,"byok":true,"string":"openrouter:z-ai/glm-4.7-flash","input":0.0605,"output":0.4,"cache_read":0.01,"blended":0.1454,"efficiency":253.8,"bench":{"index":36.9,"gpqa":60.5,"aime":58.3,"lmarena":1350.7},"offers":[{"provider":"cloudflare","name":"Cloudflare Workers AI","model_id":"@cf/zai-org/glm-4.7-flash","api":["openai"],"input":0.06,"output":0.4,"cache_read":null,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":131072,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":null,"gateway_string":null},{"provider":"openrouter","name":"OpenRouter","model_id":"z-ai/glm-4.7-flash","api":["openai"],"input":0.0605,"output":0.4,"cache_read":0.01,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":null,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"openrouter:z-ai/glm-4.7-flash","gateway_string":null},{"provider":"novita","name":"Novita","model_id":"zai-org/glm-4.7-flash","api":["openai"],"input":0.07,"output":0.4,"cache_read":0.01,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":200000,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":null,"gateway_string":null}],"ranks":{"intelligence":106,"popularity":134,"efficiency":10,"speed":154,"price":14},"top_score":0.4794,"about":["A small open-weights model from Z.ai with a 131k context window and very low prices. Its benchmark scores sit near the bottom of the registry, and it ranks high on value.","GLM 4.7 Flash is an open-weights text model from Z.ai, released in January 2026, with a 131k token context window and support for tool calling, reasoning mode and structured output. It is available through Cloudflare Workers AI, OpenRouter and Novita. Its main appeal is price. Input costs $0.06 per million tokens and output costs $0.40 per million tokens, far below the registry median blended price, and it ranks 10th of 194 on intelligence points per dollar.","On capability the model ranks near the bottom of the registry. Its intelligence index is 36.9, 109th of 114, against a median of 59.5. It scores 60.5% on GPQA Diamond and 58.3% on OTIS Mock AIME, both among the lowest results tested, and 1350.7 on LMArena text, 109th of 114. Its knowledge cutoff is April 2025.","The model suits agents where cost per call matters more than accuracy on hard reasoning or mathematics, such as routing, extraction or simple tool-driven workflows. Tasks needing high accuracy on difficult problems would be better served by a model ranked higher on the benchmarks above."],"examples":[{"file":"hello.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport os\n\nfrom pydantic_ai import Agent\n\nos.environ['OPENROUTER_API_KEY'] = '...'\n\nagent = Agent('openrouter:z-ai/glm-4.7-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['OPENROUTER_API_KEY'] = '...'\n\n\nclass CityLocation(BaseModel):\n    city: str\n    country: str\n\n\nagent = Agent('openrouter:z-ai/glm-4.7-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['OPENROUTER_API_KEY'] = '...'\n\nagent = Agent(\n    'openrouter:z-ai/glm-4.7-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['OPENROUTER_API_KEY'] = '...'\n\nagent = Agent('openrouter:z-ai/glm-4.7-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 OPENROUTER_API_KEY='...'\n\nuvx pax --model 'openrouter:z-ai/glm-4.7-flash'","soon":true},{"file":"pi.sh","lang":"sh","code":"# npm install -g @earendil-works/pi-coding-agent\nexport OPENROUTER_API_KEY='...'\n\npi --model 'openrouter/z-ai/glm-4.7-flash'","soon":false},{"file":"codex.sh","lang":"sh","code":"# npm install -g @openai/codex\nexport OPENROUTER_API_KEY='...'\n\ncodex --model 'z-ai/glm-4.7-flash' \\\n  -c model_provider='openrouter' \\\n  -c model_providers.openrouter.name='Cloudflare Workers AI' \\\n  -c model_providers.openrouter.base_url='https://api.openrouter.example/v1' \\\n  -c model_providers.openrouter.env_key='OPENROUTER_API_KEY'","soon":false},{"file":"ai_sdk.ts","lang":"ts","code":"// npm install ai @ai-sdk/openai-compatible\nimport { createOpenAICompatible } from '@ai-sdk/openai-compatible'\nimport { generateText } from 'ai'\n\nprocess.env.OPENROUTER_API_KEY = '...'\n\nconst openrouter = createOpenAICompatible({\n  name: 'openrouter',\n  baseURL: 'https://api.openrouter.example/v1',\n  apiKey: process.env.OPENROUTER_API_KEY,\n})\n\nconst { text } = await generateText({\n  model: openrouter('z-ai/glm-4.7-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":"index","name":"Intelligence index","unit":"","desc":"Our composite of the benchmarks below, 0-100","category":"reference","floor":0,"ceiling":100,"url":"/methodology/","credit":"Pydantic, from the sources credited below"},{"id":"gpqa","name":"GPQA Diamond","unit":"%","desc":"Graduate-level science questions, multiple choice","category":"reasoning","floor":25,"ceiling":97,"url":"https://epoch.ai/benchmarks/gpqa-diamond","credit":"Epoch AI (CC BY 4.0)"},{"id":"aime","name":"OTIS Mock AIME","unit":"%","desc":"Competition mathematics problems with exact answers","category":"reasoning","floor":0,"ceiling":100,"url":"https://epoch.ai/benchmarks/otis-mock-aime-2024-2025","credit":"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}}