Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content
Route model calls

What Mubit records

Mubit records the model calls it passes on. This page says what is kept, how much your app can ask Mubit to keep, and what a call gives up when it keeps less. It is for developers and anyone who answers questions about what happens to prompts and replies.

What is kept by default

By default Mubit keeps the whole call:

  • The request and the reply. For a stream, the reply is the whole answer, put together.
  • The facts about the call: its time, the model ID your app sent, the provider that answered, the HTTP status, how long the call took, the tokens in and out, and the session.

The console's Requests page shows recorded calls: see Find calls in Requests.

Mubit uses recorded calls to group them into tasks, to rate them automatically, and to build the examples an adapter trains on: see Tasks and sessions. Mubit rates and routes calls with automated services, and the content of a recorded call can reach them. A call recorded at a lower level, below, is kept out of this: it is not rated and trains no adapter.

Lower what Mubit keeps

Send a header with the call. A header can lower what Mubit keeps of a call, never raise it.

HeaderValuesEffect
x-middleware-recordfull, metadata, off (none also means off)The level for this call.
x-middleware-storefalse, 0, off or noThe same as x-middleware-record: metadata. Any other value does nothing.

Values are not case-sensitive. A value Mubit can't read is ignored. When a call carries several values, across both headers, the lowest one counts.

LevelWhat Mubit keeps
fullThe request and the reply, with the facts about the call. This is the default.
metadataThe facts about the call: IDs, times, statuses, sizes, the model, the token counts and a fingerprint of the call's task. No request and no reply.
offThe same as metadata, without the fingerprint. Nothing derived from the call's content is kept beyond the model and the token counts.

At metadata and off, a call:

  • is not listed in Requests;
  • is not rated, and is never an example an adapter trains on;
  • is never answered by an adapter: see Calls answered by an adapter;
  • still counts for its tokens.

Mubit doesn't send either header to your provider.

Add the header the way your SDK adds any header:

Python
response = client.chat.completions.create(
    model="gpt-6-luna",
    messages=[{"role": "user", "content": "Reply with the word ok."}],
    extra_headers={"x-middleware-record": "metadata"},
)

The Python and TypeScript examples use the client from Connect OpenAI. The headers work the same way on every provider prefix.

ℹ️Note

There is no project-wide setting for the level today. Each call sets its own.

Credentials in a stored copy

Before Mubit stores a request or a reply, it replaces anything shaped like a credential with a marker, [redacted:<kind>]. That covers keys and tokens with well-known prefixes, private key blocks, and the user name and password in a URL. It is a safety net, not a filter for personal data: it doesn't look for names, emails or other personal details.

Sizes

Mubit stores up to 32 MiB of a request. For a reply, it stores the first 4 MiB and the last 256 KiB. A larger call still goes through whole. Only Mubit's record of it is cut.

What leaves no record

  • A call Mubit refused before it reached your provider, such as one with a missing key or an unknown path.
  • A call whose answer was a model list, or another route that isn't a model call. Model lists don't show in Requests.
  • A call sent at metadata or off, as above.

Next