cd /news/large-language-models/deepseek-v4-1-flash-beta-on-vercel · home topics large-language-models article
[ARTICLE · art-124753] src=vercel.com ↗ pub= topic=large-language-models verified=true sentiment=· neutral

DeepSeek v4.1 Flash Beta on Vercel

Vercel has released an experimental beta of DeepSeek V4.1 Flash, available through its AI Gateway, with pricing set at $0.22 per 1 million input tokens and $0.66 per 1 million output tokens, and the beta expires on September 10, 2026. The model supports up to 384,000 output tokens and can be accessed via the AI SDK or OpenAI-compatible APIs, with free users receiving $5 of credits every 30 days.

read6 min views2 publishedSep 9, 2026
DeepSeek v4.1 Flash Beta on Vercel
Image: Vercel Blog

An experimental beta version of DeepSeek V4.1 Flash that expires on September 10th 2026.

View API reference

  • Input and output price
  • Input $0.22, Output $0.66, Per 1M tokens
  • 24h uptime
  • AI Gateway uptime
1import { streamText } from 'ai'2
3const result = streamText({4  model: 'deepseek/deepseek-v4.1-flash-beta',5  prompt: 'Why is the sky blue?'6})

Try out DeepSeek V4.1 Flash Beta by DeepSeek. Usage is billed to your team at API rates. Free users (those who haven't made a payment) get $5 of credits every 30 days.

DeepSeek V4.1 Flash Beta

Route requests across multiple providers. Copy a provider slug to set your preference. Visit the docs for more info. Using a provider means you agree to their terms, listed under Legal.

Provider

Direct request success rate on AI Gateway and per-provider. Visit the docs for more info.

P50 throughput on live AI Gateway traffic, in tokens per second (TPS). Visit the docs for more info.

P50 time to first token (TTFT) on live AI Gateway traffic, in milliseconds. View the docs for more info.

Getting started #

Call DeepSeek V4.1 Flash Beta through AI Gateway with the AI SDK generateText and streamText functions, or through the OpenAI Chat Completions, OpenAI Responses, and Anthropic Messages APIs by changing the base URL. AI Gateway authenticates the request and routes it to an available provider.

Install the AI SDK (pnpm add ai dotenv), create an API key from the API Keys page, and set it as AI_GATEWAY_API_KEY in your environment. Full setup is covered in the text generation quickstart.

1import { generateText } from 'ai';2import 'dotenv/config';3
4async function main() {5  const result = await generateText({6    model: 'deepseek/deepseek-v4.1-flash-beta',7    prompt: 'Why is the sky blue?',8  });9
10  console.log(result.text);11}12
13main().catch(console.error);

Top-level parameters #

The same DeepSeek V4.1 Flash Beta request in each API format AI Gateway supports.

1import { generateText } from 'ai';2import 'dotenv/config';3
4async function main() {5  const result = await generateText({6    model: 'deepseek/deepseek-v4.1-flash-beta',7    system: 'You are a concise technical assistant.',8    prompt: 'Summarize the tradeoffs between static generation and SSR.',9    maxOutputTokens: 1024,10  });11
12  console.log(result.text);13}14
15main().catch(console.error);

Standard parameters like prompt, messages, temperature, and tools work as documented in the AI SDK docs. These are the parameters with model-specific behavior.

Parameter Type Required Description
model string Yes Model ID in the form creator/model , e.g.deepseek/deepseek-v4.1-flash-beta . AI Gateway routes the request to an available provider.
maxOutputTokens number No Hard cap on generated tokens. DeepSeek V4.1 Flash Beta supports up to 384,000 output tokens. Reasoning tokens count toward this limit.
reasoning 'provider-default' | 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' No Provider-agnostic reasoning effort, available in AI SDK 7 or later. Maps to the provider’s native reasoning configuration; reasoning settings under providerOptions take precedence when both are set. See the Reasoning section below.
providerOptions Record<string, JSONValue> No AI Gateway routing options under gateway , plus any provider-native options under the provider’s own namespace — see the table below.

Input limits #

Input Formats Sources Max count Max size Limits
Text Prompt and response share the 1M-token context window
Image URL, base64, Uint8Array Sent as image parts in messages; counts as input tokens

Provider options #

Set AI Gateway routing options under providerOptions.gateway. For provider-specific options, pass them under the provider’s namespace as documented by the AI SDK.

Learn more in the AI SDK deepseek provider docs.

1import { generateText } from 'ai';2import 'dotenv/config';3
4async function main() {5  const result = await generateText({6    model: 'deepseek/deepseek-v4.1-flash-beta',7    prompt: 'Why is the sky blue?',8    providerOptions: {9      gateway: {10        only: ['deepseek'],11      },12    },13  });14
15  console.log(result.text);16}17
18main().catch(console.error);

These AI Gateway routing options apply to every model. Provider-specific options pass through under the provider’s own namespace (for example providerOptions.anthropic) exactly as documented by the AI SDK.

Parameter Type Required Description
providerOptions.gateway.only string[] No Restrict routing to these provider slugs. Requests fail over only within the listed providers.
providerOptions.gateway.order string[] No Preferred provider order. Listed providers are tried first; unlisted providers remain available as fallbacks.
providerOptions.gateway.sort 'cost' | 'ttft' | 'tps' No Rank candidate providers by price, time to first token, or tokens per second instead of the default routing order.
providerOptions.gateway.zeroDataRetention boolean No Route only to providers with a zero-data-retention policy for this model.

Routing across providers

AI Gateway serves the same model through multiple providers and fails over automatically. order expresses a preference while keeping every provider eligible; only is a hard allowlist — if none of the listed providers are available the request fails instead of falling back.

Options under a provider's own namespace (for example providerOptions.anthropic) are forwarded to that provider with the request. Providers ignore option namespaces that don't apply to them, so it is safe to set provider options alongside gateway routing options.

Reasoning #

AI Gateway bridges reasoning across every API format. The AI SDK exposes a provider-agnostic top-level reasoning level (none, minimal, low, medium, high, or xhigh); the Chat Completions and Responses formats take the same effort under reasoning.effort; and the Anthropic Messages format uses a native thinking token budget. Whichever you send, the gateway maps it to the target model’s native configuration, converting between effort levels and token budgets as needed. Reasoning-related settings under providerOptions take full precedence over the top-level reasoning value and are never merged. Reasoning tokens typically count toward your output-token usage, though how they’re reported and billed varies by provider.

Learn more in the AI Gateway reasoning guide.

1import { generateText } from 'ai';2import 'dotenv/config';3
4async function main() {5  const result = await generateText({6    model: 'deepseek/deepseek-v4.1-flash-beta',7    prompt: 'Explain the Monty Hall problem step by step.',8    reasoning: 'high',9  });10
11  console.log(result.text);12}13
14main().catch(console.error);

Image input #

Send images alongside text as message parts. Images count as input tokens.

1import { generateText } from 'ai';2import 'dotenv/config';3
4async function main() {5  const result = await generateText({6    model: 'deepseek/deepseek-v4.1-flash-beta',7    messages: [8      {9        role: 'user',10        content: [11          { type: 'text', text: 'Describe this image.' },12          { type: 'image', image: 'https://example.com/photo.jpg' },13        ],14      },15    ],16  });17
18  console.log(result.text);19}20
21main().catch(console.error);

Tool calling #

Expose tools the model can call. Define each tool’s inputs with a Zod schema.

1import { generateText, tool } from 'ai';2import { z } from 'zod';3import 'dotenv/config';4
5async function main() {6  const result = await generateText({7    model: 'deepseek/deepseek-v4.1-flash-beta',8    prompt: 'What is the weather in San Francisco?',9    tools: {10      getWeather: tool({11        description: 'Get the current weather for a location',12        inputSchema: z.object({ location: z.string() }),13        execute: async ({ location }) => ({ location, temperatureC: 18 }),14      }),15    },16  });17
18  console.log(result.text);19}20
21main().catch(console.error);
── more in #large-language-models 4 stories · sorted by recency
── more on @vercel 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/deepseek-v4-1-flash-…] indexed:0 read:6min 2026-09-09 ·