> ## 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.

> ## Agent Instructions
> The Venice API is OpenAI-compatible: use any OpenAI SDK with the base URL `https://api.venice.ai/api/v1` and a Venice API key, or pay per request from a USDC wallet through x402 with no account.
> Read model IDs from `GET /models` or `GET /models/traits` at runtime instead of hardcoding them from memory or from these pages. Models are added and retired often.
> Every model's price is in https://docs.venice.ai/pricing.md. Quote video and audio jobs with `POST /video/quote` or `POST /audio/quote` before you queue them.
> Search these docs from an MCP client at https://docs.venice.ai/mcp. The full agent guide is https://docs.venice.ai/agents.md.

# VVV & DIEM

> Fund Venice API inference with staked DIEM tokens, worth $1 of compute per day each, minted by staking VVV on Base with a daily allowance.

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 credit — without buying prepaid USD credits for every request.

| Token | Role |
| - | - |
| **[VVV](https://venice.ai/lp/vvv?utm_source=venice-api-documentation)** | 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](https://venice.ai/lp/diem?utm_source=venice-api-documentation)** | Tokenized compute unit. Stake DIEM to unlock a perpetual daily Venice 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.

> [!NOTE]
>
> For model rates billed against that allowance, see the [models page](https://docs.venice.ai/models/overview.md). For wallet pay-per-request without an API key, see [x402](https://docs.venice.ai/guides/integrations/x402-venice-api.md).

## How funding works

API keys spend from the linked Venice account in this order: **DIEM**, then earned credits, then bundled credits, then USD. Each balance is worth one dollar per unit.

When DIEM is the active currency:

* Your daily allocation equals the amount of DIEM you have staked (1 staked DIEM → \$1 of Venice 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?utm_source=venice-api-documentation), or via the [Billing Balance](https://docs.venice.ai/api-reference/endpoint/billing/balance.md) endpoint (Admin key).

## Get DIEM and stake it

Use the token dashboard at [venice.ai/token](https://venice.ai/token?utm_source=venice-api-documentation). The dashboard lives in the Venice app and requires a Venice account with a connected Base wallet — do not send tokens directly to a contract address.

**1. 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) |

**2. Stake VVV (if minting DIEM)**

On [venice.ai/token](https://venice.ai/token?utm_source=venice-api-documentation), stake VVV to receive sVVV. Staked VVV earns emissions. The staking contract is [`0x321b7ff75154472B18EDb199033fF4D116F340Ff`](https://basescan.org/address/0x321b7ff75154472B18EDb199033fF4D116F340Ff#code).

**3. 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.

**4. Stake DIEM for Venice credit**

Stake DIEM on the same token dashboard. Each staked DIEM grants **\$1 per day** of Venice 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.

**5. 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?utm_source=venice-api-documentation) or the [API key guide](https://docs.venice.ai/guides/getting-started/generating-api-key.md).

Autonomous agents can mint a key from a wallet that holds staked VVV — see [Autonomous Agent API Key Creation](https://docs.venice.ai/guides/integrations/generating-api-key-agent.md).

> [!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?utm_source=venice-api-documentation) or a known staking transaction flow.

## 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-1-2",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
```

### Check DIEM balance

The [Billing Balance](https://docs.venice.ai/api-reference/endpoint/billing/balance.md) endpoint requires an Admin API key. An Inference key receives `401`.

```bash theme={"system"}
curl https://api.venice.ai/api/v1/billing/balance \
  -H "Authorization: Bearer $VENICE_ADMIN_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, in spend order: `DIEM`, then `EARNED_CREDITS`, then `BUNDLED_CREDITS`, then `USD`. Legacy responses may still report `VCU` |
| `canConsume` | Whether the account can pay for a request right now |

With any API key, including an Inference key, [`GET /api_keys/rate_limits`](https://docs.venice.ai/api-reference/endpoint/api_keys/rate_limits) also returns the key's `USD`, `DIEM`, and `BUNDLED_CREDITS` balances under `data.balances`, along with its rate limits.

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 History](https://docs.venice.ai/api-reference/endpoint/billing/usage-history.md) and [Usage Analytics](https://docs.venice.ai/api-reference/endpoint/billing/usage-analytics.md).

### 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`](https://docs.venice.ai/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` |

If a request would exceed remaining DIEM and no earned credits, bundled credits, or USD 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?utm_source=venice-api-documentation).

## Related resources

> [card] [Model prices](https://docs.venice.ai/models/overview.md)
>
> Per-model rates charged against DIEM or USD.

> [card] [Token dashboard](https://venice.ai/token?utm_source=venice-api-documentation)
>
> Stake VVV, mint DIEM, and stake DIEM for Venice credit. Requires a Venice account with a connected Base wallet.

> [card] [Autonomous Agent API Key](https://docs.venice.ai/guides/integrations/generating-api-key-agent.md)
>
> Mint an API key from a wallet with staked VVV on Base.

> [card] [x402 Wallet Auth](https://docs.venice.ai/guides/integrations/x402-venice-api.md)
>
> Pay per request with USDC when you do not want a long-lived API key.

> [card] [Billing Balance](https://docs.venice.ai/api-reference/endpoint/billing/balance.md)
>
> Read DIEM and USD balances from the API.

> [card] [VVV & DIEM overview](https://venice.ai/lp/vvv?utm_source=venice-api-documentation)
>
> Public overview of Venice's token model and how DIEM becomes inference.


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