package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
requestBody := map[string]any{
"model": "gpt-5-mini",
"input": "你好",
}
jsonData, err := json.Marshal(requestBody)
if err != nil {
panic(err)
}
client := &http.Client{}
req, err := http.NewRequest("POST", "https://geekai.co/api/v1/responses", bytes.NewBuffer(jsonData))
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer $GEEKAI_API_KEY")
req.Header.Set("Content-Type", "application/json")
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
panic(err)
}
fmt.Println(string(body))
}