> For AI agents: the documentation index is at https://platform.detectif.ai/llms.txt. Every page is also available as Markdown by adding `.md` to its path.

# Sessions and usage

Look up a call by its session ID, and see your Noesis calls and minutes.

Both endpoints need a key with the `noesis:read` permission.

## Look up a call

Every live call and recorded call has a `session_id`: it is in the `ready` event of a live call and in the result of a recorded call. Use it to read the call's state, its latest answer and its events:

```bash
curl https://api.noesis.detectif.ai/v1/detect/sessions/9f2c4e7a-1b3d-4c5e-8f60-2a7b9c1d3e4f \
  -H "Authorization: Bearer $DETECTIF_API_KEY"
```

```python
import os

import requests

session_id = "9f2c4e7a-1b3d-4c5e-8f60-2a7b9c1d3e4f"
resp = requests.get(
    f"https://api.noesis.detectif.ai/v1/detect/sessions/{session_id}",
    headers={"Authorization": f"Bearer {os.environ['DETECTIF_API_KEY']}"},
    timeout=30,
)
session = resp.json()
print(session["closed"], session["label"])
```

```javascript
const sessionId = "9f2c4e7a-1b3d-4c5e-8f60-2a7b9c1d3e4f";
const res = await fetch(`https://api.noesis.detectif.ai/v1/detect/sessions/${sessionId}`, {
  headers: { Authorization: `Bearer ${process.env.DETECTIF_API_KEY}` },
});
const session = await res.json();
console.log(session.closed, session.label);
```

- `closed` says whether the call has ended. While the call is live, the session shows the answers so far.
- Use it after a dropped connection, or to check a call later.
- Only the account that created a session can read it. Any other session ID returns `404` with `session_not_found`.

## Usage

Your account's Noesis calls and minutes:

```bash
curl https://api.noesis.detectif.ai/v1/detect/usage \
  -H "Authorization: Bearer $DETECTIF_API_KEY"
```

The fields are listed in the [API Reference](https://platform.detectif.ai/docs/noesis/api/). Your credit balance, shared with the other DetectifAI APIs, is on the dashboard Overview page.

## Calls at the same time

Your plan sets how many live calls and recordings can run at the same time. Over the limit, a new call is refused with `429` (close code `4429` on the WebSocket) until one of your calls ends.
