pai
    Preparing search index...

    Function request

    • Calls the Phantom AI API with the key as a Bearer token and returns the JSON answer. Every client function in this file goes through it.

      Type Parameters

      • T

      Parameters

      • method: string

        The HTTP method.

      • path: string

        The path after the base URL, such as /key/balance.

      • apiKey: string

        The key sent in the Authorization header.

      • Optionalbody: unknown

        Sent as JSON when given.

      • OptionalbaseUrl: string

        The API base. Defaults to PHANTOM_BASE_URL, then DEFAULT_BASE_URL. Must be https (httpsOnly).

      • headers: Record<string, string> = {}

        Extra headers to send.

      Returns Promise<T>

      PhantomApiError when the API answers with an error status.