# 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.

- URL: https://laravel-vuejs.space/laravel-ai-sdk-stream-vue
- Author: Anass Ez-zouaine (https://laravel-vuejs.space/author/anass-ez-zouaine)
- Published: 2026-10-11
- Topics: Laravel, VueJs

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](https://laravel-vuejs.space/laravel-ai-sdk-vue) 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.
>
> **Who it's for:** Laravel + Vue developers
>
> **Applies to:** Laravel 13 · Vue 3

## The fix

```php
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

**Q: 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.

**Q: 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.
