---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/openai_responses/adapter/classes/OpenAIResponsesAdapter.md
description: Opinionated cross-environment LLM adapter for the OpenAI Responses wire shape.
---

# Class: OpenAIResponsesAdapter

Defined in: [src/batteries/llm/openai\_responses/adapter.ts:380](https://github.com/NHTIO/ADK/blob/v1.20260901.0/src/src/batteries/llm/openai_responses/adapter.ts#L380)

Opinionated cross-environment LLM adapter for the OpenAI Responses wire shape.

## Remarks

Construction validates options eagerly via [validateOptions](../../validation/functions/validateOptions.md) and throws
[E\_INVALID\_OPENAI\_RESPONSES\_OPTIONS](../../exceptions/variables/E_INVALID_OPENAI_RESPONSES_OPTIONS.md) on failure. The returned instance is reusable: call
[OpenAIResponsesAdapter.executor](#executor) once per `DispatchRunner` configuration.

Per-iteration overrides live on the active `DispatchContext`'s `stash.openaiResponses` slot and
take highest precedence — they merge into the executor-scope shape on every iteration.
`headers`, `helpers`, and `retry` merge key-by-key across all three layers; every other field is
replaced wholesale at the highest layer that sets it.

## Constructors

### Constructor

```ts
new OpenAIResponsesAdapter(options: unknown): OpenAIResponsesAdapter;
```

Defined in: [src/batteries/llm/openai\_responses/adapter.ts:396](https://github.com/NHTIO/ADK/blob/v1.20260901.0/src/src/batteries/llm/openai_responses/adapter.ts#L396)

#### Parameters

| Parameter | Type      | Description                                                                                                                  |
| --------- | --------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `options` | `unknown` | Constructor-baseline options. Re-validated on every iteration after per-dispatch and per-iteration overrides are layered in. |

#### Returns

`OpenAIResponsesAdapter`

#### Throws

E\_INVALID\_OPENAI\_RESPONSES\_OPTIONS when `options` does not satisfy
`openAIResponsesOptionsSchema`.

## Properties

| Property                                    | Modifier   | Type                | Description                                                                                                                                                                                                             | Defined in                                                                                                                                                  |
| ------------------------------------------- | ---------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|  `STASH_KEY` | `readonly` | `"openaiResponses"` | Customary key for per-iteration overrides on `ctx.stash`. The adapter reads `ctx.stash.get(OpenAIResponsesAdapter.STASH_KEY, {})` at the start of every iteration and merges the value into the resolved options shape. | [src/batteries/llm/openai\_responses/adapter.ts:386](https://github.com/NHTIO/ADK/blob/v1.20260901.0/src/src/batteries/llm/openai_responses/adapter.ts#L386) |

## Methods

### executor()

```ts
executor(overrides?: Partial<OpenAIResponsesAdapterOptions>): DispatchExecutorFn;
```

Defined in: [src/batteries/llm/openai\_responses/adapter.ts:409](https://github.com/NHTIO/ADK/blob/v1.20260901.0/src/src/batteries/llm/openai_responses/adapter.ts#L409)

Returns a `DispatchExecutorFn` bound to this adapter's baseline plus optional executor-scope
overrides. The returned function is reusable across iterations — every iteration re-merges
with `ctx.stash[STASH_KEY]` and re-validates the result.

#### Parameters

| Parameter    | Type                                                                                                                                                                                   | Description                                                                                                           |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| `overrides?` | [`Partial`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype)<[`OpenAIResponsesAdapterOptions`](../../types/interfaces/OpenAIResponsesAdapterOptions.md)> | Optional executor-scope overrides. Higher precedence than the baseline, lower precedence than `ctx.stash[STASH_KEY]`. |

#### Returns

[`DispatchExecutorFn`](../../../../../dispatch_runner/type-aliases/DispatchExecutorFn.md)

A `DispatchExecutorFn` suitable for `DispatchRunner`.

***

### isOpenAIResponsesAdapter()

```ts
static isOpenAIResponsesAdapter(value: unknown): value is OpenAIResponsesAdapter;
```

Defined in: [src/batteries/llm/openai\_responses/adapter.ts:1972](https://github.com/NHTIO/ADK/blob/v1.20260901.0/src/src/batteries/llm/openai_responses/adapter.ts#L1972)

Returns `true` when `value` is an OpenAIResponsesAdapter instance.

#### Parameters

| Parameter | Type      | Description        |
| --------- | --------- | ------------------ |
| `value`   | `unknown` | The value to test. |

#### Returns

`value is OpenAIResponsesAdapter`

`true` when `value` is an `OpenAIResponsesAdapter` instance.
