ShvIA

Docs · Guides

Your data

What the gateway stores about your calls, what it changes in your text, and which models keep your prompt on the operator's own infrastructure. The numbers are defaults that the operator of an installation can change.

What is stored#

You callA conversation is storedThe call is metered
POST /v1/chat/completions, /v1/messages, /v1/responsesnoyes
POST /api/v1/chatyesyes
POST /api/v1/agent/chatyesyes
POST /a2a/v1yes, in the account of the administrator behind the peeryes
POST /api/v1/agent/runnoyes, every round is a model call
POST /api/v1/mcpnono. The tool calls are logged
PUT /api/v1/collections/{id}/documents/{document id}no, but the text of the document is stored until you delete it. See collectionsno
/v1/audio/* and POST /api/v1/embeddingsnono

A stored conversation belongs to your account and you can read it, export it and delete it. See conversations. With an API key, conversations go into a project named API. Stored conversations are also visible to you in the web app.

The metering record#

Every chat call leaves one record. It is what quotas, usage and cost are computed from. It holds:

  • who called, when, from which address and with which client name, and how it authenticated;
  • the model, the provider, the data locality and the endpoint family;
  • the number of tokens in and out, the cost, the status and the timings;
  • the text of your last message, masked and shortened: personal data is replaced as described below, and the text is cut at 8000 characters by default. The system instructions, the history and any attached context are not in it.

The record does not hold the answer, only its length. Records are kept for 180 days by default, and administrators of the installation can read them.

Masking of personal data#

When a call goes to a model that is not on the operator's own servers, the text of every message is scanned first, and these are replaced by a placeholder before anything leaves:

FoundBecomes
e-mail addresses[EMAIL]
CPF and CNPJ numbers, formatted or as bare digits[CPF], [CNPJ]
card numbers[CARD]
Brazilian phone numbers[FONE]
postal codes (CEP) and RG numbers[CEP], [RG]
private network addresses[IP]
passwords in URLs, and key and token shapes such as sk-… and JWTs[PASS], [TOKEN], [JWT]

The model never sees the original, so it cannot repeat it back, and it cannot work with it: asking a cloud model to validate a CPF will not work. This applies to every endpoint that can reach a cloud model, the /v1 ones included.

Be aware of what else it catches. Any run of 8 digits or more, except one of exactly 9, can be taken for a postal code, a phone number, a CPF, a card or a CNPJ, so identifiers, Unix timestamps and the tail of a UUID may be rewritten too, and the placeholder does not always match what the number was: a Brazilian mobile number written as bare digits can come out as [CPF]. Code or data that you send to a cloud model can come out altered.

What masking does not cover: the arguments of tool calls, tool definitions, and images. And it is a safety net, not a guarantee: mask before you send what must not leave.

The operator can switch masking off for the whole installation. There is no switch for a single account or a single call.

Data locality#

Each model declares where it runs, in data_locality of GET /api/v1/profiles:

ValueMeaning
on_premthe model runs on the operator's own infrastructure. Your prompt stays there
cloud_us, cloud_eu, cloud_br, cloud_cnthe prompt goes to a cloud provider, classed by region

Use it to apply your own policy, for example to allow only on_prem for sensitive work. cloud_cn models are the ones to be most careful with.

Four rules follow from it:

  • A combo does not keep a prompt on the operator's servers: if its first target fails, the next one can be a cloud provider. Knowledge-base context and memory are left out of every target of a combo that has a cloud target.
  • Knowledge-base context and long-term memory can be added to a prompt only when the model is on the operator's own servers.
  • On POST /api/v1/chat, a turn that was meant to stay on the operator's servers can still move to the cloud. If those servers cannot be reached before any text is sent, and you have a cloud model among your favorites for which you hold your own key (pasted, or a subscription login), the turn restarts on that model, and the model event says target_source: api_do_usuario. The new prompt has no knowledge-base context and no memory, but it carries the conversation, with personal data masked. A bot's turn never moves, and neither does any turn of an account with LGPD protection on. Turn that setting on in your account to forbid the move. agent/chat and the /v1 endpoints never move an on-premises prompt to the cloud.
  • The locality is recorded on every metering record, so it can be audited later which call went where.

What the provider sees#

With your own key, the provider sees what you send, under your agreement with it. The key stays with you: ShvIA stores it encrypted and never returns it. See providers and your own keys.

What the native chat adds to a prompt#

POST /api/v1/chat and POST /api/v1/agent/chat are the product's chat, not a raw completion. The server adds its own instructions, the persona and the instructions you saved in your account, and the instructions and files of the project the conversation sits in. With LGPD protection on in your account settings, the persona and the project context are not sent to cloud models. The /v1 endpoints send only what you send, plus the pieces of the collections you name in the call. Those pieces follow the same rule as the project context: a cloud model can receive them, and with LGPD protection on the call is refused instead.

Deleting#

  • DELETE /api/v1/conversations/{id} hides a conversation. Its messages are kept.
  • DELETE /api/v1/conversations/{id}/permanent deletes the conversation and its messages. The metering records stay, with the link to the conversation removed, so that your usage numbers do not change.
  • Deleting a conversation does not delete what a provider may keep under your agreement with it.