Credit Usage

Users add AI balance once in rNet and use it in any connected AI app.

How Credits Work

Credits belong to the user's rNet account. When the user connects your app with rNet, approved AI requests can use that same credit balance. The user does not need a separate AI plan for every app.

Shared Balance

User-Owned Credits

Clear Usage

What Happens When Credits Are Low

ScenarioBehavior
Sufficient creditsRequest proceeds normally, credits are deducted
Insufficient creditsRequest is rejected with an error response
Zero balanceAll AI requests fail until credits are added

Handling Low Balance in Your App

Your application should handle credit-related errors with simple user-facing text. If the user has no credits left, ask them to add credits to their rNet account.

javascript
app.post('/api/ai', requireRNetSession, async (req, res) => {
  try {
    const response = await ai.chat(
      req.body,
      req.session.rnet.accessToken,
      'gemini-2.5-flash-lite'
    );
    res.json(response);
  } catch (err) {
    if (err.status === 402 || err.code === 'INSUFFICIENT_CREDITS') {
      return res.status(402).json({
        error: 'Insufficient credits. Please add more credits to continue.',
        addCreditsUrl: 'https://rnetai.org/dashboard'
      });
    }
    throw err;
  }
});

Adding Credits

Users add credits through the rNet Dashboard. Once credits are added, the same balance is available to every connected app the user has approved.

Wallet Balance
The wallet balance is visible on the rNet Dashboard. Adding credits in one place makes them available across every connected app.
You've Completed the Guide!
You now understand the core rNet credit model. Explore the SDK documentation for language-specific implementation details, or check the API Reference for endpoint specifications.