---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/openai_responses/helpers/functions/normalizeOpenAIResponsesItemId.md
---

# Function: normalizeOpenAIResponsesItemId()

```ts
function normalizeOpenAIResponsesItemId(id: string, prefix?: string): string;
```

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

Normalises an ADK-authored id to the Responses item-id charset, and hashes+truncates ids over
the 64-character limit (Known Gotcha #5) rather than sending an oversized id verbatim.

## Parameters

| Parameter | Type     | Default value |
| --------- | -------- | ------------- |
| `id`      | `string` | `undefined`   |
| `prefix`  | `string` | `'msg'`       |

## Returns

`string`

## Remarks

Not part of the public [OpenAIResponsesHelpers](../../types/interfaces/OpenAIResponsesHelpers.md) contract (no override seam is warranted for
a pure charset/length transform) — exported for the adapter and for direct unit testing.
