{"slug": "deepseek-v4-1-flash-beta-on-vercel", "title": "DeepSeek v4.1 Flash Beta on Vercel", "summary": "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.", "body_md": "# DeepSeek V4.1 Flash Beta\n\nAn experimental beta version of DeepSeek V4.1 Flash that expires on September 10th 2026.\n\n[View API reference](#api)\n\n- Input and output price\n- Input $0.22, Output $0.66, Per 1M tokens\n- 24h uptime\n- Loading AI Gateway uptime\n\n``` js\n1import { streamText } from 'ai'2\n3const result = streamText({4  model: 'deepseek/deepseek-v4.1-flash-beta',5  prompt: 'Why is the sky blue?'6})\n```\n\n## [Copy link to heading](#playground)Playground\n\nTry 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.\n\nDeepSeek V4.1 Flash Beta\n\n## [Copy link to heading](#providers)Providers\n\nRoute requests across multiple providers. Copy a provider slug to set your preference. Visit the [docs](/docs/ai-gateway/provider-options) for more info. Using a provider means you agree to their terms, listed under Legal.\n\n| Provider | \n|---|\n\n## [Copy link to heading](#uptime)Uptime24 hours\n\nDirect request success rate on AI Gateway and per-provider. Visit the [docs](https://vercel.com/docs/ai-gateway/models-and-providers/uptime) for more info.\n\n## [Copy link to heading](#throughput)Throughput24 hours\n\nP50 throughput on live AI Gateway traffic, in tokens per second (TPS). Visit the [docs](https://vercel.com/docs/ai-gateway/models-and-providers/metrics) for more info.\n\n## [Copy link to heading](#latency)Latency24 hours\n\nP50 time to first token (TTFT) on live AI Gateway traffic, in milliseconds. View the [docs](https://vercel.com/docs/ai-gateway/models-and-providers/metrics) for more info.\n\n## Getting started\n\nCall 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.\n\nInstall the AI SDK (`pnpm add ai dotenv`), create an API key from the [API Keys page](/d?to=%2F%5Bteam%5D%2F%7E%2Fai-gateway%2Fapi-keys&title=AI+Gateway+API+Keys), and set it as `AI_GATEWAY_API_KEY` in your environment. Full setup is covered in the [text generation quickstart](/docs/ai-gateway/getting-started/text).\n\n``` js\n1import { generateText } from 'ai';2import 'dotenv/config';3\n4async function main() {5  const result = await generateText({6    model: 'deepseek/deepseek-v4.1-flash-beta',7    prompt: 'Why is the sky blue?',8  });9\n10  console.log(result.text);11}12\n13main().catch(console.error);\n```\n\n## Top-level parameters\n\nThe same DeepSeek V4.1 Flash Beta request in each API format AI Gateway supports.\n\n``` js\n1import { generateText } from 'ai';2import 'dotenv/config';3\n4async 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\n12  console.log(result.text);13}14\n15main().catch(console.error);\n```\n\nStandard parameters like `prompt`, `messages`, `temperature`, and `tools` work as documented in the AI SDK docs. These are the parameters with model-specific behavior.\n\n| Parameter | Type | Required | Description | \n|---|---|---|---|\n| `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. | \n| `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. | \n| `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. | \n| `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. | \n\n## Input limits\n\n| Input | Formats | Sources | Max count | Max size | Limits | \n|---|---|---|---|---|---|\n| Text | — | — | — | — | Prompt and response share the 1M-token context window | \n| Image | — | URL, base64, Uint8Array | — | — | Sent as image parts in messages; counts as input tokens | \n\n## Provider options\n\nSet AI Gateway routing options under `providerOptions.gateway`. For provider-specific options, pass them under the provider’s namespace as documented by the AI SDK.\n\nLearn more in the [AI SDK deepseek provider docs](https://ai-sdk.dev/providers/ai-sdk-providers/deepseek).\n\n``` js\n1import { generateText } from 'ai';2import 'dotenv/config';3\n4async 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\n15  console.log(result.text);16}17\n18main().catch(console.error);\n```\n\nThese 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.\n\n| Parameter | Type | Required | Description | \n|---|---|---|---|\n| `providerOptions.gateway.only` | `string[]` | No | Restrict routing to these provider slugs. Requests fail over only within the listed providers. | \n| `providerOptions.gateway.order` | `string[]` | No | Preferred provider order. Listed providers are tried first; unlisted providers remain available as fallbacks. | \n| `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. | \n| `providerOptions.gateway.zeroDataRetention` | `boolean` | No | Route only to providers with a zero-data-retention policy for this model. | \n\n### Routing across providers\n\nAI 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.\n\nOptions 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.\n\n## Reasoning\n\nAI 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.\n\nLearn more in the [AI Gateway reasoning guide](/docs/ai-gateway/models-and-providers/reasoning).\n\n``` js\n1import { generateText } from 'ai';2import 'dotenv/config';3\n4async 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\n11  console.log(result.text);12}13\n14main().catch(console.error);\n```\n\n## Image input\n\nSend images alongside text as message parts. Images count as input tokens.\n\n``` js\n1import { generateText } from 'ai';2import 'dotenv/config';3\n4async 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\n18  console.log(result.text);19}20\n21main().catch(console.error);\n```\n\n## Tool calling\n\nExpose tools the model can call. Define each tool’s inputs with a Zod schema.\n\n``` js\n1import { generateText, tool } from 'ai';2import { z } from 'zod';3import 'dotenv/config';4\n5async 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\n18  console.log(result.text);19}20\n21main().catch(console.error);\n```\n\n", "url": "https://wpnews.pro/news/deepseek-v4-1-flash-beta-on-vercel", "canonical_source": "https://vercel.com/ai-gateway/models/deepseek-v4.1-flash-beta", "published_at": "2026-09-09 15:28:12+00:00", "updated_at": "2026-09-09 15:51:14.118821+00:00", "lang": "en", "topics": ["large-language-models", "ai-products", "ai-infrastructure"], "entities": ["Vercel", "DeepSeek", "DeepSeek V4.1 Flash Beta", "AI Gateway", "AI SDK"], "alternates": {"html": "https://wpnews.pro/news/deepseek-v4-1-flash-beta-on-vercel", "markdown": "https://wpnews.pro/news/deepseek-v4-1-flash-beta-on-vercel.md", "text": "https://wpnews.pro/news/deepseek-v4-1-flash-beta-on-vercel.txt", "jsonld": "https://wpnews.pro/news/deepseek-v4-1-flash-beta-on-vercel.jsonld"}}