Skip to main content
The fal-client packages provide Kotlin and Java interfaces for calling fal AI models on Android and JVM platforms.

Installation

implementation 'ai.fal.client:fal-client-kotlin:0.7.1'
Java Async SupportIf your code relies on asynchronous operations via CompletableFuture or Future, use the ai.fal.client:fal-client-async artifact instead.

Quick Start

import ai.fal.client.kt

val fal = createFalClient()

val input = mapOf<String, Any>(
    "prompt" to "a cat",
    "seed" to 6252023,
    "image_size" to "landscape_4_3",
    "num_images" to 4
)
val result = fal.subscribe("fal-ai/flux/dev", input, options = SubscribeOptions(
    logs = true
)) { update ->
    if (update is QueueStatus.InProgress) {
        println(update.logs)
    }
}

Supported Platforms

  • Android (API 21+)
  • JVM (Java 11+)
  • Kotlin Multiplatform (JVM target)

API Reference

GitHub Repository

Source code and examples