AgentsModel and provider

Model and provider

Configure provider, model, API key, and runtime behavior for Runiq agents.

Runiq agents use a provider/model string.

Text
model: "openai/gpt-5"

The provider part selects a supported provider strategy. The model part is passed to that provider client.

Supported provider names

The current implementation validates provider names against these defaults:

ProviderDefault URLRequires API key with default URL
openaihttps://api.openai.com/v1Yes
ollamahttp://localhost:11434No
groqhttps://api.groq.com/openai/v1Yes
mistralhttps://api.mistral.ai/v1Yes
deepseekhttps://api.deepseek.comYes
openrouterhttps://openrouter.ai/api/v1Yes
togetherhttps://api.together.xyz/v1Yes
fireworkshttps://api.fireworks.ai/inference/v1Yes
nvidiahttps://integrate.api.nvidia.com/v1Yes
azure-openaiNo built-in default URLYes

The model name is not a closed enum in the Agent constructor. It is the string after the first slash and is sent to the selected provider.

Examples

C#
new Agent(
    id: "weather-agent",
    name: "Weather Agent",
    instructions: "Answer weather-aware planning questions.",
    model: "openai/gpt-5",
    apiKey: builder.Configuration["OpenAI:ApiKey"]);
C#
new Agent(
    id: "local-agent",
    name: "Local Agent",
    instructions: "Answer using a local model.",
    model: "ollama/llama3.2");

Custom provider options

An agent can receive ProviderOptions for provider-specific runtime settings.

C#
using Runiq.Agents;
using Runiq.Agents.Configuration;

new Agent(
    id: "custom-openai-compatible-agent",
    name: "Custom OpenAI Compatible Agent",
    instructions: "Answer concise application support questions.",
    model: "openai/gpt-5",
    apiKey: builder.Configuration["OpenAI:ApiKey"],
    provider: new ProviderOptions
    {
        Url = "https://api.openai.com/v1",
        Timeout = TimeSpan.FromSeconds(60)
    });

ProviderOptions.Url overrides the provider's default URL. ProviderOptions.Timeout is present in the options model, but timeout behavior depends on the provider client implementation.

API key behavior

The apiKey constructor parameter is optional at the type level.

At runtime, provider requirements still apply. If an agent uses a provider default endpoint that requires a key and apiKey is missing, execution fails with ApiKeyMissing.

OpenAI with the default endpoint needs a valid key:

Text
apiKey: builder.Configuration["OpenAI:ApiKey"]

Ollama is currently configured as a local provider that does not require an API key:

Text
model: "ollama/llama3.2"

Reasoning effort and verbosity

The Agent constructor supports two runtime behavior values:

C#
new Agent(
    id: "analysis-agent",
    name: "Analysis Agent",
    instructions: "Analyze the request and return a concise answer.",
    model: "openai/gpt-5",
    apiKey: builder.Configuration["OpenAI:ApiKey"],
    reasoningEffort: "minimal",
    verbosity: "low");

reasoningEffort accepts:

Text
minimal
low
medium
high

verbosity accepts:

Text
low
medium
high

The constructor defaults are reasoningEffort: "minimal" and verbosity: "low".

For dashboard and playground testing, those defaults are usually a good starting point because they keep responses fast and focused. Increase them only when the agent needs deeper analysis or more detailed output.

On this page