---
title: "Reference: Agent.getDefaultStreamOptionsLegacy() | Agents"
description: "Documentation for the `Agent.getDefaultStreamOptionsLegacy()` method in Mastra agents, which retrieves the default options used for streamLegacy calls."
packages:
  - "@mastra/core"
---

# Agent.getDefaultStreamOptionsLegacy()

:::warning

**Deprecated**: This method is deprecated and only works with V1 models. For V2 models, use the new [`.getDefaultOptions()`](./getDefaultOptions) method instead.

:::

Agents can be configured with default streaming options for memory usage, output format, and iteration steps. The `.getDefaultStreamOptionsLegacy()` method returns these defaults, resolving them if they are functions. These options apply to all `streamLegacy()` calls unless overridden and are useful for inspecting an agent’s unknown defaults.

## Usage example

```typescript
await agent.getDefaultStreamOptionsLegacy();
```

## Parameters

<PropertiesTable
  content={[
    {
      name: "options",
      type: "{ requestContext?: RequestContext }",
      isOptional: true,
      defaultValue: "{}",
      description: "Optional configuration object containing request context.",
    },
  ]}
/>

## Returns

<PropertiesTable
  content={[
    {
      name: "defaultOptions",
      type: "AgentStreamOptions | Promise<AgentStreamOptions>",
      description:
        "The default vNext streaming options configured for the agent, either as a direct object or a promise that resolves to the options.",
    },
  ]}
/>

## Extended usage example

```typescript
await agent.getDefaultStreamOptionsLegacy({
  requestContext: new RequestContext(),
});
```

### Options parameters

<PropertiesTable
  content={[
    {
      name: "requestContext",
      type: "RequestContext",
      isOptional: true,
      defaultValue: "new RequestContext()",
      description:
        "Request Context for dependency injection and contextual information.",
    },
  ]}
/>

## Related

- [Streaming with agents](/docs/v1/streaming/overview#streaming-with-agents)
- [Request Context](/docs/v1/server/request-context)
