Kotlin

ai.hanzo:hanzo-kotlin-cloud — the generated client for every /v1 capability, on OkHttp and Gson. Built from source until it lands on Maven Central.

Generated from the API's own document onto OkHttp and Gson — the same HTTP and JSON stack the Java client uses, so a JVM project pulling both pulls one stack.

Not on Maven Central yet

ai.hanzo:hanzo-kotlin-cloud resolves from no repository. Build it into your local Maven repository, or use the Java client, which is on Maven Central, from Kotlin.

Install

Building wants a JDK 21 toolchain; the jar is Java 8 bytecode. -PpublishLocal skips the GPG signing a Central upload needs.

git clone https://github.com/hanzo-kotlin/sdk hanzo-kotlin-sdk
cd hanzo-kotlin-sdk
./gradlew -PpublishLocal :hanzo-kotlin-cloud:publishToMavenLocal
// build.gradle.kts
repositories { mavenLocal() }
dependencies { implementation("ai.hanzo:hanzo-kotlin-cloud:8.5.156") }

The shape

Hanzo() reads the endpoint and the credential from the environment (HANZO_API_KEY, HANZO_BASE_URL, default https://api.hanzo.ai), and api(::AccountApi) builds that generated class, or any other, against them:

import ai.hanzo.Hanzo
import ai.hanzo.cloud.api.AccountApi

fun main() {
    val keys = Hanzo().api(::AccountApi).getAccountKeys().propertyKeys.orEmpty()
    println("${keys.size} keys")
}

The classes follow the document's tags under ai.hanzo.cloud.api, with their request and response types under ai.hanzo.cloud.model, so the reference is the index. Calls block; wrap them in your own dispatcher if you need them off a thread.

Resources

Was this page useful?
Last updated Oct 15, 2026