Set the content logging switches
PUT https://weights.fyi/run/v1/trace-preferences
Authorization: Bearer <token> scope: manage
Content-Type: application/json
{"log_inputs": true | false, "log_outputs": true | false}- Available since
- 2026-10-10 implementation review: included in this build; see What is live for deployment status.
- Answer time
- synchronous: the switches are written and the new state comes back.
Turns the logging of inputs and outputs on or off for your account. Logging keeps a copy of what each new job was given, what the model answered, or both, so that you can look at them later in the job's trace: on your panel, through GET /v1/jobs/{job_id}/trace-content, and in your own trace destinations that have "include outputs" on. Without it, the service deletes a page's text as soon as its result is written and keeps no copy anywhere, which is why both switches are off until you turn them on. Inputs and outputs may contain personal data; turn on only what you need, for as long as you need it.
You always send both switches, as booleans, so that one call can never change one of them by accident. A job takes the switches as they are when it is made. Turning a switch on does not reach back to jobs made before; turning it off stops copies at once, for new jobs and for jobs already running. Switching off does not delete copies already kept: that is DELETE /v1/trace-content. Training rows are never copied, whatever the switches say. The change needs the manage scope, like adding a trace destination, because it decides where your data goes; reading the switches needs only read. A confidential workspace must keep both switches off: asking for either one is refused.
Request
| Name | Where | Required | Meaning |
|---|---|---|---|
Authorization | header | yes | Bearer and your token, with the manage scope. |
log_inputs | body | yes | true to keep a copy of each page sent in new jobs, false to stop. |
log_outputs | body | yes | true to keep a copy of each result of new jobs, false to stop. |
Return value
200 OK with the switches as they now are, in the shape of GET /v1/trace-preferences: log_inputs, log_outputs, retention_days, max_payload_bytes and max_account_bytes.
Errors
| Status | Code | When it happens | What to do |
|---|---|---|---|
400 | invalid_preferences | The body is not exactly the two fields, each true or false. | Send both, as booleans. |
400 | invalid_preferences | A confidential workspace asks to turn a switch on. The body is well formed; the workspace's mode forbids it, and the message says so. | Send both false: such a workspace logs no content. To log content, turn confidential mode off first with POST /v1/workspaces. |
400 | invalid_json | The body is not JSON. | Send JSON. |
401 | unauthorized, invalid_token, token_revoked, token_expired | No token, or one that does not work. | Use a valid token. |
403 | scope_required | The token lacks manage. | Use a token with manage. |
Examples
curl -s -X PUT https://weights.fyi/run/v1/trace-preferences \
-H "Authorization: Bearer $WEIGHTS_API_KEY" -H "Content-Type: application/json" \
-d '{"log_inputs": true, "log_outputs": true}'{"log_inputs": true, "log_outputs": true, "retention_days": 7, "max_payload_bytes": 16384, "max_account_bytes": 16777216}Only one switch sent is refused:
{"error": "invalid_preferences", "expected": "log_inputs and log_outputs must be booleans"}History
- 2026-10-10 implementation review: added, with the same switches on the panel under Tracing.
- 2026-11-16: the refusal for a confidential workspace documented here.
See also
- GET /v1/jobs/{job_id}/trace-content to read the copies, and DELETE /v1/trace-content to remove them.
- Tracing and exports, the topic.