diff --git a/src/index.ts b/src/index.ts index b12c504d..b435ce52 100644 --- a/src/index.ts +++ b/src/index.ts @@ -69,13 +69,26 @@ export interface ClientOptions { authToken?: string | null; } -/** Instantiate the API Client. */ +/** API Client for interfacing with the Anthropic API. */ export class Anthropic extends Core.APIClient { apiKey: string | null; authToken?: string | null; private _options: ClientOptions; + /** + * API Client for interfacing with the Anthropic API. + * + * @param {string | null} [opts.apiKey=process.env['ANTHROPIC_API_KEY']] - The API Key to send to the API. + * @param {string} [opts.baseURL] - Override the default base URL for the API. + * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out. + * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections. + * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation. + * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request. + * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API. + * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API. + * @param {string | null} [opts.authToken] + */ constructor({ apiKey = Core.readEnv('ANTHROPIC_API_KEY') ?? null, authToken = Core.readEnv('ANTHROPIC_AUTH_TOKEN') ?? null,