{"slug":"hy4","name":"Hy4","family":"tencent","family_name":"Tencent","developer":"Tencent","color":"#000f99","status":"active","released":"2026-11-04","snapshot_of":null,"open":false,"context":1048576,"max_output":65536,"knowledge_cutoff":null,"modalities":["text","image"],"output_modalities":["text"],"reasoning":true,"tools":true,"structured_output":true,"huggingface":"tencent/Hy4","speed":59,"latency":1.49,"short":"A closed-weights model from Tencent, released November 2026, with a 1M-token context window and text and image input. The registry has no benchmark results for it, so its profile rests on specifications and price.","strengths":["1M-token context window with responses up to 65k tokens","Accepts text and image input, with tool calling and structured output","Blended price of $0.63 per million tokens, below the $1.01 median","Ranks 5th of 194 for popularity"],"weaknesses":["No benchmark results, so intelligence cannot be compared","Only two providers, Novita and OpenRouter","No intelligence-per-dollar figure available"],"best_for":"Agents that need a very long context window, image input and tool calling at a below-median price, with capability verified first.","long":"Hy4 is a closed-weights model from Tencent, released in November 2026. Its most notable specification is a 1M-token context window, with responses up to 65k tokens. It accepts text and image input and supports tool calling, structured output and a reasoning mode, so it covers the features an agent typically needs.\n\nPrice is a clear point in its favour. Input costs $0.42 per million tokens and output $1.25 per million, giving a blended rate of $0.63 against a registry median of $1.01. Its price rank of 74 of 194 places it in the cheaper half of the registry.\n\nThe registry holds no benchmark results for Hy4, so its intelligence cannot be compared with other models. It is available through Novita and OpenRouter. Anyone choosing it should test it on their own tasks before relying on it.","described":true,"gateway":false,"byok":true,"string":"openrouter:tencent/hy4","input":0.417,"output":1.2505,"cache_read":0.021,"blended":0.6254,"efficiency":null,"bench":{},"offers":[{"provider":"novita","name":"Novita","model_id":"tencent/hy4","api":["openai"],"input":0.417,"output":1.2505,"cache_read":0.021,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":1000000,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":null,"gateway_string":null},{"provider":"openrouter","name":"OpenRouter","model_id":"tencent/hy4","api":["openai"],"input":0.417,"output":1.2505,"cache_read":0.021,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":1048576,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"openrouter:tencent/hy4","gateway_string":null}],"ranks":{"intelligence":null,"popularity":5,"efficiency":null,"speed":106,"price":74},"top_score":0.4405,"about":["A closed-weights model from Tencent, released November 2026, with a 1M-token context window and text and image input. The registry has no benchmark results for it, so its profile rests on specifications and price.","Hy4 is a closed-weights model from Tencent, released in November 2026. Its most notable specification is a 1M-token context window, with responses up to 65k tokens. It accepts text and image input and supports tool calling, structured output and a reasoning mode, so it covers the features an agent typically needs.","Price is a clear point in its favour. Input costs $0.42 per million tokens and output $1.25 per million, giving a blended rate of $0.63 against a registry median of $1.01. Its price rank of 74 of 194 places it in the cheaper half of the registry.","The registry holds no benchmark results for Hy4, so its intelligence cannot be compared with other models. It is available through Novita and OpenRouter. Anyone choosing it should test it on their own tasks before relying on 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['OPENROUTER_API_KEY'] = '...'\n\nagent = Agent('openrouter:tencent/hy4', 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:tencent/hy4', 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:tencent/hy4',\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:tencent/hy4')\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:tencent/hy4'","soon":true},{"file":"pi.sh","lang":"sh","code":"# npm install -g @earendil-works/pi-coding-agent\nexport OPENROUTER_API_KEY='...'\n\npi --model 'openrouter/tencent/hy4'","soon":false},{"file":"codex.sh","lang":"sh","code":"# npm install -g @openai/codex\nexport OPENROUTER_API_KEY='...'\n\ncodex --model 'tencent/hy4' \\\n  -c model_provider='openrouter' \\\n  -c model_providers.openrouter.name='Novita' \\\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('tencent/hy4'),\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}}