vercel/ai · error

Not supported. You must use a /sync or /sync/v1 endpoint for

Error message

Not supported. You must use a /sync or /sync/v1 endpoint for embeddings.

What it means

Baseten embeddings must target a /sync (or /sync/v1) endpoint. If the provided modelURL lacks '/sync', createEmbeddingModel throws, because only sync deployments expose the OpenAI-compatible embeddings route.

Source

Thrown at packages/baseten/src/baseten-provider.ts:232

    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.',
      );
    }

    if (!customURL.includes('/sync')) {
      throw new Error(
        'Not supported. You must use a /sync or /sync/v1 endpoint for embeddings.',
      );
    }

    // BEI embedding deployments are OpenAI-compatible with no extra settings, so
    // plain HTTP is the default and needs no override.
    const model = new OpenAICompatibleEmbeddingModel(modelId ?? 'embeddings', {
      ...getCommonModelConfig('embedding', customURL),
      errorStructure: basetenErrorStructure,
      // Over HTTP, cap each request and let `embedMany` split and parallelise.
      // The native client does its own batching, so let it take everything at
      // once — `embedMany` treats Infinity as "one call".
      maxEmbeddingsPerCall: options.performanceClient
        ? Number.POSITIVE_INFINITY
        : MAX_EMBEDDINGS_PER_CALL,
    });

    if (!options.performanceClient) {

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Update modelURL to include /sync/v1 (e.g. .../production/sync/v1).
  2. Redeploy the embedding model as a sync/BEI deployment on Baseten.

Example fix

// before
createBaseten({ apiKey, modelURL: 'https://model-xyz.api.baseten.co/production/predict' });
// after
createBaseten({ apiKey, modelURL: 'https://model-xyz.api.baseten.co/production/sync/v1' });
Defensive patterns

Strategy: validation

Validate before calling

if (options.modelURL && !options.modelURL.includes('/sync')) {
  throw new Error('Baseten embeddings need a /sync or /sync/v1 modelURL');
}

Try / catch

try {
  const embeddingModel = baseten.textEmbeddingModel('embeddings');
} catch (e) {
  if (e instanceof Error && e.message.includes('/sync or /sync/v1 endpoint')) {
    // fix modelURL
  }
}

Prevention

When it happens

Trigger: createBaseten({ modelURL: 'https://.../production/predict' }) then creating an embedding model — any modelURL without '/sync' in the path.

Common situations: Pointing embeddings at a Model API /predict endpoint; typo'd or legacy deployment URL.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/e2abe491752b4891. Report an issue: GitHub.