{"slug":"deepseek-chat-v3.1","name":"DeepSeek V3.1","family":"deepseek","family_name":"DeepSeek","developer":"DeepSeek","color":"#1e3a8a","status":"active","released":"2025-08-21","snapshot_of":null,"open":true,"context":null,"max_output":147456,"knowledge_cutoff":"2025-03","modalities":["text"],"output_modalities":["text"],"reasoning":true,"tools":true,"structured_output":true,"huggingface":"deepseek-ai/DeepSeek-V3.1","speed":47,"latency":0.41,"short":"Open-weights text model from DeepSeek, released August 2025, priced well below the registry median. Its benchmark results sit under the median and near the bottom of the registry.","strengths":["Blended price of $0.45 per million tokens, well under the $1.01 median","Open weights, with tool calling, reasoning mode and structured output","Accepts text input and returns responses up to 147k tokens"],"weaknesses":["LMArena rating of 1420, 75th of 114 and below the 1438 median","Epoch Capabilities Index of 141, 92nd of 98, below the 155 median","Available only through OpenRouter; context window not listed"],"best_for":"Low-cost agents and tool-calling pipelines where price matters more than top benchmark scores.","long":"DeepSeek V3.1 is an open-weights text model released in August 2025. Its main appeal for an agent builder is price: a blended cost of $0.45 per million tokens, against a registry median of about $1.01, with input at $0.27 and output at $1 per million tokens. It supports tool calling, structured output and a reasoning mode, and can return responses up to 147k tokens long.\n\nIts benchmark results are weaker. On the LMArena text rating it scores 1420, 75th of 114 and below the median of 1438. On the Epoch Capabilities Index it scores 141, 92nd of 98, against a median of 155. Only two benchmark results are available, so the picture is thin.\n\nThe context window is not listed, so check it before relying on long inputs. The model is served only through OpenRouter, which limits provider choice.","described":true,"gateway":false,"byok":true,"string":"openrouter:deepseek/deepseek-chat-v3.1","input":0.27,"output":1,"cache_read":null,"blended":0.4525,"efficiency":null,"bench":{"lmarena":1419.8,"eci":140.9},"offers":[{"provider":"openrouter","name":"OpenRouter","model_id":"deepseek/deepseek-chat-v3.1","api":["openai"],"input":0.27,"output":1,"cache_read":null,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":null,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"openrouter:deepseek/deepseek-chat-v3.1","gateway_string":null}],"ranks":{"intelligence":null,"popularity":85,"efficiency":null,"speed":128,"price":58},"top_score":0.25,"about":["Open-weights text model from DeepSeek, released August 2025, priced well below the registry median. Its benchmark results sit under the median and near the bottom of the registry.","DeepSeek V3.1 is an open-weights text model released in August 2025. Its main appeal for an agent builder is price: a blended cost of $0.45 per million tokens, against a registry median of about $1.01, with input at $0.27 and output at $1 per million tokens. It supports tool calling, structured output and a reasoning mode, and can return responses up to 147k tokens long.","Its benchmark results are weaker. On the LMArena text rating it scores 1420, 75th of 114 and below the median of 1438. On the Epoch Capabilities Index it scores 141, 92nd of 98, against a median of 155. Only two benchmark results are available, so the picture is thin.","The context window is not listed, so check it before relying on long inputs. The model is served only through OpenRouter, which limits provider choice."],"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:deepseek/deepseek-chat-v3.1', 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:deepseek/deepseek-chat-v3.1', 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:deepseek/deepseek-chat-v3.1',\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:deepseek/deepseek-chat-v3.1')\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:deepseek/deepseek-chat-v3.1'","soon":true},{"file":"pi.sh","lang":"sh","code":"# npm install -g @earendil-works/pi-coding-agent\nexport OPENROUTER_API_KEY='...'\n\npi --model 'openrouter/deepseek/deepseek-chat-v3.1'","soon":false},{"file":"codex.sh","lang":"sh","code":"# npm install -g @openai/codex\nexport OPENROUTER_API_KEY='...'\n\ncodex --model 'deepseek/deepseek-chat-v3.1' \\\n  -c model_provider='openrouter' \\\n  -c model_providers.openrouter.name='OpenRouter' \\\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('deepseek/deepseek-chat-v3.1'),\n  system: 'Be concise, reply with one sentence.',\n  prompt: 'Where does \"hello world\" come from?',\n})\nconsole.log(text)","soon":false}],"benchmarks":[{"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}}