{"record":{"id":"e2abe491752b4891","repo":"vercel/ai","slug":"not-supported-you-must-use-a-sync-or-sync-v1-en","errorCode":null,"errorMessage":"Not supported. You must use a /sync or /sync/v1 endpoint for embeddings.","messagePattern":"Not supported\\. You must use a /sync or /sync/v1 endpoint for embeddings\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/baseten/src/baseten-provider.ts","lineNumber":232,"sourceCode":"\n    return new OpenAICompatibleChatLanguageModel(modelId ?? 'chat', {\n      ...getCommonModelConfig('chat'),\n      errorStructure: basetenErrorStructure,\n      includeUsage: true,\n      supportsStructuredOutputs: true,\n    });\n  };\n\n  const createEmbeddingModel = (modelId?: BasetenEmbeddingModelId) => {\n    const customURL = options.modelURL;\n    if (!customURL) {\n      throw new Error(\n        'No model URL provided for embeddings. Please set modelURL option for embeddings.',\n      );\n    }\n\n    if (!customURL.includes('/sync')) {\n      throw new Error(\n        'Not supported. You must use a /sync or /sync/v1 endpoint for embeddings.',\n      );\n    }\n\n    // BEI embedding deployments are OpenAI-compatible with no extra settings, so\n    // plain HTTP is the default and needs no override.\n    const model = new OpenAICompatibleEmbeddingModel(modelId ?? 'embeddings', {\n      ...getCommonModelConfig('embedding', customURL),\n      errorStructure: basetenErrorStructure,\n      // Over HTTP, cap each request and let `embedMany` split and parallelise.\n      // The native client does its own batching, so let it take everything at\n      // once — `embedMany` treats Infinity as \"one call\".\n      maxEmbeddingsPerCall: options.performanceClient\n        ? Number.POSITIVE_INFINITY\n        : MAX_EMBEDDINGS_PER_CALL,\n    });\n\n    if (!options.performanceClient) {","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/baseten/src/baseten-provider.ts#L214-L250","documentation":"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.","triggerScenarios":"createBaseten({ modelURL: 'https://.../production/predict' }) then creating an embedding model — any modelURL without '/sync' in the path.","commonSituations":"Pointing embeddings at a Model API /predict endpoint; typo'd or legacy deployment URL.","solutions":["Update modelURL to include /sync/v1 (e.g. .../production/sync/v1).","Redeploy the embedding model as a sync/BEI deployment on Baseten."],"exampleFix":"// before\ncreateBaseten({ apiKey, modelURL: 'https://model-xyz.api.baseten.co/production/predict' });\n// after\ncreateBaseten({ apiKey, modelURL: 'https://model-xyz.api.baseten.co/production/sync/v1' });","handlingStrategy":"validation","validationCode":"if (options.modelURL && !options.modelURL.includes('/sync')) {\n  throw new Error('Baseten embeddings need a /sync or /sync/v1 modelURL');\n}","typeGuard":null,"tryCatchPattern":"try {\n  const embeddingModel = baseten.textEmbeddingModel('embeddings');\n} catch (e) {\n  if (e instanceof Error && e.message.includes('/sync or /sync/v1 endpoint')) {\n    // fix modelURL\n  }\n}","preventionTips":["Ensure the embedding modelURL path contains '/sync'.","Keep a single config constant per deployment kind (chat vs embeddings).","Smoke-test embedding creation in CI with the real URL."],"tags":["configuration","url","embeddings","baseten"],"backgroundTag":"unsupported-endpoint-url","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}