{"record":{"id":"80d12478134165dc","repo":"mastra-ai/mastra","slug":"this-endpoint-is-deprecated-please-use-stream-in","errorCode":null,"errorMessage":"This endpoint is deprecated. Please use /stream instead.","messagePattern":"This endpoint is deprecated\\. Please use /stream instead\\.","errorType":"http","errorClass":"HTTPException","httpStatus":410,"severity":"warning","filePath":"packages/server/src/server/handlers/agents.ts","lineNumber":3555,"sourceCode":"      return handleError(error, 'Error enhancing instructions');\n    }\n  },\n});\n\nexport const STREAM_VNEXT_DEPRECATED_ROUTE = createRoute({\n  method: 'POST',\n  path: '/agents/:agentId/streamVNext',\n  responseType: 'stream',\n  pathParamSchema: agentIdPathParams,\n  bodySchema: agentExecutionBodySchema,\n  responseSchema: streamResponseSchema,\n  summary: 'Stream a response from an agent',\n  description: '[DEPRECATED] This endpoint is deprecated. Please use /stream instead.',\n  tags: ['Agents'],\n  requiresAuth: true,\n  deprecated: true,\n  handler: async () => {\n    throw new HTTPException(410, { message: 'This endpoint is deprecated. Please use /stream instead.' });\n  },\n});\n\nexport const STREAM_UI_MESSAGE_VNEXT_DEPRECATED_ROUTE = createRoute({\n  method: 'POST',\n  path: '/agents/:agentId/stream/vnext/ui',\n  responseType: 'stream',\n  pathParamSchema: agentIdPathParams,\n  bodySchema: agentExecutionBodySchema,\n  responseSchema: streamResponseSchema,\n  summary: 'Stream UI messages from an agent',\n  description:\n    '[DEPRECATED] This endpoint is deprecated. Please use the @mastra/ai-sdk package for uiMessage transformations',\n  tags: ['Agents'],\n  requiresAuth: true,\n  deprecated: true,\n  handler: async () => {\n    try {","sourceCodeStart":3537,"sourceCodeEnd":3573,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/handlers/agents.ts#L3537-L3573","documentation":"This HTTP 410 (Gone) error is thrown unconditionally by a deprecated agent streaming route handler. The endpoint no longer does any work; it exists only to tell clients the route is gone and that /stream should be used instead.","triggerScenarios":"POSTing to the deprecated agent streaming endpoint (the route marked `deprecated: true` at packages/server/src/server/handlers/agents.ts:3555).","commonSituations":"Client code or an SDK built against an older Mastra API still calls the legacy generate/stream route after upgrading the server to a version where the route was removed.","solutions":["Change the client to POST /api/agents/:agentId/stream instead of the deprecated endpoint.","Upgrade @mastra/client-js (or your custom fetch wrapper) to a version that targets the /stream route.","Remove any references to the deprecated path in proxy/rewriting layers in front of the server."],"exampleFix":"// before\nawait fetch(`/api/agents/${id}/generate`, { method: 'POST', body });\n// after\nawait fetch(`/api/agents/${id}/stream`, { method: 'POST', body });","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"async function streamAgent(id, body) {\n  let res = await fetch(`/api/agents/${id}/stream`, { method: 'POST', body });\n  if (res.status === 410) {\n    // old server / old path: retry once against legacy route or surface upgrade notice\n    res = await fetch(`/api/agents/${id}/generate`, { method: 'POST', body });\n  }\n  return res;\n}","preventionTips":["Track deprecated-route warnings in server changelogs and migrate early.","Use @mastra/client-js, which keeps route paths current.","Monitor 410 responses in production dashboards to catch stale clients."],"tags":["http-410","deprecated-endpoint","migration"],"backgroundTag":"endpoint-deprecated","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}