Skip to content

Provider Setup Overview

Provider setup has one shape:

  1. Install the provider package.
  2. Configure AgentBuilder with the provider's fluent helper.
  3. Put secrets in environment variables or an explicit secret resolver.
  4. Call BuildAsync().
  5. Run the agent with RunAsync(...).

Provider Capability Snapshot

Provider keys do not all mean the same thing. Some keys only create chat clients; some keys create multiple client families; some features such as hosted files or native realtime require a specific family slot.

Provider keyChatSTTTTSRealtimeImagesEmbeddingsHosted filesNotes
openaiyesyesyesyesyesyesyesChat and non-audio families come from HPD-Agent.Providers.OpenAI; audio families come from the OpenAI audio provider package.
azure-openaiyesnononoyesyesyesTraditional Azure OpenAI resource path; ModelName is a deployment name.
azure-aiyesnonononononoAzure AI Projects / Foundry chat path; endpoint/auth requirements differ from azure-openai.
anthropicyesnonononononoChat provider package.
google-aiyesnonononononoChat provider package.
ollamayesnonononononoLocal or server-backed chat; no API key required.
huggingfaceyesnonononononoChat provider package.
mistralyesnonononononoChat provider package.
bedrockyesnonononononoUses AWS SDK credential behavior.
onnx-runtimeyesnonononononoLocal ONNX Runtime GenAI chat provider.
elevenlabsnoyesyesnonononoRealtime Scribe is exposed through the speech-to-text family, not Clients.Realtime.

Use this table to choose the provider family slot. Then open the provider-specific page for package names, environment variables, and typed options.

Fluent setup should be the first choice in application code:

csharp
using HPD.Agent;
using HPD.Agent.Providers.Anthropic;

var agent = await new AgentBuilder()
    .WithAnthropic(model: "claude-3-5-sonnet-latest")
    .BuildAsync();

var result = await agent.RunAsync("Summarize provider setup in one sentence.");
Console.WriteLine(result.Text);

JSON or configuration setup is useful when agent definitions are stored outside code. Use Clients.Chat:

json
{
  "Clients": {
    "Chat": {
      "ProviderKey": "anthropic",
      "ModelName": "claude-3-5-sonnet-latest"
    }
  }
}

Do not use old top-level "Provider" JSON examples. They are not the current primary configuration shape.

Provider-specific knobs live on the same family config through ProviderOptionsJson. For example, audio providers use it for voice, output format, speech speed, transcript options, and realtime provider ids. In C# code, use the provider's typed config with SetProviderConfig(...) when available; in stored JSON, use ProviderOptionsJson.

Fluent Helpers And Family Config

Most application code should use provider builder extensions because they keep setup short and strongly typed:

csharp
using HPD.Agent;
using HPD.Agent.Providers.Audio.OpenAI;

var agent = await new AgentBuilder()
    .WithOpenAITextToSpeech(model: "tts-1", voice: "nova")
    .BuildAsync();

Those helpers do not create a different system. They populate the same Clients.* family config that JSON uses:

Setup styleBest forTradeoff
Fluent builder extensionNormal C# apps, samples, tests, local setup.Requires referencing the provider package in code.
Clients.* JSON/configStored agent definitions, FFI, generated configs, control planes.More verbose; provider options are encoded in ProviderOptionsJson.
Manual ClientProviderConfig + SetProviderConfig(...)Advanced C# composition or dynamic family wiring.More ceremony, but exact control over the family slot.

For audio, provider setup and runtime behavior are separate. .WithOpenAITextToSpeech(...) chooses a TTS provider; WithAudioRuntimeAttachment(...) or WithAudio() decides when assistant text is synthesized, where artifacts go, and whether playback/projection is enabled.

Provider Keys

Use these current chat provider keys:

ProviderKeyPrimary setup page
OpenAIopenaiOpenAI And Azure OpenAI
Azure OpenAIazure-openaiOpenAI And Azure OpenAI
AnthropicanthropicAnthropic
Google AIgoogle-aiGoogle AI
OllamaollamaOllama
Hugging FacehuggingfaceHugging Face
MistralmistralMistral
Amazon BedrockbedrockAmazon Bedrock
ONNX Runtimeonnx-runtimeONNX Runtime
OpenAI audioopenaiOpenAI Audio
ElevenLabs audioelevenlabsElevenLabs Audio

Azure AI Foundry, OpenRouter, and Azure AI Inference legacy are outside the primary setup path. Azure AI Foundry needs endpoint/auth validation before it gets a beginner setup page. OpenRouter currently has a provider implementation but no package-level fluent AgentBuilder helper. Azure AI Inference is obsolete and should be treated as legacy-only.

Agent Definition Style

HPD separates provider selection from agent definition.

Use AgentBuilder when the app owns the agent definition in code. Use stored agent definitions when a hosted app needs to create, update, list, or select agent configs at runtime. Use an IAgentFactory override when construction depends on application services or policy that should not be stored as JSON.

This is different from frameworks where each provider produces a different agent subclass. In HPD, provider packages create family-specific clients; the Agent runtime still owns sessions, branches, middleware, events, tools, and hosting behavior.

Setup Caveats

Providers validate required fields such as model, API key, endpoint, region, and option ranges. Secret resolution can use environment variables or configuration during build/client creation.

Setup pathBehavior
OpenAI, Azure OpenAI, Anthropic, Google AI, Hugging Face, MistralEnv-backed fluent setup works when the documented environment variable is present. OpenAI and Anthropic also support env-backed Clients.Chat JSON setup. Missing credentials fail at BuildAsync() before live provider calls.
BedrockRegion env is accepted; credentials normally flow through the AWS SDK default credential chain.
OllamaEndpoint env aliases apply to fluent .WithOllama(...); JSON/config setup should include Endpoint when not using localhost.
ONNX RuntimeLocal model paths are required for live inference. Compatible ONNX Runtime GenAI instruct models can opt into structured tool calling.

See Providers, Clients, And Secrets, Provider Families, and Provider Keys And Environment Variables.

Built for production .NET agent applications.