Spend limits, usage and audit

Guide Overview

Target audience: System administrators, and AI operators who watch the AI calls of the company.
Reading time: ~15 minutes.
Outcome: Daily spend limits are in place, you can see what AI costs, and you can open the exact messages and the HTTP record of any AI call, with keys masked.

Every call to an AI vendor is recorded. You decide how much AI may cost per person and per company each day, you read the cost per month, and you can always find what was sent to the vendor. A spend limit is checked before the first call of each step of an answer: a step already in progress finishes, and the job stops at the end of that step. The answer names the limit that was reached and who can raise it. No setting limits the number of model calls or tool calls of an answer; the daily limits are the brake, and the Stop button is always there.

Before You Start

You need

Why

The Settings access right (system administrator)

Spend limits and retention are set in AI ‣ Configuration ‣ Settings, which is reserved for system administrators.

At least one AI call

The reports are empty until a call is made. Run Test Connection on a connection (see Get started with Viindoo AI) or ask the assistant a question.

The AI Operator or API Log Viewer right, for people who only read the records

See the table in the section on who sees what below.

Set Spend Limits

  1. Go to AI ‣ Configuration ‣ Settings.

  2. Go to the Cost Control section and change a limit, for example Hard Cost Cap per User per Day (USD).

  3. Click Save. The page reloads and shows the limits as saved.

The Cost Control and Privacy and Data sections of the AI settings with their default values

Setting

What it does

Value on a fresh install

Hard Cost Cap per User per Day (USD)

Once a person has spent this much in a day, the assistant starts no new question for them and a long answer stops. It counts internal users only: website visitors, portal users and the service user of the website assistant do not count toward it.

20.00

Hard Cost Cap per Company per Day (USD)

Once the company has spent this much in a day, the assistant stops for everyone. It counts every spend of the company, live chat with visitors included.

200.00

Mark a Question for Review Above (USD)

Marks a question that costs more than this so you can review it. It never stops or shortens an answer. -1 turns the mark off.

1.00

Cost Cap Alert Threshold (%)

Warns when a day’s spending reaches this percentage (0-100) of the two daily limits. It never blocks.

80

For the two hard limits, -1 means no limit and 0 is not accepted. When a hard limit is reached, the person sees an answer that names the limit, for example that the daily AI limit was reached, and that an administrator with access to Settings can raise it. The limit resets at the end of the day shown in that answer.

Note

The Modules section at the bottom of the same screen offers optional add-on apps, such as Viindoo Brain - Knowledge OS, which you can turn on from there.

Set How Long Records Are Kept

In the Privacy and Data section of AI ‣ Configuration ‣ Settings:

  • API Log Retention (days) is how long the raw HTTP records are kept. The default is 30.

  • Answer Steps Retention (days) is how long the steps of each answer, with the tools it called and what they returned, are kept. The default is 90.

Records older than these periods are deleted.

See What AI Costs

  1. Go to AI ‣ Reporting ‣ Dashboard. The table shows input and output tokens and Cost (USD) per month. Use Measures to add more, such as the duration or the number of tool calls.

    The AI Dashboard pivot with input tokens, output tokens and Cost (USD) for the month
  2. Switch to the List view with the view switcher at the top right and expand the month. Each row is one call to a vendor, with the date, user, provider, model, request kind, tokens, cost, Status (Success or Error) and the Related Record. Use the search box to narrow the list, for example by User.

    The AI Dashboard in list view with the calls of the month filtered on one user

Compare Cost With Answer Quality

Go to AI ‣ Reporting ‣ Quality & Cost. The table covers the last 30 days and groups cost, input tokens, output tokens and the number of LLM calls by the rating people gave to answers: Thumbs down (not helpful), Flag for review (problematic content), Thumbs up (helpful) or None.

The Quality & Cost pivot with cost, tokens and LLM calls grouped by answer rating

Read Why an Answer Failed

An answer that fails tells the person in plain words what happened, for example that the AI service is taking too many requests, refused the key of the connection, did not answer in time, or that the daily AI limit was reached. The text of the AI service itself never appears in that message.

A user with the AI Operator right (the AI Administrator and the system administrator include it) sees a Details button under a failed answer. It opens the log of the answer: the full error text the AI service sent, and, for a step that used an external tool, the full inputs sent to that tool.

Open the Record of What Was Sent

  1. In the List view of the Dashboard, open a row. The form shows who made the call, with which provider and model, the Trace ID, the tokens, the cost and the Status. The Raw HTTP and Replay buttons are at the top.

    A call with the Raw HTTP and Replay buttons, the Trace ID, tokens, cost and status
  2. Scroll to the tabs. Prompt shows the exact messages that were sent to the vendor, Response what came back and Tool Calls the actions the assistant ran. A call made by Test Connection sends a single short message.

    The Prompt tab of a call showing the message that was sent to the vendor
  3. Click Raw HTTP to open the HTTP record of the call: method, address, response status, duration and, in Request Details, the headers and the body. The Authorization header shows ***MASKED***, so keys are never readable here.

    The Request Details tab of the raw HTTP record with the Authorization header masked and the user identifier header blurred

Note

Raw HTTP opens for a system administrator or a user with API Log Viewer. The Replay button sends the stored request to the vendor again and counts as a new request, which is billed like any other. Only a system administrator sees it.

Read the API Request Logs

The API Logs app lists the same HTTP records outside the AI app: go to API Logs ‣ API Request Logs. Each row shows the date, the AI Trace ID of the answer, the AI Iteration, the AI Finish Reason, the input and output tokens, the Response Status and the Duration (s). Open a row for the method, the address, the user, the record and the Request Details and Response Details tabs.

The API Request Logs list with date, AI trace ID, iteration, finish reason, tokens, response status and duration, the trace ID blurred

Who Sees What

Who

Sees

Where

Every internal user

Their own AI calls and ratings.

Dashboard, Quality & Cost

AI Operator, AI Administrator, system administrator

The calls of the whole company.

Dashboard, Quality & Cost

AI Operator, AI Administrator, system administrator

The full error text of a failed answer and the inputs sent to an external tool.

Details button under a failed answer

API Log Viewer, system administrator

The raw HTTP records.

API Request Logs, Raw HTTP button

Success Checkpoint

  • The spend limits in Cost Control show the values you saved.

  • You know which limit stops a job and who can raise it.

  • The Dashboard shows tokens and cost for the month.

  • You opened a call and read its Prompt and its Raw HTTP record, with Authorization masked.

Common Problems

Problem

What to do

An answer stops with a message that you or your company reached the daily AI limit.

The person or the company reached a hard limit. The job stopped at the end of its step. Raise the limit in Settings, or use -1 for no limit. Zero is not accepted.

The Dashboard is empty.

No call has been made yet, or you only see your own calls. Run Test Connection or ask the assistant a question; give reporting users the AI Operator right to see the whole company.

The Raw HTTP button is missing.

It opens for a system administrator or a user with API Log Viewer.

The Replay button is missing.

Only a system administrator sees it.

Old records have disappeared.

They were deleted when they passed API Log Retention (days) or Answer Steps Retention (days).

Next Steps