mirror of
https://github.com/hanzo-kt/sdk.git
synced 2026-10-30 20:43:57 +00:00
Coroutine-native client covering the full Hanzo /v1 cloud surface, for JVM and Android. Generated with openapi-generator kotlin (library=jvm-okhttp4, useCoroutines=true). Coordinate: ai.hanzo:sdk. Base URL: https://api.hanzo.ai. Co-authored-by: Hanzo Dev <[email protected]>
1.7 KiB
1.7 KiB
ChatApi
All URIs are relative to https://api.hanzo.ai
| Method | HTTP request | Description |
|---|---|---|
| gatewayCreateChatCompletion | POST /v1/gateway/chat/completions | Create chat completion |
gatewayCreateChatCompletion
GatewayChatCompletionResponse gatewayCreateChatCompletion(gatewayChatCompletionRequest)
Create chat completion
Example
// Import classes:
//import ai.hanzo.sdk.infrastructure.*
//import ai.hanzo.sdk.models.*
val apiInstance = ChatApi()
val gatewayChatCompletionRequest : GatewayChatCompletionRequest = // GatewayChatCompletionRequest |
try {
val result : GatewayChatCompletionResponse = apiInstance.gatewayCreateChatCompletion(gatewayChatCompletionRequest)
println(result)
} catch (e: ClientException) {
println("4xx response calling ChatApi#gatewayCreateChatCompletion")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ChatApi#gatewayCreateChatCompletion")
e.printStackTrace()
}
Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| gatewayChatCompletionRequest | GatewayChatCompletionRequest |
Return type
Authorization
Configure bearerAuth statically:
ApiClient.accessToken = ""
Configure bearerAuth dynamically:
apiInstance.accessTokenProvider = { "" }
HTTP request headers
- Content-Type: application/json
- Accept: application/json