Skip to content

Property 'chat' does not exist on type 'Beta' in Node.js SDK despite being in docs #1546

Open
@akmaldira

Description

@akmaldira

Confirm this is a Node library issue and not an underlying OpenAI API issue

  • This is an issue with the Node library

Describe the bug

I'm trying to use the openai.beta.chat.completions.parse() function as shown in the official OpenAI SDK documentation, but I'm getting a TypeScript error:

Property 'chat' does not exist on type 'Beta'.

Expected behavior:

The code should run without TypeScript errors, as the documentation suggests openai.beta.chat.completions.parse exists.

Environment:

Package: openai
Version: 5.3.0 (or latest at time of writing)

Notes:

It looks like the SDK version does not include chat under the beta namespace, although the documentation shows it. Either the documentation is ahead of the SDK release, or the type declarations are incomplete.

Thanks!

To Reproduce

yarn add openai
const chain = await openai.beta.chat.completions.parse({})

Code snippets

OS

macOS

Node version

v20.10.0

Library version

5.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions