> ## Documentation Index
> Fetch the complete documentation index at: https://coinstats.app/api-docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Credit Multipliers

> Understanding how API credit multipliers work with dynamic pricing

The CoinStats API uses a flexible credit system that can dynamically adjust costs based on the complexity and scale of your requests.

## How Credits Work

Every API endpoint has a base credit cost, but some endpoints use **multipliers** to scale costs based on the parameters you provide. This ensures fair pricing - simple requests cost less, while complex requests that require more resources cost proportionally more.

> **Fixed Credits**
>
> Simple endpoints with constant resource usage have fixed credit costs

> **Dynamic Credits**
>
> Advanced endpoints scale costs based on request complexity using multipliers

## Understanding Multipliers

Multipliers allow endpoints to calculate credits based on:

> **Query Parameters**
>
> Parameters in the URL query string (e.g., `?networks=ethereum,polygon`)

> **Request Body**
>
> Data sent in POST/PATCH request bodies, including nested objects

## How Multiplier Calculation Works

The total credit cost is calculated by applying multipliers to each parameter individually:

Total Credits = Sum of (Base Credits × Multiplier for each parameter)

**Important:** Multipliers can be applied multiple times within the same request. Example:

```json theme={null}
"body":{
  "wallets": [
    {"address":"0x123...", "connectionId": "ethereum"},
    {"address":"0x456...", "connectionId": "all"}
    ]
}
```

In this scenario, if the base credit is 4, the total credits will be calculated as follows:

* **Wallet 1**: `connectionId: "ethereum"` → 4 × 1 = **4 credits**
* **Wallet 2**: `connectionId: "all"` → 4 × 10 = **40 credits**
* **Total**: 4 + 40 = **44 credits**

Each wallet is processed independently with its own multiplier based on the `connectionId` value.

Here's a visual breakdown of how the system processes requests with multipliers:

```mermaid theme={null}
flowchart TD
    A["API Request<br/>Base Credits: 4"] --> B{Has Multipliers?}
    
    B -->|No| C[Fixed Credits<br/>Base Cost Only]
    B -->|Yes| D[Analyze Each Wallet]
    
    D --> E["Wallet 1<br/>connectionId: 'ethereum'<br/>Multiplier: 1x"]
    D --> F["Wallet 2<br/>connectionId: 'all'<br/>Multiplier: 10x"]
    
    E --> G["Calculate Cost<br/>4 × 1 = 4 credits"]
    F --> H["Calculate Cost<br/>4 × 10 = 40 credits"]
    
    G --> I["Total Credits<br/>4 + 40 = 44"]
    H --> I
    
    C --> J[Final Cost]
    I --> J
    
    J --> K{Credits Available?}
    K -->|Yes| L["✅ Request Processed"]
    K -->|No| M["❌ 429 Error<br/>Credits limit reached"]
```

### Multiplier Values

Different parameters have different multiplier effects:
The exact base cost depends on the endpoint. Replace `base` in these examples with the credit count shown in the endpoint docs.

**Query**

When you provide multiple values (comma-separated or as arrays):

```bash theme={null}
# Single network = base credits
?networks=ethereum

# Multiple networks = base credits × count
?networks=ethereum,polygon,binance_smart  # 3× multiplier
```

**'all' value**

Using `"all"` applies a predefined multiplier:

```bash theme={null}
# Using 'all' applies default multiplier (usually 10×)
?connectionIds=all  # 10× multiplier
```

> [!WARNING]
>
> **Mixed 'all' and specific values**: Combining `"all"` with other values (e.g., `connectionIds=all,ethereum,polygon`) adds extra complexity and costs. The system counts all items AND adds additional credits for the 'all' portion.

**Nested Body**

Request body arrays also scale costs:

```json theme={null}
{
  "wallets": [
    {"address": "0x123...", "connectionId": "ethereum"},
    {"address": "0x456...", "connectionId": "polygon"}
  ]
}
// 2× multiplier for 2 wallets = base × 2 credits
```

**With mixed multipliers:**

```json theme={null}
{
  "wallets": [
    {"address": "0x123...", "connectionId": "ethereum"},
    {"address": "0x456...", "connectionId": "all"}
  ]
}
// Wallet 1: base × 1 credits, Wallet 2: base × 10 credits
// Total: base × 11 credits
```

**Many 'connectionId' fields**

```json theme={null}
{
  "wallets": [
    {"address": "0x123...", "connectionId": "ethereum,polygon"}
    {"address": "0x456...", "connectionId": "all"}
  ]
}
// Wallet 1: base × 2 credits, Wallet 2: base × 10 credits
// Total: base × 12 credits
```

> [!NOTE]
>
> **Cost Difference:** Using specific networks (`ethereum,polygon`) costs **80% less** than using `"all"` (2× base vs 10× base). Always specify only the networks you actually need!

> [!NOTE]
>
> If you need all of networks/connections better use `all` instead of 10+ connectionId/network. (10× base vs 10× base+)

## Cost Optimization Tips

> **🎯 Avoid 'all' Values When Possible**
>
> The `"all"` value applies a **10× multiplier**. Be specific instead:
>
> ```bash theme={null}
> # ❌ Expensive (10× multiplier)
> ?connectionId=all
>
> # ✅ Much cheaper (1× multiplier each)
> ?connectionId=ethereum  # or specify only what you need
> ```
>
> **Savings:** Using specific values instead of `"all"` can reduce costs by 90%

> **🔄 Understand Array Multipliers**
>
> Each item in arrays gets its own multiplier. Plan your requests accordingly:
>
> ```json theme={null}
> // Example: base cost is the credit count shown on the endpoint
> {
>   "wallets": [
>     {"address": "0x123...", "connectionId": "ethereum"},  // base × 1 credits
>     {"address": "0x456...", "connectionId": "all"}        // base × 10 credits
>   ]
> }
> // Total: base × 11 credits (not base × 2 credits!)
> ```
>
> **Key insight:** Mixed multipliers within the same array can create unexpected costs.

> **⚡ Separate High-Cost Items**
>
> Consider splitting requests when mixing standard and high-multiplier values:
>
> ```json theme={null}
> # ❌ Mixed request (base × 11 credits total)
> POST /endpoint
> {
>   "wallets": [
>     {"connectionId": "ethereum", "address": "0x123..."},  // base × 1 credits
>     {"connectionId": "all", "address": "0x123..."}        // base × 10 credits
>   ]
> }
>
> # ✅ Separate requests (base × 2 credits total if you don't actually need "all")
> POST /endpoint {"wallets": [{"connectionId": "ethereum", "address": "0x123..."}]}  // base × 1 credits
> POST /endpoint {"wallets": [{"connectionId": "polygon", "address": "0x123..."}]}   // base × 1 credits
> ```

> **📊 Monitor Usage Patterns**
>
> Track your credit usage in the [CoinStats API Dashboard](https://openapi.coinstats.app) to:
>
> * Identify unexpectedly expensive requests
> * Find patterns where `"all"` multipliers are driving costs
> * Optimize requests with high multiplier combinations

## Frequently Asked Questions

> **Why do multipliers exist?**
>
> Multipliers ensure fair pricing based on actual resource consumption. Requesting data for 1 wallet requires fewer resources than requesting data for 100 wallets, so the pricing reflects this difference.

> **Can I avoid multipliers?**
>
> Yes! Use endpoints with fixed pricing when possible, or make multiple smaller requests instead of one large request with many parameters.

> **Are multipliers applied to all parameters?**
>
> No, only specific parameters on certain endpoints use multipliers. Check each endpoint's documentation for details about which parameters are multiplied.

> **What happens if I exceed my credit limit?**
>
> Your requests will be rejected with a `429 Too Many Requests` error. You can upgrade your plan or wait for your credits to reset based on your plan's terms.

> [!NOTE]
>
> **Pro Tip**: Start with smaller requests to understand costs, then optimize based on your actual usage patterns. The API dashboard provides detailed insights to help you optimize your credit usage.

> [!WARNING]
>
> **Important**: Always test with small parameter sets first to understand the credit impact before making large batch requests. Multipliers can significantly increase costs for large parameter sets.

## Support

<ul><li>**Documentation**: This site contains comprehensive API documentation</li>
<li>**Telegram Chat**: For quick help and to connect with other developers, join our [API Support Telegram group](https://t.me/+JPUMD1QAMTNmNGQy)</li>
<li>**Email Support**: You can reach us directly at [**api.support@coinstats.app**](mailto:api.support@coinstats.app) for personalized assistance.</li></ul>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.