vercel/ai · error
Not supported. You must use a /sync/v1 endpoint for chat mod
Error message
Not supported. You must use a /sync/v1 endpoint for chat models.
What it means
Baseten chat models must be served through a /sync/v1 (OpenAI-compatible) endpoint. If a custom modelURL contains '/predict', the provider throws, because /predict endpoints have a non-OpenAI request/response shape unsupported for chat.
Source
Thrown at packages/baseten/src/baseten-provider.ts:209
return `${customURL || baseURL}${path}`;
},
headers: getHeaders,
fetch: options.fetch,
});
const createChatModel = (modelId?: BasetenChatModelId) => {
const customURL = options.modelURL;
if (customURL) {
if (customURL.includes('/sync/v1')) {
return new OpenAICompatibleChatLanguageModel(modelId ?? 'placeholder', {
...getCommonModelConfig('chat', customURL),
errorStructure: basetenErrorStructure,
// Or stream_options.include_usage is omitted and streams report no usage.
includeUsage: true,
supportsStructuredOutputs: true,
});
} else if (customURL.includes('/predict')) {
throw new Error(
'Not supported. You must use a /sync/v1 endpoint for chat models.',
);
}
}
return new OpenAICompatibleChatLanguageModel(modelId ?? 'chat', {
...getCommonModelConfig('chat'),
errorStructure: basetenErrorStructure,
includeUsage: true,
supportsStructuredOutputs: true,
});
};
const createEmbeddingModel = (modelId?: BasetenEmbeddingModelId) => {
const customURL = options.modelURL;
if (!customURL) {
throw new Error(
'No model URL provided for embeddings. Please set modelURL option for embeddings.',View on GitHub (pinned to 69428b1f8b)
Solutions
- Change modelURL to the deployment's /sync/v1 endpoint, e.g. https://model-<id>.api.baseten.co/production/sync/v1.
- Deploy the model as an OpenAI-compatible sync deployment on Baseten.
- Omit modelURL to use the default chat base URL.
Example fix
// before
const baseten = createBaseten({ apiKey, modelURL: 'https://model-abc.api.baseten.co/production/predict' });
// after
const baseten = createBaseten({ apiKey, modelURL: 'https://model-abc.api.baseten.co/production/sync/v1' }); Defensive patterns
Strategy: validation
Validate before calling
if (options.modelURL && options.modelURL.includes('/predict')) {
throw new Error('Chat requires a /sync/v1 modelURL on Baseten');
} Try / catch
try {
const model = baseten('gpt-4o');
} catch (e) {
if (e instanceof Error && e.message.includes('/sync/v1 endpoint')) {
// fix modelURL config
}
} Prevention
- Store the full sync endpoint (…/production/sync/v1) in config, not the model page URL.
- Add a startup assertion that chat modelURL contains '/sync'.
- Omit modelURL if you want the default chat endpoint.
When it happens
Trigger: createBaseten({ modelURL: 'https://.../models/<id>/predict' }) then calling provider() or provider.chatModel — any chat model creation with a /predict URL.
Common situations: Reusing the URL of a Baseten Model API (which uses /predict) for chat; copying a model-page URL instead of the sync inference URL.
Related errors
- Not supported. You must use a /sync or /sync/v1 endpoint for
- No model URL provided for embeddings. Please set modelURL op
- Invalid argument for parameter model: model ${model.provider
- Unsupported output: ${_exhaustiveCheck}
- Invalid argument for parameter output: Invalid output type.
AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30).
Data as JSON: /api/errors/77b3ba43a48bd915.
Report an issue: GitHub.