Skip to main content

Prerequisites

  1. Create an API key in the Developer Console.
  2. Store the key in an environment variable or secret manager.
  3. Choose either an SDK integration or direct HTTP integration.

Integration Options

SDKs wrap the same public HTTP APIs documented on this site. Direct HTTP and SDK integrations use the same API key and the same underlying endpoints.

Install

Select your runtime, then use the package manager already used by your project.
Unversioned commands install the latest published release. Versioned snippets are pinning examples; check the linked registry before copying a fixed version into production.
Requires Node.js 18 or later.The package is published on npm. npm, pnpm, Yarn, and Bun install the same ailabtools package.

npm: ailabtools

pnpm: ailabtools

Yarn: ailabtools

Bun: ailabtools

bun add only covers dependency installation. Validate your application before using Bun as the production runtime for the Node.js SDK.

Authentication

All SDKs authenticate with an AILabTools API key. SDK examples use AILAB_API_KEY as the environment variable name:
Pass this value to the SDK client in your application code.
AILAB_API_KEY is an SDK example convention, not an HTTP header name. Direct HTTP calls use the ailabapi-api-key request header shown in each API reference page.
For public browser, desktop, or mobile applications, do not ship your AILabTools API key with the client. Call AILabTools from your backend, or issue requests through a trusted service that keeps the API key private.

Implementation Notes