KtorArliAiGenerationApi

class KtorArliAiGenerationApi(val httpClient: HttpClient, val baseUrl: String) : ArliAiGenerationApi(source)

Ktor implementation of ArliAI validation, model discovery, and image generation.

Model-list traffic is counted as NetworkUsageCategory.CONFIGS. Text-to-image and image-to-image request and response bodies are counted as NetworkUsageCategory.INFERENCE.

Author

Dmitriy Moroz

Parameters

httpClient

configured Ktor client used to send provider requests.

baseUrl

ArliAI SDNext-compatible API base URL.

Constructors

Link copied to clipboard
constructor(httpClient: HttpClient, baseUrl: String)
constructor(baseUrl: String)

Creates an ArliAI API client with the shared application HTTP configuration.

Types

Link copied to clipboard
private object Companion

Properties

Link copied to clipboard
private val baseUrl: String
Link copied to clipboard
Link copied to clipboard
private val httpClient: HttpClient

Functions

Link copied to clipboard
open suspend override fun fetchModels(apiKey: String): List<KtorStableDiffusionModelRaw>

Loads available ArliAI checkpoints and records the response as configuration traffic.

Link copied to clipboard
open suspend override fun imageToImage(apiKey: String, request: ArliAiImageToImageRequest): SdGenerationResponse

Sends image-to-image generation and records request plus response bytes as inference traffic.

Link copied to clipboard
open suspend override fun textToImage(apiKey: String, request: ArliAiTextToImageRequest): SdGenerationResponse

Sends text-to-image generation and records request plus response bytes as inference traffic.

Link copied to clipboard
open suspend override fun validateApiKey(apiKey: String)

Validates the key by loading the ArliAI model list.