From 534e98d6e7f7bc7ca0ee102ca91f5b01c6bb6ea2 Mon Sep 17 00:00:00 2001 From: Ayomide Date: Wed, 4 Feb 2026 11:01:24 +0100 Subject: [PATCH] fix(schema): allow null system_fingerprint in OpenAI response OpenAI API can return `system_fingerprint: null` for some models, but the Zod schema only accepted `string | undefined`. This caused validation failures with an APIResponseError. --- src/schemas/openai-responses.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schemas/openai-responses.ts b/src/schemas/openai-responses.ts index 90a16f6..ccb180b 100644 --- a/src/schemas/openai-responses.ts +++ b/src/schemas/openai-responses.ts @@ -33,7 +33,7 @@ export const OPENAI_RESPONSE_SCHEMA = z.object({ model: z.string().optional(), choices: z.array(OPENAI_CHOICE_SCHEMA).min(1), usage: OPENAI_USAGE_SCHEMA.optional(), - system_fingerprint: z.string().optional(), + system_fingerprint: z.string().nullable().optional(), }); // Inferred TypeScript types