vercel/ai · error · UnsupportedFunctionalityError
DeepSeek strict tool calls require a beta base URL ending in
Error message
DeepSeek strict tool calls require a beta base URL ending in `/beta`.
What it means
DeepSeek strict tool calls are a beta-only feature. prepareTools throws UnsupportedFunctionalityError when any function tool has strict: true but the provider was constructed without a /beta base URL (supportsStrictToolCalls === false).
Source
Thrown at packages/deepseek/src/chat/deepseek-prepare-tools.ts:37
}): {
tools: undefined | Array<DeepSeekFunctionTool>;
toolChoice: DeepSeekToolChoice;
toolWarnings: SharedV4Warning[];
} {
// when the tools array is empty, change it to undefined to prevent errors:
tools = tools?.length ? tools : undefined;
const toolWarnings: SharedV4Warning[] = [];
if (tools == null) {
return { tools: undefined, toolChoice: undefined, toolWarnings };
}
const functionTools = tools.filter(tool => tool.type === 'function');
const hasStrictTool = functionTools.some(tool => tool.strict === true);
if (hasStrictTool && supportsStrictToolCalls === false) {
throw new UnsupportedFunctionalityError({
functionality: 'DeepSeek strict tool calls',
message:
'DeepSeek strict tool calls require a beta base URL ending in `/beta`.',
});
}
if (
hasStrictTool &&
supportsStrictToolCalls === true &&
functionTools.some(tool => tool.strict !== true)
) {
throw new UnsupportedFunctionalityError({
functionality: 'mixed DeepSeek strict and non-strict tool calls',
message:
'DeepSeek strict mode requires every function tool in the request to set `strict: true`.',
});
}
View on GitHub (pinned to 69428b1f8b)
Solutions
- Create the DeepSeek provider with baseURL 'https://api.deepseek.com/beta'
- Or remove strict: true from the tools
- Or use the beta model variant factory if the provider exposes one
Example fix
// before
const deepseek = createDeepSeek({ apiKey });
const tools = { weather: tool({ inputSchema, execute, strict: true }) };
// after
const deepseek = createDeepSeek({ apiKey, baseURL: 'https://api.deepseek.com/beta' }); Defensive patterns
Strategy: validation
Validate before calling
const baseURL = process.env.DEEPSEEK_BASE_URL ?? 'https://api.deepseek.com';
function assertBetaForStrictTools(tools) {
const anyStrict = Object.values(tools).some(t => t?.strict === true);
if (anyStrict && !baseURL.endsWith('/beta')) {
throw new Error('strict tool calls require a baseURL ending in /beta');
}
} Try / catch
try { ... } catch (e) { if (UnsupportedFunctionalityError.isInstance(e) && /strict tool calls/.test(e.message)) { /* switch endpoint or drop strict */ } throw e; } Prevention
- Pair strict: true usage with the /beta base URL in config
- Centralize provider creation so the endpoint is set in one place
- Document the beta requirement next to any strict tool definitions
When it happens
Trigger: Passing a tool with strict: true (e.g. tool({ ..., strict: true }) or zod-as-function with strict) to generateText/streamText with a DeepSeek model created with a non-beta baseURL.
Common situations: Copying strict-mode examples while using the production endpoint; enabling strict: true globally via a helper after migrating from OpenAI where strict is GA.
Related errors
- DeepSeek assistant prefix completion requires a beta base UR
- DeepSeek strict mode requires every function tool in the req
- The ${model.provider} model "${model.modelId}" does not supp
- unknown tool "${toolName}".
- callers for tool "${toolName}" must be an array.
AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30).
Data as JSON: /api/errors/aa5eef6d87c767c4.
Report an issue: GitHub.