The official Go client for SoxAI — a unified AI API gateway giving you access to 200+ AI models from 40+ providers through a single OpenAI-compatible API.
go get github.com/onedotnet/soxai-gopackage main
import (
"context"
"fmt"
"os"
"github.com/onedotnet/soxai-go"
"github.com/openai/openai-go"
)
func main() {
client := soxai.NewClient(os.Getenv("SOXAI_API_KEY"))
resp, err := client.Chat.Completions.New(context.Background(), openai.ChatCompletionNewParams{
Model: "claude-sonnet-4-6", // or gpt-4o, gemini-2.5-flash, deepseek-chat, ...
Messages: []openai.ChatCompletionMessageParamUnion{
openai.UserMessage("Hello!"),
},
})
if err != nil {
panic(err)
}
fmt.Println(resp.Choices[0].Message.Content)
}- One API key for OpenAI, Anthropic, Google, DeepSeek, Meta, and 35+ more providers
- Automatic failover — if one provider goes down, requests route to another
- Team management — per-developer API keys with spending limits
- OpenAI Go SDK compatible — returns
openai.Clientso all methods work as-is - Free $5 credit to start, no credit card required
stream := client.Chat.Completions.NewStreaming(ctx, openai.ChatCompletionNewParams{
Model: "gpt-4o-mini",
Messages: []openai.ChatCompletionMessageParamUnion{
openai.UserMessage("Write a haiku about APIs."),
},
})
defer stream.Close()
for stream.Next() {
chunk := stream.Current()
if len(chunk.Choices) > 0 {
fmt.Print(chunk.Choices[0].Delta.Content)
}
}import (
"net/http"
"time"
"github.com/openai/openai-go/option"
)
client := soxai.NewClient(
os.Getenv("SOXAI_API_KEY"),
option.WithHTTPClient(&http.Client{Timeout: 30 * time.Second}),
)- pkg.go.dev
- Website
- Documentation
- Model List
- Pricing
- Examples
- Python SDK
- Node.js SDK
- Sign Up (Free $5)
MIT