{"slug":"glm-5","name":"GLM 5","family":"zai","family_name":"Z.ai","developer":"Z.ai","color":"#12b5cb","status":"active","released":"2026-02-12","snapshot_of":null,"open":true,"context":200000,"max_output":131072,"knowledge_cutoff":null,"modalities":["text"],"output_modalities":["text"],"reasoning":true,"tools":true,"structured_output":true,"huggingface":"zai-org/GLM-5","speed":45.5,"latency":2.31,"short":"An open-weights model from Z.ai, released February 2026, with tool calling and structured output. Its clearest result is on Terminal-Bench, while math and abstract reasoning trail the registry.","strengths":["52.4% on Terminal-Bench, 13th of 35, above the 43.2% median","1445.9 on LMArena text, 45th of 114, just above the median","Open weights, with a 200k context window and 131k maximum output","Supports tool calling, reasoning mode and structured output"],"weaknesses":["4.9% on ARC-AGI-2, 59th of 68, far below the 61.3% median","80.0% on OTIS Mock AIME, 81st of 95, below the 94.2% median","Blended price of $1.55 per million tokens, above the $1.01 median"],"best_for":"Agents running terminal tasks with tool calling and structured output, where math and abstract reasoning matter less.","long":"GLM 5 is an open-weights text model from Z.ai, released February 2026. It has a 200k context window, up to 131k output tokens, and supports tool calling, reasoning mode and structured output. Input costs $1 per million tokens and output $3.20, giving a blended price of $1.55, above the registry median of $1.01.\n\nIts intelligence index of 54.5 ranks 70th of 114, below the median of 59.5. Terminal-Bench is its clearest strength at 52.4%, 13th of 35, and its LMArena text rating sits just above the median. Math and abstract reasoning lag behind: OTIS Mock AIME is at 80% and ARC-AGI-2 at 4.9%, both near the bottom of the registry.\n\nThe model is served by Z.ai, Zhipu AI, Novita and OpenRouter. It is a reasonable fit for agent workloads centred on tool use and terminal work, rather than on hard mathematical or abstract reasoning.","described":true,"gateway":false,"byok":true,"string":"zai:GLM-5","input":1,"output":3.2,"cache_read":0.2,"blended":1.55,"efficiency":35.2,"bench":{"index":54.5,"gpqa":87.8,"aime":80,"arc_agi_2":4.9,"swe":72.1,"terminal":52.4,"webdev":1435.9,"lmarena":1445.9,"eci":146.5},"offers":[{"provider":"zai","name":"Z.ai","model_id":"GLM-5","api":["openai"],"input":1,"output":3.2,"cache_read":0.2,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":null,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"zai:GLM-5","gateway_string":null},{"provider":"zhipuai","name":"Zhipu AI","model_id":"GLM-5","api":["openai"],"input":0.552,"output":2.483,"cache_read":0.138,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":200000,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":null,"gateway_string":null},{"provider":"novita","name":"Novita","model_id":"zai-org/glm-5","api":["openai"],"input":1,"output":3.2,"cache_read":0.2,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":202800,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":null,"gateway_string":null},{"provider":"openrouter","name":"OpenRouter","model_id":"z-ai/glm-5","api":["openai"],"input":1,"output":3.2,"cache_read":0.2,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":null,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"openrouter:z-ai/glm-5","gateway_string":null}],"ranks":{"intelligence":67,"popularity":94,"efficiency":59,"speed":134,"price":112},"top_score":0.595,"about":["An open-weights model from Z.ai, released February 2026, with tool calling and structured output. Its clearest result is on Terminal-Bench, while math and abstract reasoning trail the registry.","GLM 5 is an open-weights text model from Z.ai, released February 2026. It has a 200k context window, up to 131k output tokens, and supports tool calling, reasoning mode and structured output. Input costs $1 per million tokens and output $3.20, giving a blended price of $1.55, above the registry median of $1.01.","Its intelligence index of 54.5 ranks 70th of 114, below the median of 59.5. Terminal-Bench is its clearest strength at 52.4%, 13th of 35, and its LMArena text rating sits just above the median. Math and abstract reasoning lag behind: OTIS Mock AIME is at 80% and ARC-AGI-2 at 4.9%, both near the bottom of the registry.","The model is served by Z.ai, Zhipu AI, Novita and OpenRouter. It is a reasonable fit for agent workloads centred on tool use and terminal work, rather than on hard mathematical or abstract reasoning."],"examples":[{"file":"hello.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport os\n\nfrom pydantic_ai import Agent\n\nos.environ['ZAI_API_KEY'] = '...'\n\nagent = Agent('zai:GLM-5', 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['ZAI_API_KEY'] = '...'\n\n\nclass CityLocation(BaseModel):\n    city: str\n    country: str\n\n\nagent = Agent('zai:GLM-5', 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['ZAI_API_KEY'] = '...'\n\nagent = Agent(\n    'zai:GLM-5',\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['ZAI_API_KEY'] = '...'\n\nagent = Agent('zai:GLM-5')\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 ZAI_API_KEY='...'\n\nuvx pax --model 'zai:GLM-5'","soon":true},{"file":"pi.sh","lang":"sh","code":"# npm install -g @earendil-works/pi-coding-agent\nexport ZAI_API_KEY='...'\n\npi --model 'zai/GLM-5'","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.ZAI_API_KEY = '...'\n\nconst zai = createOpenAICompatible({\n  name: 'zai',\n  baseURL: 'https://api.zai.example/v1',\n  apiKey: process.env.ZAI_API_KEY,\n})\n\nconst { text } = await generateText({\n  model: zai('GLM-5'),\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":"arc_agi_2","name":"ARC-AGI-2","unit":"%","desc":"Abstract visual puzzles that test learning a new rule from a few examples","category":"reasoning","floor":0,"ceiling":100,"url":"https://arcprize.org/leaderboard","credit":"ARC Prize, via Epoch AI (CC BY 4.0)"},{"id":"swe","name":"SWE-bench Verified","unit":"%","desc":"Real GitHub issues resolved, run by Epoch with one fixed scaffold","category":"coding","floor":0,"ceiling":100,"url":"https://epoch.ai/benchmarks/swe-bench-verified","credit":"Epoch AI (CC BY 4.0)"},{"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":"webdev","name":"WebDev Arena","unit":"","desc":"Rating from human votes on web apps the models built","category":"coding","floor":1000,"ceiling":1900,"url":"https://web.lmarena.ai/leaderboard","credit":"LMArena, 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)"},{"id":"eci","name":"Epoch Capabilities Index","unit":"","desc":"Epoch AI's own composite across about 40 benchmarks; shown for comparison, not part of our index","category":"reference","floor":80,"ceiling":180,"url":"https://epoch.ai/benchmarks/eci","credit":"Epoch AI (CC BY 4.0)"}],"generated":"2026-11-25","gaps":{"speed":3,"index":80,"description":0}}