# List traces

URL: https://docs.hanzo.ai/docs/openapi/eval/get-eval-traces

> The traces behind your evaluations — one per model call an evaluation made, carrying its input, output, model and timing — narrowed by any of sessionId, runName and datasetName.

`GET /v1/eval/traces`

> [Eval →](https://docs.hanzo.ai/docs/openapi/eval) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                        |
| ------------- | -------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/eval/traces`  |
| **Method**    | `GET`                                  |
| **Operation** | `get_eval_traces`                      |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY` |

The traces behind your evaluations — one per model call an
evaluation made, carrying its input, output, model and timing — narrowed by any
of sessionId, runName and datasetName.

Scoped by org AND by project: the project is the caller's server-minted scope,
not a parameter, so it cannot be widened by asking. Requires a validated
principal; 401 without one. Traces live in the datastore, so a deployment with
none wired answers 503 rather than an empty page.

## Request

4 fields.

| Field         | In    | Type    | Required | Description                                                           |
| ------------- | ----- | ------- | -------- | --------------------------------------------------------------------- |
| `sessionId`   | query | string  | —        | SessionID narrows to one session, which for an evaluation is one run. |
| `runName`     | query | string  | —        | RunName narrows to the calls one run made.                            |
| `datasetName` | query | string  | —        | Dataset narrows to the calls made against one dataset.                |
| `limit`       | query | integer | —        |                                                                       |

## Response

| Status    | Body            | Meaning |
| --------- | --------------- | ------- |
| `200`     | eval.traceList  | ok      |
| `default` | problem-details | refused |

`200` body — 16 fields.

| Field                  | In   | Type              | Always | Description                                                                                                                                                 |
| ---------------------- | ---- | ----------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data`                 | body | eval.traceView\[] | —      | Data is the caller org's traces matching the filters, bounded by limit.                                                                                     |
| `data[].apiKeyHash`    | body | string            | —      | APIKeyHash is the non-reversible credential ref (never a plaintext key), so a trace correlates to the key that drove it without the store holding a secret. |
| `data[].datasetItemId` | body | string            | —      | ItemID is the example the call answered.                                                                                                                    |
| `data[].datasetName`   | body | string            | —      | Dataset is the set the graded example came from.                                                                                                            |
| `data[].endTime`       | body | string            | —      | EndTime is when it returned.                                                                                                                                |
| `data[].id`            | body | string            | —      | ID is the trace's handle, the value a score points at.                                                                                                      |
| `data[].input`         | body | any               | —      | Input is what the model was given.                                                                                                                          |
| `data[].latencyMs`     | body | number (double)   | —      | LatencyMs is EndTime-StartTime in milliseconds, nil when the trace carries no timing (so the console renders "—", never a fabricated 0).                    |
| `data[].model`         | body | string            | —      | Model is the model that answered.                                                                                                                           |
| `data[].name`          | body | string            | —      | Name is the trace's label, "eval:\<run>" for a call a run made.                                                                                             |
| `data[].output`        | body | string            | —      | Output is what it answered.                                                                                                                                 |
| `data[].projectId`     | body | string            | —      | ProjectID is the sub-scope within the org the call was made under.                                                                                          |
| `data[].runName`       | body | string            | —      | RunName is the run the call belongs to.                                                                                                                     |
| `data[].sessionId`     | body | string            | —      | SessionID groups the calls of one run.                                                                                                                      |
| `data[].startTime`     | body | string            | —      | StartTime is when the call began.                                                                                                                           |
| `data[].timestamp`     | body | string            | —      | Timestamp is the trace's own clock, equal to StartTime for a timed call.                                                                                    |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo eval traces
```

**SDK**

**.ts**

```ts
import { Configuration, EvalApi } from 'hanzoai';

const api = new EvalApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getEvalTraces();
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import EvalApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = EvalApi(client).get_eval_traces()
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.EvalAPI.GetEvalTraces(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, eval_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = eval_api::get_eval_traces(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.EvalApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new EvalApi(client).getEvalTraces();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/eval/traces \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **eval** through the `eval` tool, which names its 16 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_eval_datasets"
         }
       }
     }'
```

---

[Eval API](https://docs.hanzo.ai/docs/openapi/eval) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
