Skip to content

fix(types): include optional metadata on ChatCompletion responses (#1818)#1834

Open
Adityakk9031 wants to merge 1 commit intoopenai:masterfrom
Adityakk9031:#1818
Open

fix(types): include optional metadata on ChatCompletion responses (#1818)#1834
Adityakk9031 wants to merge 1 commit intoopenai:masterfrom
Adityakk9031:#1818

Conversation

@Adityakk9031
Copy link
Copy Markdown

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

This PR addresses #1818 (Chat Completions is not returning the metadata).

Root cause

metadata is accepted in chat.completions.create params and supported in stored completion flows (retrieve, update, list), but the ChatCompletion response type did not include a metadata field.
This caused a contract/type mismatch in the SDK even when the API returns metadata for stored objects.

What changed

  • Added metadata?: Shared.Metadata | null to ChatCompletion in:
    • src/resources/chat/completions/completions.ts
  • Added contextual docs indicating metadata is commonly present on stored completions and may be absent in immediate create responses.

Scope

  • Type/docs-only change.
  • No runtime request/response parsing logic changed.

@Adityakk9031 Adityakk9031 requested a review from a team as a code owner April 20, 2026 11:04
@Adityakk9031 Adityakk9031 changed the title fix(types): include optional metadata on ChatCompletion responses (#1818) fix(types): include optional metadata on ChatCompletion responses (#1818) Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant