Skip to main content

AI_LoadAPIKeyError

还没翻译译自英文(ai-sdk.dev)本页 6 段都还没译

This error occurs when API key is not loaded successfully.

Properties

  • message: The error message

Checking for this Error

You can check if an error is an instance of AI_LoadAPIKeyError using:

import { LoadAPIKeyError } from 'ai';

if (LoadAPIKeyError.isInstance(error)) {
  // Handle the error
}