Skip to Content

ReceivedGatewayErrorSchema

const ReceivedGatewayErrorSchema: ZodObject<{ code: ZodOptional<ZodNullable<ZodString>>; headers: ZodOptional<ZodUnknown>; message: ZodOptional<ZodNullable<ZodString>>; param: ZodOptional<ZodNullable<ZodString>>; reason: ZodCatch<ZodOptional<ZodNullable<ZodString>>>; type: ZodOptional<ZodNullable<ZodString>>; }, $strip>;

The error object as a client reads it, from any gateway version: a code or type that this version does not know yet still arrives, and every field may be absent. The OpenAI SDK hands a rejection’s error object over as error.error; a stream carries it in an error event.

Last updated on