{"slug":"mistral-medium-3.1","name":"Mistral Medium 3.1","family":"mistral","family_name":"Mistral","developer":"Mistral","color":"#f2b705","status":"active","released":"2025-08-12","snapshot_of":null,"open":false,"context":131072,"max_output":104857,"knowledge_cutoff":"2025-06","modalities":["text","image","file"],"output_modalities":["text"],"reasoning":false,"tools":true,"structured_output":true,"huggingface":null,"speed":107,"latency":0.92,"short":"Closed-weight, moderately priced model from Mistral, released August 2025, accepting text, image and file input. No benchmark results are available, so it is described by specification and price alone.","strengths":["Blended price of $0.80 per million tokens, below the $1.01 registry median","Accepts text, image and file inputs, with tool calling and structured output","Context window of 131k tokens and up to 105k response tokens","Available directly from Mistral and through OpenRouter"],"weaknesses":["No benchmark results, so capability cannot be compared with other models","Popularity rank of 170 of 194","No reasoning mode"],"best_for":"Budget-conscious agents that need tool calling, structured output and image or file input, where price matters more than benchmark evidence.","long":"Mistral Medium 3.1 is a closed-weight model from Mistral, released in August 2025. It accepts text, image and file inputs and supports tool calling and structured output, but has no reasoning mode. Its 131k context window and roughly 105k maximum response length are sizable for this kind of model.\n\nThe registry holds no benchmark results for it, so its capability cannot be compared with other models from the data. Pricing is $0.40 per million input tokens and $2 per million output tokens, a blended $0.80 against a registry median of about $1.01. Its popularity ranks 170 of 194.\n\nIt is available from Mistral and OpenRouter, and its knowledge cutoff is June 2025. A developer who needs a documented capability score should look at other entries. The case for this model rests on its features and price.","described":true,"gateway":false,"byok":true,"string":"mistral:mistral-medium-3-1","input":0.4,"output":2,"cache_read":0.04,"blended":0.8,"efficiency":null,"bench":{},"offers":[{"provider":"mistral","name":"Mistral","model_id":"mistral-medium-3-1","api":["openai"],"input":0.4,"output":2,"cache_read":0.04,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":null,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"mistral:mistral-medium-3-1","gateway_string":null},{"provider":"openrouter","name":"OpenRouter","model_id":"mistralai/mistral-medium-3.1","api":["openai"],"input":0.4,"output":2,"cache_read":0.04,"cache_write":null,"input_tiers":[],"output_tiers":[],"context":131072,"deprecated":false,"gateway":false,"gateway_route":null,"byok":true,"string":"openrouter:mistralai/mistral-medium-3.1","gateway_string":null}],"ranks":{"intelligence":null,"popularity":170,"efficiency":null,"speed":36,"price":83},"top_score":0.0476,"about":["Closed-weight, moderately priced model from Mistral, released August 2025, accepting text, image and file input. No benchmark results are available, so it is described by specification and price alone.","Mistral Medium 3.1 is a closed-weight model from Mistral, released in August 2025. It accepts text, image and file inputs and supports tool calling and structured output, but has no reasoning mode. Its 131k context window and roughly 105k maximum response length are sizable for this kind of model.","The registry holds no benchmark results for it, so its capability cannot be compared with other models from the data. Pricing is $0.40 per million input tokens and $2 per million output tokens, a blended $0.80 against a registry median of about $1.01. Its popularity ranks 170 of 194.","It is available from Mistral and OpenRouter, and its knowledge cutoff is June 2025. A developer who needs a documented capability score should look at other entries. The case for this model rests on its features and price."],"examples":[{"file":"hello.py","lang":"python","code":"# /// script\n# dependencies = [\"pydantic-ai\"]\n# ///\nimport os\n\nfrom pydantic_ai import Agent\n\nos.environ['MISTRAL_API_KEY'] = '...'\n\nagent = Agent('mistral:mistral-medium-3-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['MISTRAL_API_KEY'] = '...'\n\n\nclass CityLocation(BaseModel):\n    city: str\n    country: str\n\n\nagent = Agent('mistral:mistral-medium-3-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['MISTRAL_API_KEY'] = '...'\n\nagent = Agent(\n    'mistral:mistral-medium-3-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['MISTRAL_API_KEY'] = '...'\n\nagent = Agent('mistral:mistral-medium-3-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 MISTRAL_API_KEY='...'\n\nuvx pax --model 'mistral:mistral-medium-3-1'","soon":true},{"file":"pi.sh","lang":"sh","code":"# npm install -g @earendil-works/pi-coding-agent\nexport MISTRAL_API_KEY='...'\n\npi --model 'mistral/mistral-medium-3-1'","soon":false},{"file":"codex.sh","lang":"sh","code":"# npm install -g @openai/codex\nexport MISTRAL_API_KEY='...'\n\ncodex --model 'mistral-medium-3-1' \\\n  -c model_provider='mistral' \\\n  -c model_providers.mistral.name='Mistral' \\\n  -c model_providers.mistral.base_url='https://api.mistral.example/v1' \\\n  -c model_providers.mistral.env_key='MISTRAL_API_KEY'","soon":false},{"file":"ai_sdk.ts","lang":"ts","code":"// npm install ai @ai-sdk/mistral\nimport { createMistral } from '@ai-sdk/mistral'\nimport { generateText } from 'ai'\n\nprocess.env.MISTRAL_API_KEY = '...'\n\nconst mistral = createMistral({ apiKey: process.env.MISTRAL_API_KEY })\n\nconst { text } = await generateText({\n  model: mistral('mistral-medium-3-1'),\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}}