{"record":{"id":"77b3ba43a48bd915","repo":"vercel/ai","slug":"not-supported-you-must-use-a-sync-v1-endpoint-fo","errorCode":null,"errorMessage":"Not supported. You must use a /sync/v1 endpoint for chat models.","messagePattern":"Not supported\\. You must use a /sync/v1 endpoint for chat models\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/baseten/src/baseten-provider.ts","lineNumber":209,"sourceCode":"      return `${customURL || baseURL}${path}`;\n    },\n    headers: getHeaders,\n    fetch: options.fetch,\n  });\n\n  const createChatModel = (modelId?: BasetenChatModelId) => {\n    const customURL = options.modelURL;\n    if (customURL) {\n      if (customURL.includes('/sync/v1')) {\n        return new OpenAICompatibleChatLanguageModel(modelId ?? 'placeholder', {\n          ...getCommonModelConfig('chat', customURL),\n          errorStructure: basetenErrorStructure,\n          // Or stream_options.include_usage is omitted and streams report no usage.\n          includeUsage: true,\n          supportsStructuredOutputs: true,\n        });\n      } else if (customURL.includes('/predict')) {\n        throw new Error(\n          'Not supported. You must use a /sync/v1 endpoint for chat models.',\n        );\n      }\n    }\n\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.',","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/baseten/src/baseten-provider.ts#L191-L227","documentation":"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.","triggerScenarios":"createBaseten({ modelURL: 'https://.../models/<id>/predict' }) then calling provider() or provider.chatModel — any chat model creation with a /predict URL.","commonSituations":"Reusing the URL of a Baseten Model API (which uses /predict) for chat; copying a model-page URL instead of the sync inference URL.","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."],"exampleFix":"// before\nconst baseten = createBaseten({ apiKey, modelURL: 'https://model-abc.api.baseten.co/production/predict' });\n// after\nconst baseten = createBaseten({ apiKey, modelURL: 'https://model-abc.api.baseten.co/production/sync/v1' });","handlingStrategy":"validation","validationCode":"if (options.modelURL && options.modelURL.includes('/predict')) {\n  throw new Error('Chat requires a /sync/v1 modelURL on Baseten');\n}","typeGuard":null,"tryCatchPattern":"try {\n  const model = baseten('gpt-4o');\n} catch (e) {\n  if (e instanceof Error && e.message.includes('/sync/v1 endpoint')) {\n    // fix modelURL config\n  }\n}","preventionTips":["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."],"tags":["configuration","url","baseten","chat"],"backgroundTag":"unsupported-endpoint-url","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}