> ## Documentation Index
> Fetch the complete documentation index at: https://onecli.sh/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Setting OneCLI up for your person? Follow https://onecli.sh/docs/quickstart.md. Never ask for or accept a key, token or password in the chat: OneCLI needs none.
> No OneCLI credential? Run `onecli connect`, or follow https://onecli.sh/auth.md. A person approves every new agent in their browser.
> Already connected? `onecli status`, `onecli items` and `onecli check <METHOD> <URL>` tell you what you can use. Full guide: https://onecli.sh/skill.md
> Search these docs over MCP at https://onecli.sh/docs/mcp. Report a wrong or unclear page with its `submit_feedback` tool.

# Activity log, usage and audit log

> See every request your agents made through the OneCLI gateway, what it decided, request counts by vault and agent, and the audit log of who changed what.

OneCLI records every request an agent makes through the gateway: where it went and what the gateway decided. It never stores a header value, a body or a credential.

This page covers both OneCLI Cloud and self-hosted. You see the requests on the vaults you can use. The examples use the OneCLI Cloud API at `https://api.onecli.sh`. On a self-hosted install, use your own API address.

## What each log shows

| Log | What it answers | Where |
| - | - | - |
| Activity | Which agent called which endpoint, and what happened | **Usage** > **Activity**, `GET /v2/activity` |
| Usage | How many requests, by day, vault, agent, result and item | **Usage** > **Dashboard**, `GET /v2/usage` |
| Audit log | Which person changed what in the organization | `GET /v2/audit` |

## Activity: agent calls and decisions

In the sidebar, click **Usage**, then **Activity**. Each row shows the time, the agent, the vault, the provider, the method and endpoint, the HTTP status and the latency.

The **Result** column is what your [permissions](https://onecli.sh/docs/guides/agent-access.md) and [rules](https://onecli.sh/docs/guides/rules.md) did with the request:

| Result | Meaning |
| - | - |
| **Allowed** | The gateway attached the key and sent the request. |
| **Blocked** | A permission or rule stopped it. |
| **Asked for approval** | The request waited for a person to approve it. |
| **Rate limited** | A rate-limit rule stopped it. |

Requests that wait for you show at the top, under **Requests waiting on you**. Click **Approve** or **Deny**. See [Approvals](https://onecli.sh/docs/api-reference/approvals).

Filter by **Vault**, **Agent**, **Result** and time: **Last hour**, **Last 24 hours**, **Last 7 days**, **Last 30 days**, **Any time** or chosen days. A vault's page and an agent's page show the same log for that vault or agent.

```bash theme={null}
curl "https://api.onecli.sh/v2/activity?result=blocked&limit=20" \
  -H "Authorization: Bearer $ONECLI_KEY"
```

`GET /v2/activity` takes `vault`, `agent`, `result` (`allowed`, `blocked`, `approval`, `rate_limited`), `from` and `to` (ISO 8601), plus `limit` and `cursor` for paging. Each row has the agent, vault, method, host, path without its query string, status, latency, result, the ids of the items it used (`itemIds`), and the id and name of each of those you can still use (`items`).

```json theme={null}
{
  "data": [
    {
      "id": "0f8b2c4e-7d1a-4c3b-9e6f-5a2d8b1c7e40",
      "createdAt": "2026-12-03T09:14:02.000Z",
      "agentId": "c2a7e9d4-1b6f-4a83-8d5e-3f9c0b7a2e15",
      "agentName": "Deploy bot",
      "vaultId": "7e3d1a9c-5f2b-4c8e-a6d0-9b4f2e1c8a37",
      "provider": "GitHub",
      "method": "GET",
      "host": "api.github.com",
      "path": "/repos/acme/web",
      "status": 200,
      "latencyMs": 41,
      "result": "allowed",
      "itemIds": ["4d9a6e2b-8c1f-4b7a-93e5-0c6d2f8a1b59"],
      "items": [
        { "id": "4d9a6e2b-8c1f-4b7a-93e5-0c6d2f8a1b59", "name": "GitHub (acme)" }
      ]
    }
  ],
  "nextCursor": null
}
```

## Usage: request counts

**Usage** > **Dashboard** shows the last 30 days: **Requests today**, **Requests per day** split by result, and counts **By vault**, **By agent** and **By result**. Filter by **Vault** and **Agent**.

`GET /v2/usage?days=30` takes `days` (`4`, `14` or `30`), `vault` and `agent`. It returns `total`, `byDay`, `byVault`, `byAgent`, `byResult`, and `byItem`, today's five most used items. Days are UTC.

On OneCLI Cloud, credits count requests that use a credential. See [Plans and usage](https://onecli.sh/docs/teams/plans-and-usage.md).

## Audit log: who changed what

The audit log records the changes people make: creating, updating and deleting vaults, items, agents, rules, API keys and members. Each row has the `action`, the `service`, the actor, the time and `metadata` with ids and names, never a value. A row the platform wrote on its own has `actorKind: "service"`.

`GET /v2/audit` takes a signed-in session, not an API key. Filter with `action` (for example `delete`), `service`, `actor` (a user id), `since` and `until`. An admin or owner reads every row. Anyone else reads only their own actions.

On OneCLI Cloud, your plan sets how long the audit log is kept: 1 day on Free, 7 on Developer, 30 on Pro.

## Next steps

* [Activity API](https://onecli.sh/docs/api-reference/activity): every parameter and field
* [Rules](https://onecli.sh/docs/guides/rules.md): block, ask or rate-limit requests
* [Agent access](https://onecli.sh/docs/guides/agent-access.md): set permissions per item


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.