SDK — Providers
The rivano.providers resource manages the LLM backends that the gateway routes traffic to. You can configure multiple providers, test connectivity, and control failover behavior.
List providers
import Rivano from '@rivano/sdk';
const rivano = new Rivano({ apiKey: 'rv_...' });
const { data } = await rivano.providers.list();
for (const provider of data) {
console.log(`${provider.name} [${provider.isPrimary ? 'primary' : ''}${provider.isFallback ? 'fallback' : ''}]`);
} Create a provider
import Rivano from '@rivano/sdk';
const rivano = new Rivano({ apiKey: 'rv_...' });
const provider = await rivano.providers.create({
name: 'openai-primary',
apiKey: 'sk-...',
isPrimary: true,
isFallback: false,
timeoutMs: 30000,
});
console.log('Provider created:', provider.id); Create parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Provider identifier, used in gateway routing |
apiKey | string | Yes | API key for this provider |
baseUrl | string | No | Override the provider’s base URL (useful for Azure, Ollama) |
isPrimary | boolean | No | Receive traffic when no provider hint is given |
isFallback | boolean | No | Receive traffic when the primary provider fails |
timeoutMs | number | No | Per-request timeout in milliseconds (default: 30000) |
💡
Mark one provider as isPrimary: true and another as isFallback: true to get automatic failover with no application code changes.
Test a provider
providers.test() verifies connectivity and returns the list of models the provider exposes:
import Rivano from '@rivano/sdk';
const rivano = new Rivano({ apiKey: 'rv_...' });
const result = await rivano.providers.test('provider_abc123');
if (result.success) {
console.log('Connected. Available models:');
for (const model of result.models ?? []) {
console.log(' ', model);
}
} else {
console.error('Provider test failed');
} Delete a provider
import Rivano from '@rivano/sdk';
const rivano = new Rivano({ apiKey: 'rv_...' });
await rivano.providers.delete('provider_abc123');
Supported providers
| Provider | Name key | Notes |
|---|---|---|
| OpenAI | openai | GPT-4o, GPT-4-turbo, o1, o3 |
| Anthropic | anthropic | Claude 3.x, Claude 4.x |
google | Gemini 1.5 Pro, Flash, Ultra | |
| Azure OpenAI | azure | Requires baseUrl with your deployment URL |
| Amazon Bedrock | bedrock | Requires AWS credentials via baseUrl |
| Mistral | mistral | Mistral Large, Small |
| Cohere | cohere | Command R, Command R+ |
| Ollama | ollama | Local models — set baseUrl to your Ollama instance |
Error handling
| Error | When it occurs |
|---|---|
SdkAuthError | Invalid Rivano API key |
SdkForbiddenError | Insufficient permissions |
SdkNotFoundError | Provider ID does not exist |
SdkError | Invalid provider config or duplicate name |
Related
- Gateway Providers — Configure providers in rivano.yaml
- Core Concepts — Providers — Provider routing logic
- Gateway Configuration — Full gateway config reference