package main
import (
"context"
"fmt"
"log"
"github.com/hastekit/hastekit-sdk-go/pkg/gateway"
"github.com/hastekit/hastekit-sdk-go/pkg/gateway/llm"
hastekit "github.com/hastekit/hastekit-sdk-go"
)
func main() {
// Define multiple API keys for OpenAI with different weights
providerConfigs := []gateway.ProviderConfig{{
ProviderName: llm.ProviderNameOpenAI,
ApiKeys: []*gateway.APIKeyConfig{
{
APIKey: "sk-openai-key-1",
Weight: 70, // This key will be used ~70% of the time
},
{
APIKey: "sk-openai-key-2",
Weight: 30, // This key will be used ~30% of the time
},
},
}}
// Create the HasteKit client
HasteKit, err := hastekit.New(&hastekit.ClientOptions{
ProviderConfigs: providerConfigs,
})
if err != nil {
log.Fatalf("failed to create HasteKit client: %v", err)
}
}