Configure provider credentials
Supply upstream authentication separately from the Nirmos API key.
Your Nirmos API key authenticates application requests to Nirmos. Provider credentials authenticate Nirmos to an upstream service. Keep both secret types on trusted servers.
Dashboard setup
In Gateway credentials, select Add credential, choose the provider, and supply its required fields. Configure the credential in the same organization as the application's Nirmos key. Connection validation does not establish quota or access to every model.
SDK administration
Credential creation needs credential:create; validation needs credential:validate. Listing needs credential:read, rotation needs credential:update, and deletion needs credential:delete.
Use a private organization client and backend resource permissions. Never use this secret-handling example in frontend code.
const secret = process.env.PROVIDER_API_KEY;
if (!secret) throw new Error("Missing PROVIDER_API_KEY");
const credential = await nirmos.providerCredentials.create({
name: "Production provider key",
providerId: "provider-id",
credentialType: "api_key",
secret,
isDefault: true,
});
if (credential.id) await nirmos.providerCredentials.validate(credential.id);Creation can return a credential DTO or command result; guard optional IDs. Listing exposes previews/validation metadata, not stored secrets. Update supports rotation through secret or secretData. The current SDK has no separate credential get method.
Provider-specific configuration includes Cloudflare's account ID requirement. Removing or rotating shared credentials affects application execution. Credential methods owns the exact fields.