Install

Gradle (JVM)

dependencies {
    implementation("ai.l1fe:orgs-sdk:0.9.0")
}

Kotlin Multiplatform

kotlin {
    sourceSets {
        commonMain {
            dependencies {
                implementation("ai.l1fe:orgs-sdk:0.9.0")
            }
        }
    }
}
Targets: JVM, Android, iOS, JS/Node, Wasm.

Quick start

import ai.l1fe.orgs.OrgsClient
import ai.l1fe.orgs.ProposalKind

suspend fun main() {
    val orgs = OrgsClient(apiKey = System.getenv("ORGS_API_KEY"))

    // List entities
    val entities = orgs.entities.list()
    entities.forEach { println("${it.did}: ${it.name}") }

    // Create proposal
    val proposal = orgs.proposals.create(
        entity = "helios-research",
        kind = ProposalKind.Spend(
            amountUsd = 12_500.0,
            recipient = "aws-bedrock",
            description = "Q2 compute reservation"
        )
    )
}

Coroutine support

All methods are suspend functions. Use with structured concurrency:
coroutineScope {
    val entities = async { orgs.entities.list() }
    val compliance = async { orgs.compliance.status("helios-research") }

    val result = mapOf(
        "entities" to entities.await(),
        "compliance" to compliance.await()
    )
}

Flow for streams

orgs.audit.stream("helios-research")
    .filter { it.event.startsWith("proposal.") }
    .collect { entry -> println(entry) }

Android integration

androidx.DataStore integration for secure key storage:
val orgs = OrgsClient.fromDataStore(context.dataStore)

Full docs

github.com/l1feai/orgs-sdk-kotlin