export declare const OpenAIErrors: { readonly NO_API_KEY: "No API key provided. Please set the OPENAI_API_KEY environment variable or pass the { apiKey } option."; readonly MAX_TOKENS: "Maximum number of tokens reached."; readonly UNKNOWN: "An unknown error occurred."; readonly INVALID_API_KEY: "Incorrect API key provided. You can find your API key at https://platform.openai.com/account/api-keys."; readonly INVALID_MODEL: "The model does not exist"; readonly RATE_LIMIT_REACHED: "You are sending requests too quickly. Pace your requests. Read the Rate limit guide."; readonly EXCEEDED_QUOTA: "You have hit your maximum monthly spend (hard limit) which you can view in the account billing section. Apply for a quota increase."; readonly ENGINE_OVERLOAD: "Our servers are experiencing high traffic. Please retry your requests after a brief wait."; readonly SERVER_ERROR: "Issue on our servers. Retry your request after a brief wait and contact us if the issue persists. Check the status page."; }; export type OpenAIErrorType = keyof typeof OpenAIErrors; export type OpenAIErrorMessage = typeof OpenAIErrors[OpenAIErrorType]; export declare class OpenAIError extends Error { type: OpenAIErrorType; message: OpenAIErrorMessage; constructor(type: OpenAIErrorType); toJSON(): { type: "NO_API_KEY" | "MAX_TOKENS" | "UNKNOWN" | "INVALID_API_KEY" | "INVALID_MODEL" | "RATE_LIMIT_REACHED" | "EXCEEDED_QUOTA" | "ENGINE_OVERLOAD" | "SERVER_ERROR"; message: OpenAIErrorMessage; }; }