Set up your class like my class and give example of how to use your class.

'Your class'
using System;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace AudioGenerationClient
{
    class Program
    {
        static async Task Main(string[] args)
        {
            var request = new AudioGenerationRequest
            {
                model_choice = "Zyphra/Zonos-v0.1-transformer",
                text = "Hello! This is a test audio generation.",
                language = "en-us",
                speaker_audio = null, // Specify the path if needed
                prefix_audio = "assets/silence_100ms.wav", // Specify the path if needed
                emotions = new float[] { 1.0f, 0.05f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f },
                vq_single = 0.78f,
                fmax = 24000f,
                pitch_std = 45f,
                speaking_rate = 15f,
                dnsmos_ovrl = 4f,
                speaker_noised = false,
                cfg_scale = 2f,
                min_p = 0.15f,
                seed = 420,
                randomize_seed = true,
                unconditional_keys = new string[] { "emotion" }
            };

            var audioFilePath = await GenerateAudio(request);
            Console.WriteLine($"Generated audio file path: {audioFilePath}");
        }

        public static async Task<string> GenerateAudio(AudioGenerationRequest request)
        {
            using (var httpClient = new HttpClient())
            {
                // Update this base URI to match that of your Python server
                httpClient.BaseAddress = new Uri("http://localhost:8000");
                var jsonRequest = JsonConvert.SerializeObject(request);
                var content = new StringContent(jsonRequest, Encoding.UTF8, "application/json");

                var response = await httpClient.PostAsync("/generate-audio/", content);
                if (response.IsSuccessStatusCode)
                {
                    var jsonResponse = await response.Content.ReadAsStringAsync();
                    dynamic result = JsonConvert.DeserializeObject(jsonResponse);
                    return result.audio_filepath;
                }
                else
                {
                    throw new Exception("Audio generation failed: " + response.StatusCode);
                }
            }
        }
    }

    public class AudioGenerationRequest
    {
        public string model_choice { get; set; }
        public string text { get; set; }
        public string language { get; set; }
        public string speaker_audio { get; set; }
        public string prefix_audio { get; set; }
        public float[] emotions { get; set; }
        public float vq_single { get; set; }
        public float fmax { get; set; }
        public float pitch_std { get; set; }
        public float speaking_rate { get; set; }
        public float dnsmos_ovrl { get; set; }
        public bool speaker_noised { get; set; }
        public float cfg_scale { get; set; }
        public float min_p { get; set; }
        public int seed { get; set; }
        public bool randomize_seed { get; set; }
        public string[] unconditional_keys { get; set; }
    }
}

'My Class'
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

public class LocosTTS
{
    private readonly string url;

    public LocosTTS(string url)
    {
        this.url = url;
    }

    public async Task<(bool success, string message)> GenerateAudio(
        string modelChoice,
        string text,
        string language,
        List<float> emotions,
        float vqSingle,
        float fmax,
        float pitchStd,
        float speakingRate,
        float dnsmosOvrl,
        bool speakerNoised,
        float cfgScale,
        float minP,
        int seed = 0,
        bool randomizeSeed = false,
        List<string> unconditionalKeys = null,
        byte[] speakerAudio = null,
        byte[] prefixAudio = null)
    {
        using (var client = new HttpClient())
        {
            var formContent = new MultipartFormDataContent();

            // Adding audio file parts
            if (speakerAudio != null)
            {
                var speakerContent = new ByteArrayContent(speakerAudio);
                speakerContent.Headers.ContentType = MediaTypeHeaderValue.Parse("audio/wav");
                formContent.Add(speakerContent, "speaker_audio", "speaker_audio.wav");
            }

            if (prefixAudio != null)
            {
                var prefixContent = new ByteArrayContent(prefixAudio);
                prefixContent.Headers.ContentType = MediaTypeHeaderValue.Parse("audio/wav");
                formContent.Add(prefixContent, "prefix_audio", "prefix_audio.wav");
            }

            // Adding other params as JSON
            var jsonBody = new
            {
                model_choice = modelChoice,
                text,
                language,
                emotions,
                vq_single = vqSingle,
                fmax,
                pitch_std = pitchStd,
                speaking_rate = speakingRate,
                dnsmos_ovrl = dnsmosOvrl,
                speaker_noised = speakerNoised,
                cfg_scale = cfgScale,
                min_p = minP,
                seed,
                randomizeSeed,
                unconditional_keys = unconditionalKeys
            };

            var jsonString = JsonConvert.SerializeObject(jsonBody);
            var jsonContent = new StringContent(jsonString, Encoding.UTF8, "application/json");
            formContent.Add(jsonContent, "data");

            // Send the request
            var response = await client.PostAsync(url, formContent);

            if (response.IsSuccessStatusCode)
            {
                var responseData = await response.Content.ReadAsStringAsync();
                return (true, responseData);
            }
            else
            {
                var errorMessage = await response.Content.ReadAsStringAsync();
                MessageBox.Show($"Error: {errorMessage}");
                return (false, errorMessage);
            }
        }
    }
}

my class is not as functional as your class but just notice how my class is setup and my class is used like this:

'My Class use example'
public async Task GimmieLocoz(string xmessage)
{
    string sentence = xmessage;

    // Add a period if the sentence doesn't end with ?, ., or !
    if (!sentence.EndsWith("?") && !sentence.EndsWith(".") && !sentence.EndsWith("!"))
    {
        sentence += ".";
    }

    // Load the reference voice audio file
    byte[] referenceVoiceBytes = File.ReadAllBytes(RefAudioFile); // Replace with actual path

    // Prepare input data
    var emotions = new List<float> { 0.5f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f };

    var client = new LocosTTS("http://localhost:8000/generate-audio");

    // Generate a random seed if needed, you can also make this part optional as per your design
    int seed = GenerateRandomSeed();
    bool randomizeSeed = true; // Set this according to your logic

    var (success, audioFileResponse) = await client.GenerateAudio(
        modelChoice: "Zyphra/Zonos-v0.1-transformer",
        text: sentence,
        language: "en-us",
        emotions: emotions,
        vqSingle: 0.78f,
        fmax: 24000f,
        pitchStd: 45f,
        speakingRate: 15f,
        dnsmosOvrl: 4f,
        speakerNoised: false,
        cfgScale: 2f,
        minP: 0.15f,
        seed: seed,
        randomizeSeed: randomizeSeed, // Make sure to use the variable defined
        unconditionalKeys: new List<string> { "emotion" },
        speakerAudio: referenceVoiceBytes
    );

    if (success)
    {
        duration = GetWaveFileDuration(audioFileResponse);
        audioFilePath = audioFileResponse;
        PlayAudio(ISim, duration, false);
    }
    else
    {
        Console.WriteLine($"Failed to generate audio: {audioFileResponse}");
    }
}