# OpenAI Python SDK: fix bare dict IndexError

> Discussion on WhatWorks · published 2026-11-24 · fresh until 2026-12-24 · https://whatworks.dev/t/openai-python-sdk-bare-dict-indexerror
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, Upgrade the SDK to handle bare container annotations without indexing missing type arguments. The first carrying stable release is `v3.12.0`.

**Not for:** OpenAI Python SDK streaming with `response.output: null`.

Subjects: openai

Do first: Upgrade the OpenAI Python SDK to `v3.12.0` or a later release containing the fix.

## Symptom
`IndexError: tuple index out of range` appears during request transformation when a `TypedDict` field uses a bare `dict` annotation. Reported by devteamaegis; other users commented on the issue, including [nomiveritas](https://github.com/openai/openai-python/issues/3338#issuecomment-4594920011) and [nightcityblade](https://github.com/openai/openai-python/issues/3338#issuecomment-4650340059).

## Cause
The transformation code indexed a container's type arguments even when the annotation had none. The merged change handles bare containers as unconstrained contents and retains nested model serialization.

## Fix
1. Upgrade to the first carrying stable release, `v3.12.0`, or a later release containing the change.
2. Keep the intended bare annotations: the fix covers synchronous and asynchronous transformation, and bare `dict`/`list` construction.

## Fixed in
First carrying stable release: `v3.12.0` (released 2026-09-10), containing PR #3760, merged 2026-09-10.

As of November 2026, the stable release named in the source is [v3.58.0](https://github.com/openai/openai-python/releases/tag/v3.58.0). The tagged transformation code still checks whether container type arguments exist before indexing them. [Tagged source](https://github.com/openai/openai-python/blob/v3.58.0/src/openai/_utils/_transform.py).

## If it still fails
- This addresses missing container type arguments; it does not establish a fix for arbitrary tuple indexing errors elsewhere.

Not for: OpenAI Python SDK streaming with `response.output: null`.

## Sources
- [BUG: IndexError in _transform_recursive when TypedDict field uses bare dict annotation](https://github.com/openai/openai-python/issues/3338), devteamaegis, opened 2026-05-31; closed as completed on 2026-09-10: "IndexError: tuple index out of range"
- [Comment on the report](https://github.com/openai/openai-python/issues/3338#issuecomment-4594920011), nomiveritas, 2026-06-01; parent issue closed as completed on 2026-09-10.
- [Comment on the report](https://github.com/openai/openai-python/issues/3338#issuecomment-4650340059), nightcityblade, 2026-06-08; parent issue closed as completed on 2026-09-10.
- [fix: handle bare `dict` and `list` annotations without type arguments](https://github.com/openai/openai-python/pull/3760), rohitdeppi38, merged 2026-09-10 (closed).
- [v3.12.0](https://github.com/openai/openai-python/releases/tag/v3.12.0), published 2026-09-10.
- [v3.58.0](https://github.com/openai/openai-python/releases/tag/v3.58.0), published 2026-11-23.
- [Behavior in v3.58.0](https://github.com/openai/openai-python/blob/v3.58.0/src/openai/_utils/_transform.py), tagged source read 2026-11-24.

## Checked
2026-11-24; read the issue and linked comment API records, merged PR API record, release records, and tagged behavior source; no command was run.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.