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

# Logs & Monitoring

> View execution logs and monitor your endpoints

Endprompt logs every API request, giving you full visibility into what's happening with your endpoints.

## The Logs Page

Navigate to **Logs** in the sidebar to access the log explorer.

### Log Entry Information

Each log entry shows:

| Field         | Description               |
| ------------- | ------------------------- |
| **Timestamp** | When the request occurred |
| **Endpoint**  | Which endpoint was called |
| **Prompt**    | Which prompt was used     |
| **Model**     | LLM model used            |
| **Status**    | Success or failure        |
| **Latency**   | Time to complete (ms)     |
| **Tokens**    | Input + output tokens     |
| **Cost**      | Estimated cost            |

## Filtering Logs

Use filters to find specific requests:

<CardGroup cols={2}>
  <Card title="Time Range" icon="calendar">
    Last hour, 24 hours, 7 days, or custom range
  </Card>

  <Card title="Endpoint" icon="plug">
    Filter by specific endpoint
  </Card>

  <Card title="Status" icon="circle-check">
    Success, failed, or all
  </Card>

  <Card title="Model" icon="microchip">
    Filter by LLM model used
  </Card>
</CardGroup>

### Search

Search logs by:

* Request ID
* Input content (partial match)
* Output content (partial match)

## Log Details

Click any log entry to see full details:

### Request Tab

```json theme={null}
{
  "text": "The content that was sent...",
  "max_length": 100,
  "options": {
    "format": "bullets"
  }
}
```

### Response Tab

```json theme={null}
{
  "summary": "The LLM's response...",
  "word_count": 45
}
```

### Rendered Prompt Tab

See the actual text sent to the LLM after template rendering:

```
You are a helpful assistant.

Summarize the following text in bullet points:

The content that was sent...

Return your response as JSON.
```

### Metadata Tab

| Field         | Value               |
| ------------- | ------------------- |
| Request ID    | `req_xxxxxxxxxxxx`  |
| Endpoint      | `/api/v1/summarize` |
| Prompt        | `summarizer-v2`     |
| Model         | `gpt-4o`            |
| Temperature   | `0.3`               |
| Input Tokens  | `256`               |
| Output Tokens | `89`                |
| Latency       | `1,234ms`           |
| Cache Hit     | `No`                |
| Cost          | `$0.0012`           |

## Replaying Requests

Replay any logged request to:

* Debug issues with the same input
* Compare results after prompt changes
* Test with different models or settings

<Steps>
  <Step title="Open Log Entry">
    Click on the log entry you want to replay.
  </Step>

  <Step title="Click Replay">
    Click the **Replay** button.
  </Step>

  <Step title="Modify (Optional)">
    Optionally change the prompt, model, or settings.
  </Step>

  <Step title="Execute">
    Run the replay and compare results.
  </Step>
</Steps>

## Monitoring Metrics

### Endpoint Metrics

On each endpoint's dashboard:

| Metric           | Description                       |
| ---------------- | --------------------------------- |
| **Requests**     | Total requests over time          |
| **Success Rate** | Percentage of successful requests |
| **Avg Latency**  | Average response time             |
| **Token Usage**  | Total tokens consumed             |
| **Cost**         | Total estimated cost              |

### Charts

* **Request Volume** — Requests over time
* **Latency Distribution** — P50, P95, P99 latencies
* **Error Rate** — Failures over time
* **Model Usage** — Breakdown by model

## Setting Up Alerts

<Note>
  Custom alerting is available on Pro and Enterprise plans.
</Note>

Configure alerts for:

* Error rate exceeds threshold
* Latency exceeds threshold
* Daily cost exceeds budget
* Unusual traffic patterns

## Debugging Common Issues

### High Latency

1. Check the **model** — Some models are slower
2. Check **input size** — Large inputs take longer
3. Check **time of day** — Provider congestion varies
4. Check **max tokens** — Higher limits may cause longer generation

### High Error Rate

1. **Check validation errors** — Are inputs malformed?
2. **Check provider status** — Is OpenAI/Anthropic down?
3. **Check rate limits** — Are you exceeding limits?
4. **Check prompt** — Is it producing valid JSON?

### Unexpected Outputs

1. **View rendered prompt** — Is the template rendering correctly?
2. **Check temperature** — Too high may cause variations
3. **Review recent changes** — Did the prompt change?
4. **Replay request** — Reproduce the issue

## Log Retention

| Plan       | Retention           |
| ---------- | ------------------- |
| Free       | 7 days              |
| Pro        | 30 days             |
| Enterprise | 90 days (or custom) |

<Tip>
  Export important logs before they expire if you need them for compliance or analysis.
</Tip>

## Exporting Logs

Export logs for external analysis:

1. Apply filters to select the logs you need
2. Click **Export**
3. Choose format (CSV or JSON)
4. Download the file

## API Access to Logs

<Note>
  Logs API is available on Enterprise plans.
</Note>

Query logs programmatically for custom dashboards and integrations.

## Next Steps

<CardGroup cols={2}>
  <Card title="Team Management" icon="users" href="/guides/team-management">
    Add team members and manage roles
  </Card>

  <Card title="Billing" icon="credit-card" href="/guides/billing">
    Manage your subscription
  </Card>
</CardGroup>
