KtorFalAiGenerationApi

class KtorFalAiGenerationApi(val httpClient: HttpClient, val apiBaseUrl: String, val queueBaseUrl: String) : FalAiGenerationApi(source)

Ktor implementation of Fal AI generation and queue polling with traffic accounting.

Author

Dmitriy Moroz

Parameters

httpClient

Configured Ktor client used to send provider requests.

apiBaseUrl

Base API URL for validation and model submission endpoints.

queueBaseUrl

Base queue URL for polling and result endpoints.

Constructors

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

Creates a new SDAI component instance.

Types

Link copied to clipboard
private object Companion

Provides the companion object singleton used by the SDAI network layer.

Properties

Link copied to clipboard
private val apiBaseUrl: String

Exposes the apiBaseUrl value used by the SDAI network layer.

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

Exposes the httpClient value used by the SDAI network layer.

Link copied to clipboard
private val queueBaseUrl: String

Exposes the queueBaseUrl value used by the SDAI network layer.

Functions

Link copied to clipboard
open suspend override fun downloadImage(url: String): ByteArray

Executes the downloadImage step in the SDAI network layer.

Link copied to clipboard
open suspend override fun getQueueResult(apiKey: String, responseUrl: String): FalAiGenerationResponse

Executes the getQueueResult step in the SDAI network layer.

Link copied to clipboard
open suspend override fun getQueueStatus(apiKey: String, statusUrl: String): FalAiQueueStatusResponse

Executes the getQueueStatus step in the SDAI network layer.

Link copied to clipboard
open suspend override fun submitImageToImage(apiKey: String, model: String, request: FalAiImageToImageRequest): FalAiQueueSubmitResponse

Executes the submitImageToImage step in the SDAI network layer.

Link copied to clipboard
open suspend override fun submitTextToImage(apiKey: String, model: String, request: FalAiTextToImageRequest): FalAiQueueSubmitResponse

Executes the submitTextToImage step in the SDAI network layer.

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

Executes the validateApiKey step in the SDAI network layer.