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
| Option | Best for | Start here |
|---|---|---|
| Official SDK | Supported runtimes that benefit from typed clients, file helpers, SDK method names, and async polling helpers. | Install the package below, then open the SDK API index. |
| Direct HTTP | Unsupported runtimes, custom HTTP clients, or integrations that need full request control. | Open the API reference page for the endpoint, such as Universal Background Removal. |
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.
Available SDKs
Installable SDK packages and documentation links:Only published SDKs are listed. For other languages or runtimes, use the direct HTTP API.
| Platform | Package | Notes | Docs |
|---|---|---|---|
| Node.js / TypeScript | npm: ailabtools | Requires Node.js 18 or later. | Examples · SDK README |
| Python (async) | PyPI: ailabtools-sdk | Requires Python 3.8 or later. Import as ailabtools. | Examples · SDK README |
| Go | pkg.go.dev: github.com/ailabtools/ailabtools-sdk/packages/go | Use package docs for Go type names. | Examples · Package docs |
| Dart / Flutter | pub.dev: ailabtools | Pure Dart package. Use dart pub or flutter pub. | Examples · SDK README |
| PHP | Packagist: ailabtools/ailabtools | Requires PHP 8.1 or later and Composer. | Examples · SDK README |
| Ruby | RubyGems: ailabtools | Requires Ruby 2.6 or later. | Examples · SDK README |
| Rust | crates.io: ailabtools | Requires Rust 1.70 or later. | Examples · SDK README |
| Java | Maven Central: com.ailabtools:ailabtools-sdk | Requires Java 11 or later. | Examples · SDK README |
| Swift | Swift Package Manager / CocoaPods: AILabTools | Use SwiftPM or CocoaPods. | Examples · SDK README |
Install
Choose the package manager used by your project.Multiple commands in the same tab install the same SDK package. They are package-manager alternatives, not separate SDKs.
- Node.js
- Python
- Go
- Dart / Flutter
- PHP
- Ruby
- Rust
- Java
- Swift
Authentication
All SDKs authenticate with an AILabTools API key. SDK examples useAILAB_API_KEY as the environment variable name:
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.Implementation Notes
| Topic | Guidance |
|---|---|
| Request fields | SDKs may expose language-native names, such as returnForm for the HTTP field return_form. Use the SDK docs for code and the API reference for field meaning. |
| File uploads | Use SDK-supported file helpers such as file paths, bytes, buffers, streams, or language-specific file wrappers. |
| Async tasks | If a response contains task_id, use the SDK polling helper where available or call Querying Async Task Results. |
| Result URLs | Result image URLs may be temporary. Download and store files promptly if your application needs long-term access. |
| Errors | Log request_id and log_id when handling API errors. These IDs help support locate failed requests. |

