Install
Quick start
- Text session
- Streaming session
Open a session, send a message, receive the complete response.
Client configuration
Your device credential token in
hk_live_… format. Issue credentials from the Humain
admin panel under Kiosk → Credentials → Issue new credential.kiosk.ModeSandbox returns instant stub responses without consuming AI credits. Use
kiosk.ModeLive for production.Context deadline applied to each HTTP request. The caller’s
context.Context deadline
takes precedence if shorter.Number of automatic retries on
503 PROVIDER_ERROR. Uses exponential back-off starting
at 1 second.Session options
Session mode. Only
kiosk.SessionModeText is supported by the SDK — voice sessions
require raw WebRTC or a VoIP integration.Arbitrary key-value pairs attached to the session. Available in your kiosk’s action
endpoints as
session.metadata.Error handling
The SDK returns typed errors you can check witherrors.As:
*kiosk.RateLimitError fields:
*kiosk.ProviderError fields:
Concurrent sessions
*kiosk.Client is safe to use from multiple goroutines. Each OpenSession call creates an
independent server-side session.
Running multiple sessions concurrently
Running multiple sessions concurrently
Using with net/http servers
Using with net/http servers
Create the client once at server startup and close sessions in a deferred call or after
each HTTP handler completes.