# Connections

The Connections page is your central hub for managing how data flows into Revenium. There are two types of connections, each serving a different purpose:

* **Provider Connections**: Link your AI provider accounts to see all costs in one place
* **SDK Integrations**: Embed Revenium in your code for real-time visibility and deep attribution

Most organizations benefit from both—provider connections for the big picture, SDK integrations for actionable insights.

***

## Two Ways to Connect

### Provider Connections: Consolidated Cost Visibility

When you connect your AI provider accounts (OpenAI, Anthropic, AWS Bedrock, Google, etc.), Revenium pulls your usage and cost data directly from each provider.

**The problem this solves:**

Without Revenium, tracking AI costs means logging into multiple provider dashboards—OpenAI's billing page, AWS Cost Explorer, Anthropic's usage console, Google Cloud billing. Each has different formats, different refresh rates, and different levels of detail.

**What you get:**

* **Single view of total AI spend** across all providers
* **Consolidated cost tracking** without switching between dashboards
* **Provider-level trends** to see which providers are driving costs

**Limitations:**

Provider connections show you *what* you spent, but not *where* or *why*. You'll see that you spent $10,000 on OpenAI last month, but not which product, customer, or workflow drove that cost—or whether those API calls accomplished anything useful.

### SDK Integrations: Real-Time Attribution & Control

When you integrate Revenium's SDK or API into your code, every AI call is metered as it happens—with full context about what triggered it.

**The problem this solves:**

Knowing your total AI spend isn't enough. You need to know *which customers* are driving costs, *which agents* are efficient vs. wasteful, and *which workflows* deliver ROI. You also need to catch runaway costs before they become a billing surprise.

**What you get:**

* **Real-time cost visibility** as transactions execute—not when the bill arrives
* **Deep attribution** to products, customers, subscribers, agents, and internal business units
* **Immediate alerting** the moment a cost threshold is exceeded
* **Per-transaction context** including traces, prompts, and metadata

**Example:**

You set an alert for "notify me when average cost per transaction exceeds $1.25." With provider connections alone, you'd discover this problem on your next monthly bill—after 10,000 expensive transactions have already executed. With SDK integration, Revenium alerts you the *first time* it happens, giving you the chance to investigate and fix the issue before costs spiral.

***

## Choosing Your Integration Approach

| Need                                    | Provider Connection | SDK Integration |
| --------------------------------------- | ------------------- | --------------- |
| See total spend across all AI providers | ✓                   | ✓               |
| Single dashboard for all provider costs | ✓                   | ✓               |
| Real-time cost visibility               |                     | ✓               |
| Attribution by customer/product/agent   |                     | ✓               |
| Cost alerts that trigger immediately    |                     | ✓               |
| Trace-level transaction analysis        |                     | ✓               |
| Prompt capture for debugging            |                     | ✓               |
| No code changes required                | ✓                   |                 |

{% hint style="info" %}
**Recommendation**: Start with provider connections for immediate visibility into your total AI spend. Add SDK integration to your highest-value or highest-cost workflows to unlock attribution and real-time controls.
{% endhint %}

***

## Provider Connections

Connect your AI provider accounts to pull cost and usage data automatically.

### Supported Providers

* OpenAI
* Anthropic
* AWS Bedrock
* Google (Vertex AI, Gemini)
* Azure OpenAI
* And more

### Configuring a Provider Connection

1. Navigate to **Connections** in the sidebar
2. Find the provider card you want to connect
3. Click to configure and enter your credentials

**AWS Bedrock:**

* Region
* Access Key ID
* Secret Access Key

**LiteLLM:**

* API Base URL
* API Key

**PiAPI:**

* API Key
* Environment

{% hint style="info" %}
Provider credentials are encrypted at rest and are only used to retrieve your usage data. Revenium never makes API calls on your behalf.
{% endhint %}

### Connection Status

| Status           | Description                               |
| ---------------- | ----------------------------------------- |
| **Connected**    | Integration is active and syncing data    |
| **Pending**      | Configuration saved, awaiting first sync  |
| **Disconnected** | No recent activity or configuration issue |

***

## SDK Integrations

Integrate Revenium into your code for real-time metering with full attribution.

### API Credentials

Your Revenium API key authenticates SDK calls. View and manage your keys in the Connections page.

| Field         | Description                                  |
| ------------- | -------------------------------------------- |
| **Name**      | A friendly name for the credential           |
| **Key**       | Your API key (partially masked for security) |
| **Created**   | When the credential was created              |
| **Last Used** | Most recent activity for this credential     |

### Managing Credentials

* **Copy Key**: Click the copy icon to copy the full API key
* **Regenerate**: Generate a new key (invalidates the previous key immediately)

{% hint style="warning" %}
**Regenerating a key immediately invalidates the old key.** Update your SDK configurations before regenerating to avoid service interruption.
{% endhint %}

### Getting Started with SDK Integration

See [Integration Options for AI Metering](https://docs.revenium.io/integration-options-for-ai-metering) for setup guides and code examples.

{% hint style="info" %}
**AI agents:** Revenium docs are available in Claude Code, Cursor, Windsurf, and other MCP-compatible agents via Context7. See [For AI Agents](https://docs.revenium.io/for-ai-agents).
{% endhint %}

***

## Why Both?

Provider connections and SDK integrations complement each other:

**Provider connections** give you the complete picture of AI spend—including costs from systems where SDK integration isn't practical (legacy code, third-party tools, vendor-managed services).

**SDK integrations** give you the *actionable* picture—who's driving costs, which workflows are efficient, and real-time alerts when something goes wrong.

Together, you get both comprehensive visibility and the detailed attribution needed to optimize AI ROI.

***

## Troubleshooting

### Provider Shows "Disconnected"

1. **Verify Credentials**: Re-enter your provider API credentials
2. **Check Permissions**: Ensure your credentials have billing/usage read access
3. **Review Sync Status**: Some providers sync daily; check when the last sync occurred

### No Providers Showing

If no provider cards appear:

1. **Send Test Data**: Use the Quick Start guide to send a test metering event via SDK
2. **Check API Key**: Verify you're using the correct Revenium API key

### SDK Data Not Appearing

1. **Verify API Key**: Ensure your code uses a valid Revenium API key
2. **Check Network Access**: Confirm your application can reach Revenium's metering endpoints
3. **Review Transaction Log**: Check the AI Transaction Log for recent events and any errors
