You're mixing up multiple ways of sending data:
You'll need to check with the API documentation to see how you are supposed to be passing the data. At a guess, it should look something like this:
using (var client = new HttpClient())
{
response = await client.PostAsJsonAsync(BaseUrl, new
{
username,
password,
api_key = apikey,
from,
to,
text,
type = "text"
});
}