mastra-ai/mastra · warning · HTTPException
This endpoint is deprecated. Please use /stream instead.
Error message
This endpoint is deprecated. Please use /stream instead.
What it means
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.
Source
Thrown at packages/server/src/server/handlers/agents.ts:3555
return handleError(error, 'Error enhancing instructions');
}
},
});
export const STREAM_VNEXT_DEPRECATED_ROUTE = createRoute({
method: 'POST',
path: '/agents/:agentId/streamVNext',
responseType: 'stream',
pathParamSchema: agentIdPathParams,
bodySchema: agentExecutionBodySchema,
responseSchema: streamResponseSchema,
summary: 'Stream a response from an agent',
description: '[DEPRECATED] This endpoint is deprecated. Please use /stream instead.',
tags: ['Agents'],
requiresAuth: true,
deprecated: true,
handler: async () => {
throw new HTTPException(410, { message: 'This endpoint is deprecated. Please use /stream instead.' });
},
});
export const STREAM_UI_MESSAGE_VNEXT_DEPRECATED_ROUTE = createRoute({
method: 'POST',
path: '/agents/:agentId/stream/vnext/ui',
responseType: 'stream',
pathParamSchema: agentIdPathParams,
bodySchema: agentExecutionBodySchema,
responseSchema: streamResponseSchema,
summary: 'Stream UI messages from an agent',
description:
'[DEPRECATED] This endpoint is deprecated. Please use the @mastra/ai-sdk package for uiMessage transformations',
tags: ['Agents'],
requiresAuth: true,
deprecated: true,
handler: async () => {
try {View on GitHub (pinned to 75dd419e61)
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.
Example fix
// before
await fetch(`/api/agents/${id}/generate`, { method: 'POST', body });
// after
await fetch(`/api/agents/${id}/stream`, { method: 'POST', body }); Defensive patterns
Strategy: fallback
Try / catch
async function streamAgent(id, body) {
let res = await fetch(`/api/agents/${id}/stream`, { method: 'POST', body });
if (res.status === 410) {
// old server / old path: retry once against legacy route or surface upgrade notice
res = await fetch(`/api/agents/${id}/generate`, { method: 'POST', body });
}
return res;
} Prevention
- 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.
When it happens
Trigger: POSTing to the deprecated agent streaming endpoint (the route marked `deprecated: true` at packages/server/src/server/handlers/agents.ts:3555).
Common situations: 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.
Related errors
- DEPRECATED_ENDPOINT
- toAISdkFormat() has been deprecated. Please use toAISdkStrea
- MastraFactory: 'sandbox' is now a callback, not an options o
- Repository ${id} not found in organization ${orgId}
- Repository ${id} not found in organization ${orgId}
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/80d12478134165dc.
Report an issue: GitHub.