Go quickstart — 5 lines to ship
Go developers can use the official sashabaranov/go-openai SDK against VerticalAPI by setting BaseURL and adding the provider key as a custom header. Suitable for high-throughput backends.
From zero to first call
Sign up at verticalapi.com/dashboard
Free tier — no card required. Generates your vapi_ key automatically.
Add a provider key
Paste your OpenAI sk-..., Anthropic sk-ant-..., or Google AIza... into the dashboard. Encrypted at rest.
Install the Go SDK
go get github.com/sashabaranov/go-openaiRun the example below
Drop-in OpenAI SDK pattern — base_url + api_key + provider key header. That's it.
Inspect the trace
Every call gets a unique request ID. Find it in the dashboard with full latency, tokens, and cost breakdown.
Go — first call
package main
import (
"context"
"fmt"
"net/http"
openai "github.com/sashabaranov/go-openai"
)
func main() {
cfg := openai.DefaultConfig("vapi_...")
cfg.BaseURL = "https://api.verticalapi.com/v1"
cfg.HTTPClient = &http.Client{
Transport: &headerTransport{
base: http.DefaultTransport,
providerKey: "sk-...",
},
}
client := openai.NewClientWithConfig(cfg)
resp, _ := client.CreateChatCompletion(context.Background(), openai.ChatCompletionRequest{
Model: "gpt-4o",
Messages: []openai.ChatCompletionMessage{
{Role: "user", Content: "Hello, world"},
},
})
fmt.Println(resp.Choices[0].Message.Content)
}
type headerTransport struct{ base http.RoundTripper; providerKey string }
func (h *headerTransport) RoundTrip(r *http.Request) (*http.Response, error) {
r.Header.Set("X-Provider-Key", h.providerKey)
return h.base.RoundTrip(r)
}Swap model for claude-sonnet-4-5, gemini-2.5-pro, or any of 25+ supported providers. Update X-Provider-Key to match.
Common errors and fixes
Where to go from here
Pick a model: browse all 25+ providers. Compare two: read head-to-head comparisons. Or jump to a use case: chatbot, RAG, autonomous agents.