{"slug":"glm-4.6","name":"GLM 4.6","family":"zai","family_name":"Z.ai","developer":"Z.ai","color":"#12b5cb","status":"active","released":"2025-09-30","snapshot_of":null,"open":true,"context":204800,"max_output":131072,"knowledge_cutoff":"2025-04","modalities":["text"],"output_modalities":["text"],"reasoning":true,"tools":true,"structured_output":true,"huggingface":"zai-org/GLM-4.6","speed":44.5,"latency":2.11,"short":"Open-weights text model from Z.ai with a long context window, tool calling and reasoning mode. Its blended price sits near the registry median, but benchmark scores mostly trail the field.","strengths":["Blended price of $1 per million tokens, just under the registry median","Efficiency rank of 47 of 194 on intelligence points per dollar","Context window of 204k tokens, with up to 131k response tokens","Open weights, with tool calling, structured output and reasoning mode"],"weaknesses":["Intelligence index of 49.5, well below the median of 59.5","Terminal-Bench 24.5%, 30th of 35, against a median of 43.2%","SciCode 38.4%, 86th of 96; accepts text input only"],"best_for":"Cost-sensitive text agents that need tool calling and long context, rather than demanding coding or scientific tasks.","long":"GLM 4.6 is an open-weights text model from Z.ai, released September 2025, with a 204k token context window and up to 131k response tokens. It supports tool calling, structured output and reasoning mode. Its blended price of $1 per million tokens (input $0.6, output $2.2) sits just under the registry median, and it is offered by Z.ai, Novita and OpenRouter.\n\nBenchmark results are weaker. Its intelligence index of 49.5 is well below the median of 59.5, placing it 89th of 114 tested. It ranks 30th of 35 on Terminal-Bench and 86th of 96 on SciCode, while its LMArena text rating of 1440 is roughly at the median.\n\nIts efficiency rank of 47 of 194 reflects its low price rather than strong results, so it suits cost-sensitive text work with tool calls rather than demanding coding or scientific tasks.","described":true,"gateway":false,"byok":true,"string":"zai:GLM-4.6","input":0.6,"output":2.2,"cache_read":0.11,"blended":1,"efficiency":49.5,"bench":{"index":49.5,"terminal":24.5,"scicode":38.4,"webdev":1340.6,"lmarena":1440.2},"offers":[{"provider":"zai","name":"Z.ai","model_id":"GLM-4.6","api":["openai"],"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":null,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"zai:GLM-4.6","gateway_string":null},{"provider":"novita","name":"Novita","model_id":"zai-org/glm-4.6","api":["openai"],"input":0.55,"output":2.2,"cache_read":0.11,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":204800,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":null,"gateway_string":null},{"provider":"openrouter","name":"OpenRouter","model_id":"z-ai/glm-4.6","api":["openai"],"input":0.6,"output":2.2,"cache_read":0.11,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":null,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"openrouter:z-ai/glm-4.6","gateway_string":null}],"ranks":{"intelligence":86,"popularity":121,"efficiency":47,"speed":136,"price":91},"top_score":0.5082,"about":["Open-weights text model from Z.ai with a long context window, tool calling and reasoning mode. Its blended price sits near the registry median, but benchmark scores mostly trail the field.","GLM 4.6 is an open-weights text model from Z.ai, released September 2025, with a 204k token context window and up to 131k response tokens. It supports tool calling, structured output and reasoning mode. Its blended price of $1 per million tokens (input $0.6, output $2.2) sits just under the registry median, and it is offered by Z.ai, Novita and OpenRouter.","Benchmark results are weaker. Its intelligence index of 49.5 is well below the median of 59.5, placing it 89th of 114 tested. It ranks 30th of 35 on Terminal-Bench and 86th of 96 on SciCode, while its LMArena text rating of 1440 is roughly at the median.","Its efficiency rank of 47 of 194 reflects its low price rather than strong results, so it suits cost-sensitive text work with tool calls rather than demanding coding or scientific tasks."],"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-4.6', 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-4.6', 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-4.6',\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-4.6')\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-4.6'","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-4.6'","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-4.6'),\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":"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":"scicode","name":"SciCode","unit":"%","desc":"Scientific programming problems written by researchers","category":"coding","floor":0,"ceiling":100,"url":"https://scicode-bench.github.io/","credit":"SciCode, 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)"}],"generated":"2026-11-25","gaps":{"speed":3,"index":80,"description":0}}