Skip to Content

GatewayErrorTypeSchema

const GatewayErrorTypeSchema: ZodEnum<{ authentication_error: "authentication_error"; insufficient_quota: "insufficient_quota"; invalid_request_error: "invalid_request_error"; not_found_error: "not_found_error"; permission_error: "permission_error"; rate_limit_error: "rate_limit_error"; server_error: "server_error"; }>;

The gateway answers every failure, its own and an internal error alike, with an OpenAI-shaped { error: { message, type, code, param } } body, so the OpenAI SDKs surface its message. Its code is the failure’s ApiErrorReason where it has one, and otherwise its ApiErrorCode in the gateway’s snake case; quota errors keep their existing code and carry the reason separately. The type follows from the ApiErrorCode. Both come from the same vocabulary the app’s envelope uses.

Last updated on