# API Logs

> Your API is now how your users use your product. Restless brings every request into one place, so you can see which endpoints get hit, which calls fail, and where people give up.

Source: https://www.restless.ai/logs

## Features

- Your API is how agents and users reach your product. Restless gives you a window into all of it.
- Filter by user, endpoint, status, or error to find the exact calls you care about.
- Every request is captured in full, so you can trace any issue back to what really happened.
- Your users can see their own logs too, through the Workbench and MCP.

## See who is using your API

Every customer, the endpoints they hit, and where they're running into errors.

## ...or you can just ask

Your logs are on the MCP server, so you can ask about your users in plain language.

## The SDK uploads your log

`restless.setup` adds a small middleware to your app. It captures each request and response and ships them to Restless, tagged by the customer who made the call.

Detects your framework, generates your OpenAPI spec, and wires the SDK into your server.

```sh
npx restless init
```

- [Node](https://github.com/restlesshq/node)
- [Python](https://github.com/restlesshq/python)
- [Ruby](https://github.com/restlesshq/ruby)
- [Go](https://github.com/restlesshq/go)

```js
// server.js
// reads RESTLESS_KEY from your env
const restless = require("@restlessai/sdk")();

app.use(restless.setup((req) => ({
  apiKey: restless.mask(req.headers.authorization),
  owner: {
    id: req.workspace.id,
    // resolved once per owner, then cached
    enrich: async (id) => {
      const ws = await db.workspaces.find(id);
      return { label: ws.name, email: ws.adminEmail };
    },
  },
})));

// ...your routes...

app.use(restless.errorHandler);
```

- **Off the request path** — Requests are batched and uploaded in the background, so the SDK adds no latency to your API.
- **Redacted by default** — Authorization and Cookie headers, and fields like password and ssn, are stripped before anything leaves your server. The list extends itself from your OpenAPI spec.
- **Owner enrichment** — Owner metadata resolves once per owner id, then caches. A hundred calls from the same workspace don't hit your database a hundred times.
- **Error triage built in** — 4xx and 5xx responses get an x-log-url header and a debug block, so a failed call links straight to its captured log.

### Security

#### Length-preserving masking

Secrets are masked, not dropped. An API key is stored and shown as `•••••1234` so you can still tell requests apart without ever holding the real value.

#### Audited PII access

Every time someone opens an end-user's data it's recorded as `log.view` or `user.view`, with the email stored only as a hash.

## One view of every request

Captured in full, attributed to a customer, and ready to filter, ask, or replay.

### Full Requests and Responses

Who called, what they sent, and what came back, down to the headers and body. The complete record, not a sample or a summary, so you can trace any issue to the exact request.

Sensitive fields are redacted before they leave your server.

### Filter by anything

User, endpoint, method, status code, or user agent. Narrow to the exact calls you care about.

### Owner enrichment

Every request is tied to the customer who made it, enriched with their name, plan, and contact.

### Problems rise to the top

Repeated failures and high-error endpoints surface on their own.

### Read it your way

Browse it in the Workbench or ask about it over MCP.

### Replay and debug

Open any request in the inspector and replay it as cURL, HAR, or Postman.

### Shareable views

Filter down to a slice of traffic and share the exact view with a link. Everyone opens the same filtered logs, no screenshots.

## Related features

- [MCP Server](https://www.restless.ai/mcp-server) — Give agents native access to your API, no docs required.
- [Human Support](https://www.restless.ai/human-support) — Answer developer questions with the full request already in front of you.
- [Workbench](https://www.restless.ai/workbench) — Filter your logs and replay any request to see exactly what failed.

## Setup

Setup is a breeze. Restless is tightly integrated with your API, so we install a small SDK. Don't worry, we walk you through every step of the way.

Run this in your API's repo:

```sh
npx restless init
```

Or hand the setup to your coding agent with this prompt:

```text
Set up Restless in this repo by running `npx restless init` and following the steps.
```

To try it on a demo API instead:

```sh
git clone git@github.com:restlesshq/demo.git && cd demo && npx restless init
```

Nothing is uploaded without your permission.

The CLI runs four steps:

1. **Map out APIs.** Locate your APIs, generate an OpenAPI (OAS) file, and write it to `.restless/`. An OAS file is the shape of your API: every endpoint, parameter, and response. Later steps use it to install the right adapter and wire up the middleware exactly. The scan points Claude Code, running locally on your machine, at your codebase to find your routes. Commit the `.restless/` folder along with your code; it's meant to live there.
2. **Install SDK.** The CLI detects the project runtime, selects its adapter, installs the Restless SDK and wires the request middleware.
3. **Test your setup.** Local traffic capture starts, and the CLI confirms requests are reaching Restless.
4. **Set up account.** Log in to claim your project on Restless.

Privacy: scanning runs entirely on your machine via your own Claude Code install. We don't see a single line of your code, and nothing gets sent to our servers at that step.

## More from Restless

- [Restless](https://www.restless.ai/index.md): Restless makes your API self-improving. Every API call, support question, and error leaves it better for the next request.
- [Features](https://www.restless.ai/features.md): A new surface for your API: a public, LLM-first hub that gets every caller started and keeps them moving.
- [Documentation](https://www.restless.ai/documentation.md): Restless generates your API documentation from your endpoints and the tools your team already uses, and keeps it current every time your API changes.
- [Getting Started](https://www.restless.ai/getting-started.md): Onboarding is the most important part of your developer experience. Restless makes it easy for your developers to get their agent set up and ready to build.
- [Agentic docs](https://www.restless.ai/agentic-docs.md): Restless isn't just agent-friendly docs. It's the only documentation platform built AI-first. There's a UI for humans, but the docs are shaped to make agents successful.
- [Workbench](https://www.restless.ai/workbench.md): The Workbench sits at the bottom of your docs and gives developers a view into everything that's happening: view and filter logs, see what went wrong, and fix issues.
- [Agent recovery](https://www.restless.ai/agent-recovery.md): When an agent hits an error on your API, it usually gives up and you never hear about it. Restless catches the failed call and tells the agent how to fix its request and retry.
- [Human support](https://www.restless.ai/human-support.md): When a developer hits something AI can't fix, a human can step in and answer the question. Every answer becomes part of the context, and makes the next question easier!
- [MCP server](https://www.restless.ai/mcp-server.md): Give agents the ability to do more than just write code. Give them access to do everything they need to build on your product, such as reading docs, debugging API calls and updating settings.
- [AI Traffic](https://www.restless.ai/ai-traffic.md): Your API and docs get a lot of AI traffic now, and most of it is invisible. Restless shows you what AI is actually looking for, broken down by who is asking.
- [Self-updating docs](https://www.restless.ai/self-updating-docs.md): Restless reads resolved support conversations, pulls out the part that applies to everyone, and drops it in an inbox to review. Approve it and it becomes context the next person finds on their own.
- [Solicit feedback](https://www.restless.ai/solicit-feedback.md): When an agent hits something confusing in your API, it usually just gives up. Restless adds a send_feedback tool to your MCP server, so the agent can tell you what tripped it up.
- [Sign up](https://app.restless.ai/signup)
