• Get the API key from the environment. Precedence:

    1. explicit argument
    2. LANGGRAPH_API_KEY
    3. LANGSMITH_API_KEY
    4. LANGCHAIN_API_KEY

    Parameters

    • Optional apiKey: string

      Optional API key provided as an argument

    Returns string | undefined

    The API key if found, otherwise undefined