# C\#

```csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;

var token = Environment.GetEnvironmentVariable("AUTOCONTENT_TOKEN") ?? "YOUR_API_TOKEN";
var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);

var payload = new
{
    outputType = "audio",
    resources = new[]
    {
        new { type = "website", content = "https://autocontentapi.com" },
        new { type = "text", content = "74% of businesses expect AI to increase productivity" }
    },
    text = "Explain why automating with AutoContent API is a game changer for any business"
};

var request = new HttpRequestMessage(HttpMethod.Post, "https://api.autocontentapi.com/content/Create")
{
    Content = new StringContent(JsonSerializer.Serialize(payload), Encoding.UTF8, "application/json")
};

var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();

Console.WriteLine(await response.Content.ReadAsStringAsync());
```

Use the [podcast scenario examples](/code-samples/podcasts/csharp.md) for language-specific recipes.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.autocontentapi.com/code-samples/language-quickstarts/csharp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
