httpClient

fun httpClient(block: HttpClientConfig<*>.() -> Unit): DeepSeekClientBase.Builder

Applies additional configuration on top of the default HTTP client.

The block is layered on top of the builder defaults (Auth, ContentNegotiation with the current jsonConfig, base URL via defaultRequest, HttpRequestRetry, HttpTimeout, Logging — plus SSE for DeepSeekClientStream) at DeepSeekClient.Builder.build / DeepSeekClientStream.Builder.build time. Calling this method multiple times layers each block on top of the previous state, in the order they were added.

Because the HTTP client is assembled lazily, jsonConfig changes are picked up regardless of whether they are set before or after httpClient.

Use httpClient with an HttpClient argument if you want to replace the underlying client entirely instead of extending it.

Example — override the request timeout while keeping all other defaults:

val client = DeepSeekClient("token") {
httpClient {
install(HttpTimeout) {
requestTimeoutMillis = 60_000
}
}
}

Return

This builder for chaining

Parameters

block

Additional configuration to merge on top of the default HTTP client


fun httpClient(client: HttpClient): DeepSeekClientBase.Builder

Replaces the underlying HTTP client entirely with the provided client.

Unlike the httpClient overload that takes a configuration block, this overload does not preserve the builder defaults — the caller is responsible for installing Auth, ContentNegotiation, the base URL in defaultRequest, retries, timeouts, logging, and (for streaming) SSE. jsonConfig and any httpClient blocks added before or after this call are ignored for the HTTP client itself, though jsonConfig is still surfaced via DeepSeekClientConfig.jsonConfig.

Return

This builder for chaining

Parameters

client

Fully configured HTTP client to use