← API Reference

Language Guide · C# / .NET

Manage AI Prompts in C# / .NET

No SDK required. One HTTP call.

Fetch versioned, variable-interpolated AI prompts from C# using the built-in HttpClient. Works with ASP.NET Core, Blazor, MAUI, Azure Functions, and any .NET application.

Code Example

One function. Any AI provider.

Fetch a versioned, interpolated prompt from PromptForge with a single HTTP call. The returned content string passes directly to your AI SDK — no transformation, no adapter, no extra library.

  1. 1Fetch a versioned prompt by ID with your variable values.
  2. 2Receive the fully rendered content string in the response.
  3. 3Pass it directly to your AI provider SDK as the system prompt.
promptforge.cs
C# / .NET
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text.Json;

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY");

var url = "https://www.promptforge-app.com/api/v1/prompts/YOUR_PROMPT_ID"
        + "?_version=latest&role=developer&task=review+code";

var json    = await client.GetStringAsync(url);
var doc     = JsonDocument.Parse(json);
var content = doc.RootElement.GetProperty("content").GetString();

// Pass content to any AI SDK
// var result = await openAiClient.GetChatMessageContentsAsync(
//     content, executionSettings, kernel);

Why C# / .NET teams choose PromptForge

Designed for developers who want control without complexity.

HttpClient is already in the BCL

No NuGet packages needed. System.Net.Http and System.Text.Json ship with every .NET runtime from 4.5 onward.

Azure-native workflow

Store the API key in Azure Key Vault, inject via IConfiguration, and call PromptForge from your middleware pipeline or background service.

Async all the way down

GetStringAsync() integrates naturally into async controller actions, Blazor event handlers, and hosted service loops without blocking thread pool threads.

Integrate in 4 steps

From zero to fetching your first versioned prompt in under 10 minutes. No framework setup, no SDK installation — just HTTP.

  1. 1

    Create a prompt with variables

    Open the dashboard, click New Prompt, and write your system prompt using {{variable}} placeholders for any dynamic values.

  2. 2

    Copy your prompt ID

    Your prompt ID appears in the URL bar when editing: /dashboard/prompts/YOUR_PROMPT_ID. The API Usage panel also shows it with pre-filled examples.

  3. 3

    Generate an API key

    Go to the API settings page and click Generate Key. Add it to appsettings.json, User Secrets, or Azure Key Vault and read it via IConfiguration.

  4. 4

    Fetch with HttpClient

    Set the Authorization header on a shared HttpClient instance, await GetStringAsync(), and parse the JSON with JsonDocument. Pass the content string to Semantic Kernel, Azure OpenAI, or any other SDK.

Teams building AI features in C# / .NET

.NET enterprise teams use PromptForge to give business stakeholders a safe interface for editing AI prompts without touching C# source. Azure DevOps pipelines stay unchanged — the prompt update is a dashboard action, not a code commit.

Start Free Trial
No SDK
required
1 call
to fetch any prompt
Instant
prompt updates
Any AI
provider supported

Start for free, upgrade anytime

No credit card required to get started. Paid plans include a 14-day free trial.

HobbyNo credit card
  • 1k API requests/month
  • 1 prompt
  • Unlimited versions
  • Dynamic variables
  • Version pinning
  • API key management
Start Managing My Prompts
Starter
14-day free trial
$9/month

No charge until your trial ends

  • 10k API requests/month
  • 5 prompt
  • Unlimited versions
  • Dynamic variables
  • Version pinning
  • API key management
Start 14-day Free Trial
Most Popular
Pro
14-day free trial
$29/month

No charge until your trial ends

  • 100k API requests/month
  • 25 prompt
  • Unlimited versions
  • Dynamic variables
  • Version pinning
  • API key management
Start 14-day Free Trial
Business
14-day free trial
$49/month

No charge until your trial ends

  • 500k API requests/month
  • 100 prompt
  • Unlimited versions
  • Dynamic variables
  • Version pinning
  • API key management
Start 14-day Free Trial

Questions? Contact us