package main
import (
"bytes"
"fmt"
"net/http"
"os"
)
func main() {
apiKey := os.Getenv("LLMGRID_API_KEY")
body := []byte(`{
"model":"gpt-4.1",
"messages":[{"role":"user","content":"Hello from Go via LLMGrid"}]
}`)
req, _ := http.NewRequest("POST", "https://api.llmgrid.ai/v1/chat/completions", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer "+apiKey)
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil { panic(err) }
defer resp.Body.Close()
buf := new(bytes.Buffer)
buf.ReadFrom(resp.Body)
fmt.Println(buf.String())
}