People searching “Laravel AI SDK stream Vue” return stream() from the Inertia form action and the visit fails. A stream is not an Inertia redirect. The AI SDK guide posts a note and redirects with the finished string. Use that when the reply is short. Use a stream route when you need tokens as they arrive.
TL;DR
- stream() can be returned from its own route as server-sent events.
- It is not an Inertia form response.
- Do not put the provider key in the fetch URL.
- Do not point
<Form>at this route and expect the slot’s errors to render the tokens.
The fix#
Route::post('/replies/stream', function (Request $request) {
$validated = $request->validate([
'note' => ['required', 'string', 'max:2000'],
]);
return (new DraftReply)->stream($validated['note']);
})->middleware('auth');The Vue page starts that request with fetch, not with useForm. useForm is waiting for a redirect and an Inertia page. The auth middleware stays. A public stream is a public bill.
What to avoid#
Gotcha
Do not put the provider key in the fetch URL. Do not point <Form> at this route and expect the slot’s errors to render the tokens. Validation errors from this route are a normal HTTP response, which your fetch has to read.
FAQ#
How do I stream an AI SDK reply without an Inertia visit?
stream() can be returned from its own route as server-sent events. It is not an Inertia form response.
What goes wrong with Laravel AI SDK stream Vue?
Many developers return stream() from the Inertia form action and the visit fails. Do not put the provider key in the fetch URL.



