Prerequisites
- Golang v1.25.0 or later
- A running HasteKit LLM Gateway instance
- A virtual key configured in the gateway (see Virtual Keys)
Installation
Install the HasteKit SDK:Setting Up the SDK
To use the SDK with the HasteKit LLM Gateway, you need to configure it with the gateway endpoint and a virtual key.Configuration
ServerConfig
TheServerConfig struct contains the gateway connection settings:
- Endpoint: The base URL of your HasteKit LLM Gateway (e.g.,
http://localhost:6060orhttps://your-gateway.com) - VirtualKey: Your virtual key from the gateway (prefixed with
sk-hk-)
Getting Your Virtual Key
- Navigate to the Virtual Keys page in the HasteKit gateway dashboard
- Create a new virtual key or use an existing one
- Copy the secret key (it starts with
sk-hk-) - Use it in your SDK configuration
Making LLM Calls
Basic Example
Supported Providers
You can switch between providers by changing theModel field:
Advanced Usage
The SDK supports many advanced features:- Streaming Responses: Get responses in real-time as they’re generated
- Tool Calling: Use function calling with LLMs
- Structured Output: Get responses in JSON format with schema validation
- Reasoning: Use chain-of-thought reasoning for complex tasks
- Image Generation: Generate images with supported providers
- Multi-turn Conversations: Maintain conversation history
Next Steps
- Learn more about the Responses API for advanced LLM features
- Explore Text Generation for basic text completion
- Check out Streaming Responses for real-time responses
- See Tool Calling for function calling capabilities
- Build Agents with the Agent SDK