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

# VVV & DIEM

> Fund Venice API usage with staked DIEM — $1 per day of compute per token — minted from staked VVV or acquired on Base.

VVV and DIEM are Venice's on-chain funding layer for the API. Stake DIEM to receive a fixed daily inference allowance — **1 DIEM = \$1 per day** of Venice API credit — without buying prepaid USD credits for every request.

| Token    | Role                                                                                                           |
| -------- | -------------------------------------------------------------------------------------------------------------- |
| **VVV**  | Venice's foundational token on Base. Stake it to earn yield and to mint DIEM.                                  |
| **sVVV** | Receipt for staked VVV. Lock sVVV at the current [Mint Rate](https://diem-calculator.venice.ai/) to mint DIEM. |
| **DIEM** | Tokenized compute unit. Stake DIEM to unlock a perpetual daily API credit equal to \$1 per DIEM.               |

DIEM is an ERC-20 on Base. You can transfer, trade, or stake it. Unlike pay-as-you-go USD credits, staked DIEM is capacity you own: the daily allowance refreshes each epoch and does not dilute as network usage grows.

<Info>
  For model rates billed against that allowance, see [API Pricing](/overview/pricing). For wallet pay-per-request without an API key, see [x402](/guides/integrations/x402-venice-api).
</Info>

## How funding works

API keys spend from the linked Venice account in this order: **DIEM**, then bundled credits, then USD.

When DIEM is the active currency:

* Your daily allocation equals the amount of DIEM you have staked (1 staked DIEM → \$1 of API credit that epoch).
* Unused DIEM in an epoch does not roll over. The allowance refreshes at **00:00 UTC**.
* Accounts need at least **0.1** staked DIEM before any DIEM balance is spendable.
* Request costs use the same USD price sheet as pay-as-you-go; DIEM is the settlement currency at a 1:1 dollar rate for that day's allocation.

Check your current and next-epoch DIEM balance in the dashboard at [venice.ai/settings/api](https://venice.ai/settings/api), or via the [Billing Balance](/api-reference/endpoint/billing/balance) endpoint.

## Get DIEM and stake it

Use the token dashboard at [venice.ai/token](https://venice.ai/token). Connect a Base wallet — do not send tokens directly to a contract address.

<Steps>
  <Step title="Acquire VVV or DIEM">
    Buy VVV or DIEM on a Base DEX such as [Aerodrome](https://aerodrome.finance) or [Uniswap](https://app.uniswap.org), or receive DIEM transferred from another wallet.

    | Asset | Contract (Base)                                                                                                       |
    | ----- | --------------------------------------------------------------------------------------------------------------------- |
    | VVV   | [`0xacfE6019Ed1A7Dc6f7B508C02d1b04ec88cC21bf`](https://basescan.org/token/0xacfE6019Ed1A7Dc6f7B508C02d1b04ec88cC21bf) |
    | DIEM  | [`0xF4d97F2da56e8c3098f3a8D538DB630A2606a024`](https://basescan.org/token/0xF4d97F2da56e8c3098f3a8D538DB630A2606a024) |
  </Step>

  <Step title="Stake VVV (if minting DIEM)">
    On [venice.ai/token](https://venice.ai/token), stake VVV to receive sVVV. Staked VVV earns emissions. The staking contract is [`0x321b7ff75154472B18EDb199033fF4D116F340Ff`](https://basescan.org/address/0x321b7ff75154472B18EDb199033fF4D116F340Ff#code).
  </Step>

  <Step title="Mint DIEM from sVVV (optional)">
    Lock sVVV at the current Mint Rate to mint DIEM. The Mint Rate is how much sVVV is required per DIEM and rises as DIEM supply grows — preview it on the [DIEM calculator](https://diem-calculator.venice.ai/).

    Minted DIEM appears in your wallet as an ERC-20. The locked sVVV stays locked until you burn the same amount of DIEM to unlock it.
  </Step>

  <Step title="Stake DIEM for API credit">
    Stake DIEM on the same token dashboard. Each staked DIEM grants **\$1 per day** of Venice API credit for as long as it remains staked.

    Unstaking DIEM has a **1-day** cooldown. Unlocking the sVVV that backed minted DIEM requires burning that DIEM; unstaking the freed sVVV then has a **7-day** cooldown.
  </Step>

  <Step title="Create or use an API key">
    Sign in to Venice with the same wallet (Sign-In-With-Ethereum) so the staked DIEM attaches to your account, then create a key from [API settings](https://venice.ai/settings/api) or the [API key guide](/guides/getting-started/generating-api-key).

    Autonomous agents can mint a key from a wallet that holds staked VVV — see [Autonomous Agent API Key Creation](/guides/getting-started/generating-api-key-agent).
  </Step>
</Steps>

<Warning>
  Never send VVV or DIEM directly to a contract address. Tokens sent that way cannot be recovered. Always stake through [venice.ai/token](https://venice.ai/token) or a known staking transaction flow.
</Warning>

## Use DIEM with the API

Once DIEM is staked and linked to your account, call the API with a normal Bearer key. No extra headers or `venice_parameters` are required — Venice deducts from DIEM automatically when `consumptionCurrency` is `DIEM`.

```bash theme={"system"}
curl https://api.venice.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $VENICE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "venice-uncensored",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
```

### Check DIEM balance

```bash theme={"system"}
curl https://api.venice.ai/api/v1/billing/balance \
  -H "Authorization: Bearer $VENICE_API_KEY"
```

Example response shape:

```json theme={"system"}
{
  "canConsume": true,
  "consumptionCurrency": "DIEM",
  "balances": {
    "diem": 90.5,
    "usd": 25
  },
  "diemEpochAllocation": 100
}
```

| Field                 | Meaning                                                                                            |
| --------------------- | -------------------------------------------------------------------------------------------------- |
| `balances.diem`       | Remaining DIEM credit for the current epoch (`null` if you are not staking DIEM)                   |
| `diemEpochAllocation` | Total DIEM allocated for this epoch (staked amount). Compare with `balances.diem` for usage so far |
| `consumptionCurrency` | Currency that will be charged next (`DIEM`, `USD`, `BUNDLED_CREDITS`, or legacy `VCU`)             |
| `canConsume`          | Whether the account can pay for a request right now                                                |

List models or usage analytics to see per-request costs in both USD and DIEM — they match at the \$1-per-DIEM rate for the day's allowance. See [Billing Usage](/api-reference/endpoint/billing/usage) and [Usage Analytics](/api-reference/endpoint/billing/usage-analytics).

### Cap spend per key

When creating a key, you can set an epoch consumption limit denominated in `diem` or `usd` so a single integration cannot exhaust the full daily allocation. Dashboard keys expose this as **Epoch Consumption Limits**; Web3-minted keys accept `consumptionLimit` on [`POST /api_keys/generate_web3_key`](/api-reference/endpoint/api_keys/generate_web3_key/post).

## DIEM vs USD credits vs x402

| Path                     | Best for                                                | How it refreshes                                                                                        |
| ------------------------ | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| **Staked DIEM**          | Predictable daily capacity, agents, fixed AI cost       | Full allocation each epoch (00:00 UTC) while DIEM stays staked                                          |
| **USD / crypto credits** | Bursts above your DIEM allocation, simple prepaid spend | Balance decreases with usage; credits never expire                                                      |
| **x402 (USDC)**          | Headless pay-per-request with no API key                | Wallet tops up USDC via `POST /x402/top-up`; DIEM on a linked account is still spent first when present |

If a request would exceed remaining DIEM and no USD or bundled credits cover it, the API returns `402` with `INSUFFICIENT_BALANCE`. Stake more DIEM, wait for the next epoch, or add USD credits in [Settings → API](https://venice.ai/settings/api).

## Related resources

<CardGroup cols={2}>
  <Card title="API Pricing" icon="coins" href="/overview/pricing">
    Per-model rates charged against DIEM or USD.
  </Card>

  <Card title="Token dashboard" icon="chart-line" href="https://venice.ai/token">
    Stake VVV, mint DIEM, and stake DIEM for API credit.
  </Card>

  <Card title="Autonomous Agent API Key" icon="robot" href="/guides/getting-started/generating-api-key-agent">
    Mint an API key from a wallet with staked VVV on Base.
  </Card>

  <Card title="x402 Wallet Auth" icon="wallet" href="/guides/integrations/x402-venice-api">
    Pay per request with USDC when you do not want a long-lived API key.
  </Card>

  <Card title="Billing Balance" icon="wallet" href="/api-reference/endpoint/billing/balance">
    Read DIEM and USD balances from the API.
  </Card>

  <Card title="Help Center: Token" icon="book" href="https://featurebase.venice.ai/en/help/collections/2936312-token">
    Mint rate, cooldowns, yield, and other token FAQs.
  </Card>
</CardGroup>
