Prerequisites
- Create an API key in the Developer Console.
- Store the key in an environment variable or secret manager.
- 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.
Node.js
Python
Go
Dart / Flutter
PHP
Ruby
Rust
Java
Swift
Requires Node.js 18 or later.The package is published on npm. npm, pnpm, Yarn, and Bun install the same ailabtools package.bun add only covers dependency installation. Validate your application before using Bun as the production runtime for the Node.js SDK.
Requires Python 3.8 or later. Install ailabtools-sdk, then import it as ailabtools.Use pip or uv pip for environment-level installs. Use uv add or poetry add for project dependencies. Use the module path shown on pkg.go.dev for the current Go package and exported type names. Requires Dart SDK >=3.0.0 <4.0.0. This is a pure Dart package. Use flutter pub for Flutter apps or dart pub for Dart packages and CLIs. Requires PHP 8.1 or later and Composer.Or add the package to composer.json: Requires Ruby 2.6 or later. Use Bundler for applications, or RubyGems for direct installation. Requires Rust 1.70 or later. Use Cargo to add the crate to your project.Or add the crate to Cargo.toml: Requires Java 11 or later. Choose Maven or Gradle according to your build system.Groovy DSL:Kotlin DSL: Requires iOS 13.0, macOS 10.15, tvOS 13.0, or watchOS 6.0 or later. Use Swift Package Manager or CocoaPods according to your Apple platform project setup.
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