# DeepSeek V3.1

DeepSeek V3.1 unifies reasoning and standard completion in a single deployment. You switch between deep chain-of-thought and direct response modes through the same API endpoint.

- **Model ID:** `deepseek/deepseek-v3.1`
- **Type:** chat
- **Providers:** deepinfra, sambanova
- **Context window:** 163,840
- **Maximum output tokens:** 128,000
- **Pricing:** $0.25/1M input tokens, $0.95/1M output tokens
- **Canonical page:** https://vercel.com/ai-gateway/models/deepseek-v3.1

## Supported parameters

Detailed capability metadata has not been reported for this model.

## Example

```ts
import { streamText } from 'ai'

const result = streamText({
  model: 'deepseek/deepseek-v3.1',
  prompt: 'Why is the sky blue?'
})
```

## About

DeepSeek V3.1 was released August 21, 2025. Its central change consolidates thinking and non-thinking inference into one model. Access non-thinking mode via the `deepseek-chat` API identifier and thinking mode via `deepseek-reasoner`. Previously these required separate deployments. The dual-mode design lets you route requests to different inference behaviors without maintaining separate integrations, simplifying agent architectures where some steps need reasoning and others don't.

The thinking mode offers improved efficiency over prior reasoning models. Strict function calling is available in beta, alongside Anthropic API format compatibility, expanding the range of infrastructure that can route to DeepSeek V3.1 without modification.

DeepSeek V3.1 targets stronger multi-step reasoning for complex search tasks, better performance on SWE-Bench and Terminal-Bench, and a new tokenizer with a refreshed chat template. Current AI Gateway rates appear on this page.

## What to consider

Two usage modes share the same model. Test both thinking and non-thinking paths in your integration to confirm your application correctly interprets response structure under each mode.

## When to use

### Best For

- Agent pipelines that mix reasoning-heavy steps (tool planning, code generation) with fast-response steps (parsing, classification) using a single endpoint
- Software engineering automation where SWE-Bench and Terminal-Bench improvements translate to better code generation and execution performance
- Applications that already use the Anthropic API format, where routing to DeepSeek V3.1 requires minimal integration change
- Complex multi-step search workflows where the thinking mode's improved efficiency reduces total response latency
- Upgrading from DeepSeek-V3 with backward-compatible API routing plus optional thinking mode

### Consider Alternatives When

- You need only deep reasoning with no non-thinking use case. DeepSeek-R1 remains the dedicated reasoning specialist
- Stability and multilingual output consistency across Chinese-English code-switching are critical. DeepSeek-V3.1 Terminus addresses those reliability issues
- Your workload is straightforward chat or completion with no need for hybrid inference. DeepSeek-V3 may be more cost-efficient for the volume

## Best for

- **Mixed agent pipelines:** Combine reasoning-heavy steps (tool planning, code generation) with fast-response steps (parsing, classification) through a single endpoint
- **Software engineering automation:** SWE-Bench and Terminal-Bench improvements translate to better code generation and execution performance
- **Anthropic API compatibility:** Existing Anthropic-format integrations route to DeepSeek V3.1 with minimal integration change
- **Complex multi-step search:** The thinking mode's improved efficiency reduces total response latency for multi-step workflows
- **Upgrading from DeepSeek-V3:** Backward-compatible API routing plus optional thinking mode

## Consider alternatives

- **Pure reasoning workloads:** DeepSeek-R1 remains the dedicated reasoning specialist
- **Multilingual stability critical:** DeepSeek-V3.1 Terminus addresses reliability issues for Chinese-English code-switching output consistency
- **Straightforward chat or completion:** DeepSeek-V3 may be more cost-efficient for high-volume workloads without hybrid inference needs

## Frequently asked questions

### What does "hybrid inference" mean for DeepSeek V3.1?

The same model weights support both a thinking mode (extended chain-of-thought) and a non-thinking mode (direct completion). Select the mode by calling `deepseek-reasoner` for thinking or `deepseek-chat` for non-thinking. No separate model switch is needed.

### Is DeepSeek V3.1's thinking mode faster than DeepSeek-R1?

Yes. DeepSeek-V3.1-Think reaches answers in less time than DeepSeek-R1-0528 on equivalent tasks.

### Does DeepSeek V3.1 support the Anthropic API format?

Yes. Existing Anthropic-format integrations can route to DeepSeek V3.1 without additional conversion.

### What is strict function calling and is it available in DeepSeek V3.1?

It's in beta for DeepSeek V3.1. Strict function calling requires tool call arguments to match the provided JSON schema exactly.

### What is the context window for DeepSeek V3.1?

163.8K tokens for both thinking and non-thinking modes.

## Links

- [Model page](https://vercel.com/ai-gateway/models/deepseek-v3.1)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://deepinfra.com/deepseek-ai/DeepSeek-V3.1)
- [Provider pricing](https://deepinfra.com/pricing)


If you encounter incorrect information, can’t find what you need, need a capability Vercel doesn’t currently offer, or have any other feedback to report, please do it by following the instructions at https://vercel.com/feedback.md.
