🦫
Go
SDKThe openai-go package is the official Go client for the OpenAI API and is fully compatible with Qubax. Configure the client with a custom base URL and your API key, then make requests as normal.
Official docsInstall
Shell
go get github.com/openai/openai-goQuickstart
go
package main
import (
"context"
"fmt"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithBaseURL("https://api.qubax.ai/v1"),
option.WithAPIKey("YOUR_API_KEY"),
)
chat, err := client.Chat.Completions.New(context.TODO(), openai.ChatCompletionNewParams{
Model: openai.F("gpt-5"),
Messages: openai.F([]openai.ChatCompletionMessageParamUnion{
openai.SystemMessage("You are a helpful assistant."),
openai.UserMessage("Explain quantum entanglement in one sentence."),
}),
})
if err != nil {
panic(err)
}
fmt.Println(chat.Choices[0].Message.Content)
}Setup steps
- 1
Install the package
Run go get github.com/openai/openai-go to add the SDK to your module.
- 2
Configure the client
Create a client with option.WithBaseURL("https://api.qubax.ai/v1") and option.WithAPIKey set to your Qubax key.
- 3
Make a request
Call client.Chat.Completions.New() with a context, model (gpt-5), and messages. Streaming and tool calls are supported.
Test your connection
Paste your Qubax API key and send a live request to verify everything is wired up. Don't have a key yet?
Create one in the dashboard