# Your first trace

A trace is a record of an AI call (or a chain of calls). Uploading a trace into Premium lets you inspect it in the UI and run trace evaluations against it.

## Prerequisites

* [ ] A Stratix Premium account ([sign up](/2.-get-started/sign-up.md))
* [ ] Either: a JSON file with one trace, or willingness to use the SDK to ingest a sample trace

## Option A — Upload via UI

### 1. Open Traces

Left rail: **Agent Evaluation → Traces**. Click **Upload trace**.

### 2. Drop the JSON file

A valid trace has at least:

```json
{
 "id": "trace-1",
 "name": "answer-question",
 "inputs": {"prompt": "What is the capital of France?"},
 "outputs": {"response": "Paris."},
 "spans": [
 {"name": "llm-call", "kind": "llm", "model": "claude-opus-4-7",...}
 ]
}
```

### 3. Confirm

Stratix parses the JSON, infers the schema, and shows a preview. Click **Save**.

### 4. Inspect

The trace page shows:

* The full span tree
* Per-span model, latency, cost, errors
* Inputs and outputs at every level

## Option B — Ingest via SDK

```python
import os
from layerlens import Stratix

client = Stratix(api_key=os.environ["LAYERLENS_STRATIX_API_KEY"])
client.traces.create(
 id="trace-1",
 name="answer-question",
 inputs={"prompt": "What is the capital of France?"},
 outputs={"response": "Paris."},
 spans=[
 {"name": "llm-call", "kind": "llm", "model": "claude-opus-4-7"}
 ],
)
```

The trace appears in **Agent Evaluation → Traces** within seconds.

## Verify

Open the trace page; you should see your trace's span tree, inputs, and outputs.

## What to try next

* **Score this trace.** See [Trace evaluations](/8.-evaluate-score-the-outputs/trace-evaluations.md).
* **Ingest more traces.** A representative trace set is the starting point for agentic evaluations.

## Where to next

* [First judge](/2.-get-started/first-judge.md)
* [Stratix Premium — Traces](/7.-observe-see-whats-happening/traces.md)
* [Concept: Traces and spans](/6.-build-wire-your-code/traces-and-spans.md)
* [Tutorial: Score live traces](/8.-evaluate-score-the-outputs/04-score-traces.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.layerlens.ai/2.-get-started/first-trace.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
