From e9ed67a5330e6d4bfdf9d168757f1d18d6183b33 Mon Sep 17 00:00:00 2001 From: Oxygen <1391083091@qq.com> Date: Sat, 6 Jun 2026 02:22:04 +0800 Subject: [PATCH] fix: expose metadata in chat completions response Chat Completions API returns metadata that was not being exposed in the SDK response object. Fixes #1818 --- src/resources/chat/completions/completions.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/resources/chat/completions/completions.ts b/src/resources/chat/completions/completions.ts index 05cae402e..c9eb83c7e 100644 --- a/src/resources/chat/completions/completions.ts +++ b/src/resources/chat/completions/completions.ts @@ -330,6 +330,16 @@ export interface ChatCompletion { */ system_fingerprint?: string; + /** + * Set of 16 key-value pairs that can be attached to an object. This can be useful + * for storing additional information about the object in a structured format, and + * querying for objects via API or the dashboard. + * + * Keys are strings with a maximum length of 64 characters. Values are strings with + * a maximum length of 512 characters. + */ + metadata?: Shared.Metadata | null; + /** * Usage statistics for the completion request. */