Use Buffaly with OpenRouter
Use an OpenRouter API key and exact upstream model IDs through openrouter / provider_native. Upstream vendors remain models under this provider; they do not become new Buffaly provider tokens.
Install the completion module
Include Buffaly.Provider.OpenRouter through the target release's package/provisioning workflow with matching shared contracts. Its enabled manifest entry must load OpenRouterProviderCatalogSource and OpenRouterCompletionExecutor in the consuming processes. Follow the common installation and activation procedure. The separate OpenRouterCloud web module is not a replacement completion executor.
The examined provider manifest supplies chat completion only. It declares no embedding, text-to-speech, realtime speech or OAuth handler. Use each separately supported provider/capability rather than assuming OpenRouter's upstream API catalog is also Buffaly's capability catalog.
Save the working API-key field
- Obtain an OpenRouter key for the intended account.
- Use the target installation's supported credential/settings owner to save
OpenRouter Feature.ApiKey. Keep the value out of prompts, source and examples. - Load the complete database-backed
OpenRouter Featuresettings through provider administration. SetIsEnabled=trueand retainBaseUrl=https://openrouter.ai/api/v1for the normal service.
Use ApiKey for the current executor. The options contract accepts ApiKeySecretName and counts a nonempty reference toward IsConfigured, but the inspected completion executor sends options.ApiKey as its bearer credential and does not resolve that reference. A secret-name-only configuration can therefore look configured and still send no usable key. Storing a named secret alone does not configure this route.
Configure upstream model IDs and request limits
Add exact IDs, including the upstream prefix, as keys in Models. Set DefaultModelName to one entry. Each row has its own SupportedReasoningLevels and DefaultReasoningLevel; configure only what that upstream model supports. Optional per-model DisplayName and MaxOutputTokens control presentation and output budget.
This non-secret fragment shows the shape for a model without reasoning controls. Replace the placeholder with an actual supported upstream ID and merge into the complete existing settings. Save the API key separately.
{
"IsEnabled": true,
"BaseUrl": "https://openrouter.ai/api/v1",
"HttpReferer": "https://your-application.example",
"AppTitle": "Your application",
"DefaultModelName": "<upstream/exact-model-id>",
"Models": {
"<upstream/exact-model-id>": {
"SupportedReasoningLevels": [],
"DefaultReasoningLevel": ""
}
},
"MaxTokens": 32768,
"RequestTimeoutSeconds": 300
}HttpReferer and AppTitle supply application attribution headers; they are not credentials. The executor appends /chat/completions to BaseUrl, which already includes /api/v1. An empty Models dictionary exposes no usable model. Use modern per-model settings rather than legacy top-level lists, and preserve unrelated settings when saving.
Select the exact OpenRouter model
Reload the full provider catalog and inspect Providers and Error. Find enabled openrouter / provider_native, the exact upstream model ID and its advertised effort/default. Select it in a test session and read the tuple back. Use empty reasoning when the row has no controls. The model-management guide gives the authenticated external selection contract.
The saved model list is not a live inventory of everything OpenRouter sells, and it does not prove the account can call each entry. Configure the intended supported models rather than copying an unbounded upstream catalog.
Verify status before spending quota
- Read component-load diagnostics, the enabled feature state and masked
ApiKeystatus without exposing the key. - Inspect the saved URL, model dictionary/default and complete catalog errors. Check the current session selection without changing it. These checks do not make an inference request.
- When an execution test is intended, select the exact model in a test session and send
Reply exactly: OPENROUTER_PROVIDER_OK. Verify normal assistant text and the selected tuple. The request can consume credits or API quota.
Common failures
- Provider missing: check completion-module loading,
IsEnabled, credentials and a nonemptyModelsdictionary. - Configured but unauthorized: verify an actual saved
ApiKey, not onlyApiKeySecretName. Then check account/key access and credits. - Model rejected: preserve the exact upstream prefix/ID and confirm access to that model. A display label is not a model key.
- Wrong endpoint: keep the API root with
/api/v1; do not add a second/chat/completionssuffix. - Reasoning or output rejected: inspect that upstream model's supported effort and output limit instead of widening every model's settings.