Skip to content

Provider Setup Overview ​

Provider setup has one shape:

  1. Install the provider package.
  2. Let the source generator include its provider manifest in the application.
  3. For DI hosts, call AddHpdGeneratedProviders().
  4. Configure an optional default on the agent's AgentConfig or provide Clients.* per run.
  5. Put secrets in environment variables or an explicit secret resolver.
  6. Register the agent on an AgentRuntimeBuilder and run it with runtime.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.
cohereyesnonononoyesnoNet10-only chat and embeddings provider package. Streaming produces a single final update.
dashscopeyesnonononoyesnoNet10-only chat and embeddings provider package backed by the Cnblogs DashScope MEAI adapter.
cerebrasyesnonononononoChat provider package backed by Cerebras' OpenAI-compatible chat completions API.
deepseekyesnonononononoChat provider package backed by DeepSeek's OpenAI-compatible chat completions API.
deepinfrayesnonononononoChat provider package backed by the shared OpenAI-compatible chat-completions client.
fireworksyesnonononononoNet10-only chat provider package backed by the shared OpenAI-compatible chat-completions base.
sambanovayesnonononononoChat provider package backed by SambaNova's OpenAI-compatible chat completions API.
hyperbolicyesnonononononoChat provider package backed by Hyperbolic's OpenAI-compatible chat completions API.
ovhcloudyesnonononononoChat provider package backed by OVHcloud AI Endpoints' OpenAI-compatible chat completions API.
nscaleyesnonononononoChat provider package backed by Nscale's OpenAI-compatible chat completions API.
veniceyesnonononononoChat provider package backed by Venice.ai's OpenAI-compatible chat completions API.
perplexityyesnonononononoChat provider package backed by Perplexity's OpenAI-compatible Sonar API.
lmstudioyesnonononononoLocal chat provider package backed by LM Studio's OpenAI-compatible local server.
nebiusyesnonononononoChat provider package backed by Nebius Token Factory's OpenAI-compatible API.
nvidia-nimyesnonononononoChat provider package backed by NVIDIA NIM's OpenAI-compatible API.
siliconflowyesnonononononoChat provider package backed by SiliconFlow's OpenAI-compatible API.
scalewayyesnonononononoChat provider package backed by Scaleway Generative APIs' OpenAI-compatible API.
zaiyesnonononononoChat provider package backed by Z.AI's OpenAI-compatible API.
minimaxyesnonononononoChat provider package backed by MiniMax's OpenAI-compatible API.
togetheryesnonononoyesnoNet10-only chat and embeddings provider package. Supports token streaming, function tools, reasoning content, and JSON object responses.
xaiyesnonononononoChat provider package backed by the shared OpenAI-compatible chat-completions client. Images, embeddings, audio, files, batches, and deferred completions are deferred.
groqyesnonononononoNet10-only chat provider package backed by Groq's OpenAI-compatible chat completions API.
moonshotyesnonononononoNet10-only chat provider package backed by Moonshot/Kimi's OpenAI-compatible chat completions API.
replicatenonononoyesnonoNet10-only image generation provider package backed by bounded Replicate model predictions.
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 assistant = new AgentConfig()
    .WithAnthropic(model: "claude-3-5-sonnet-latest");

await using var runtime = await new AgentRuntimeBuilder()
    .AddAgent("assistant", assistant)
    .BuildAsync();

var result = await runtime.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": {
      "provider": {
        "key": "anthropic"
      },
      "modelName": "claude-3-5-sonnet-latest"
    }
  }
}

Provider-specific construction and transport options live on the same family config through ProviderConfig. For example, audio providers use provider configuration for voice, output format, speech speed, transcript options, and realtime provider ids. Chat providers use provider configuration only for controls that are native to that provider or SDK.

Provider and model selection uses AgentRunConfig.Clients.Chat.Provider.Key and ModelName. Runtime chat behavior uses ChatClientConfig: temperature, top-p, max output tokens, stop sequences, response format, tools, tool mode, seed, and generic reasoning options. Agent-level defaults belong in AgentConfig.Clients.Chat; per-run replacements belong in AgentRunConfig.Clients.Chat.

In C# code, use the provider's typed config with SetProviderConfig(...) when available. In stored JSON, use the ProviderConfig object.

Fluent Helpers And Family Config ​

Most application code should use the provider methods on AgentConfig because they keep setup short and strongly typed:

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

var assistant = new AgentConfig()
    .WithOpenAITextToSpeech(model: "tts-1", voice: "nova");

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

Setup styleBest forTradeoff
AgentConfig provider methodNormal 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 configurations are stored in ProviderConfig.
Manual ChatClientConfig + 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
Azure AIazure-aiAzure AI
AnthropicanthropicAnthropic
CoherecohereCohere
DashScopedashscopeDashScope
CerebrascerebrasCerebras
DeepSeekdeepseekDeepSeek
DeepInfradeepinfraDeepInfra
Fireworks AIfireworksFireworks AI
SambaNovasambanovaSambaNova
HyperbolichyperbolicHyperbolic
OVHcloud AI EndpointsovhcloudOVHcloud AI Endpoints
NscalenscaleNscale
Venice.aiveniceVenice.ai
PerplexityperplexityPerplexity
LM StudiolmstudioLM Studio
Nebius Token FactorynebiusNebius Token Factory
NVIDIA NIMnvidia-nimNVIDIA NIM
SiliconFlowsiliconflowSiliconFlow
Scaleway Generative APIsscalewayScaleway Generative APIs
Z.AIzaiZ.AI
MiniMaxminimaxMiniMax
Together AItogetherTogether AI
xAIxaixAI
GroqgroqGroq
MoonshotmoonshotMoonshot
ReplicatereplicateReplicate
Google AIgoogle-aiGoogle AI
OllamaollamaOllama
Hugging FacehuggingfaceHugging Face
MistralmistralMistral
Amazon BedrockbedrockAmazon Bedrock
ONNX Runtimeonnx-runtimeONNX Runtime
OpenAI audioopenaiOpenAI Audio
ElevenLabs audioelevenlabsElevenLabs Audio

OpenRouter and Azure AI Inference legacy are outside the primary setup path. OpenRouter has a provider package with an AgentConfig.WithOpenRouter(...) method but no setup page. Azure AI Inference is obsolete and should be treated as legacy-only.

Agent Definition Style ​

HPD separates provider selection from agent definition.

Use an AgentConfig registered with AgentRuntimeBuilder.AddAgent(...) 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. Both are the same AgentConfig, and both are checked against the runtime's provider composition: a definition whose clients.{Family}.provider.key names a provider the application does not reference is refused with agent_provider_unknown, and a provider that does not implement the family with agent_provider_family_unsupported (for example clients.Chat.provider.key). A code agent is checked at BuildAsync(); a stored agent when it is created or updated. runtime.Composition.Providers lists the providers the runtime can use, with their families and secret names; hosted apps read the same list from GET /composition/providers. Model lists are empty unless the runtime is built with a model catalog: AgentRuntimeBuilder.WithProviderModelCatalog(...), or WithModelsDev(catalog) from HPD-Agent.ModelsDev. The catalog is read once, at BuildAsync(); a failing catalog leaves the lists empty instead of failing the build.

When construction depends on application services or policy that should not be stored as JSON, put it in the hosted runtime's recipe: AddHPDAgentRuntime(name, runtime => ...) applies the same AgentRuntimeBuilder chain a console app uses, and services come from the runtime's service provider. Live parts such as an existing IChatClient (WithChatClient(...)) or a client wrapper are process-local parts of the AgentConfig; a definition that carries them is a code agent and cannot be stored. See The Runtime And Its Agents.

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

Setup Caveats ​

BuildAsync() validates each code agent's structure and checks that the providers it names are in the runtime's composition. Provider-specific configuration is validated and credentials are resolved when a run acquires its provider client. Secret resolution can use explicit runtime secrets, environment variables, custom resolvers, or configuration.

Setup pathBehavior
OpenAI, Azure OpenAI, Anthropic, Cohere, DashScope, Cerebras, DeepSeek, DeepInfra, Fireworks AI, SambaNova, Hyperbolic, OVHcloud AI Endpoints, Nscale, Venice.ai, Perplexity, Nebius Token Factory, NVIDIA NIM, SiliconFlow, Scaleway Generative APIs, Z.AI, MiniMax, Together AI, xAI, Groq, Moonshot, Google AI, Hugging Face, MistralEnv-backed fluent and Clients.Chat setup can use the documented aliases. Missing credentials fail when a run first acquires that provider client, not during BuildAsync().
LM StudioLocal fluent setup works without credentials when the LM Studio local server is running. Endpoint and optional API-key aliases are available for proxied or secured local setups.
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.

For per-run provider/model switching, named static credentials, serialization rules, and client-cache behavior, see Runtime Provider Selection And Authentication.

Built for production .NET agent applications.