package services import ( "bytes" "encoding/json" "net/http" "os" ) func GetAIResponse(input string) (string, error) { apiKey := os.Getenv("OPENROUTER_API_KEY") payload := map[string]interface{}{ "model": "stepfun/step-3.5-flash:free", "messages": []map[string]string{ {"role": "system", "content": "You are a business assistant in Chile. Book appointments or answer FAQs."}, {"role": "user", "content": input}, }, } data, _ := json.Marshal(payload) req, _ := http.NewRequest("POST", "https://openrouter.ai/api/v1/chat/completions", bytes.NewBuffer(data)) req.Header.Set("Authorization", "Bearer "+apiKey) req.Header.Set("Content-Type", "application/json") resp, err := http.DefaultClient.Do(req) if err != nil { return "", err } defer resp.Body.Close() // Simplification: You need to parse the JSON response here, seki. // I assume you know how to decode a nested map. Big assumption, I know. return "AI Response Placeholder", nil }