> This page is for version 0.5.1.
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/nemo-helix/latest/llms.txt
> - 0.7.0: https://docs.nvidia.com/nemo-helix/v0.7.0/llms.txt
> - 0.6.0: https://docs.nvidia.com/nemo-helix/v0.6.0/llms.txt
> - 0.5.1: https://docs.nvidia.com/nemo-helix/v0.5.1/llms.txt
> - 0.5.0: https://docs.nvidia.com/nemo-helix/v0.5.0/llms.txt
> - 0.4.0: https://docs.nvidia.com/nemo-helix/v0.4.0/llms.txt
> - 0.3.0: https://docs.nvidia.com/nemo-helix/v0.3.0/llms.txt
> - 0.2.0: https://docs.nvidia.com/nemo-helix/v0.2.0/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo-helix/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo-helix/_mcp/server.

# List Spans

GET /apis/intake/v2/workspaces/{workspace}/spans

Reference: https://docs.nvidia.com/nemo-helix/v0.5.1/documentation/reference/api-reference/spans/list-spans-apis-intake-v-2-workspaces-workspace-spans-get

## Request

### Path parameters

- `workspace` (string, required)

### Query parameters

- `page` (integer, optional, default: 1) — Page number.
- `page_size` (integer, optional, default: 10) — Page size.
- `sort` (enum, optional, default: -started_at)
  - Allowed values: `started_at`, `-started_at`
- `mode` (enum, optional, default: detailed) — Response mode. summary omits payloads and raw attributes; preview includes input and output truncated to 300 characters; detailed returns full payloads and raw attributes.
  - Allowed values: `summary`, `preview`, `detailed`
- `filter` (SpanFilter, optional) — Filter spans by session_id, trace_id, parent_span_id, project, evaluation_name, test_case_name, source, kind, status, model, tool_name, provider, agent_id, agent_name, and started_at. Every field takes one exact value, except started_at, which takes gte and lte.

## Response

### 200

Successful Response

- `data` (list of Span, required)
- `pagination` (PaginationData, optional) — Pagination information.
- `sort` (string, optional) — The field on which the results are sorted.
- `filter` (map from string to any, optional) — Filtering information.

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### SpanFilter

- `session_id` (string, optional) — Filter by span session id.
- `trace_id` (string, optional) — Filter by canonical trace id.
- `project` (string, optional) — Filter by project name.
- `evaluation_name` (string, optional) — Filter by Evaluation name.
- `test_case_name` (string, optional) — Filter by test case name.
- `source` (string, optional) — Filter by ingest source (e.g. 'otel', 'atif', 'chat_completions').
- `kind` (enum, optional) — Filter by normalized span kind.
  - Allowed values: `LLM`, `CHAIN`, `TOOL`, `RETRIEVER`, `EMBEDDING`, `AGENT`, `RERANKER`, `EVALUATOR`, `GUARDRAIL`, `UNKNOWN`
- `status` (enum, optional) — Filter by normalized span status.
  - Allowed values: `success`, `error`, `cancelled`, `unknown`
- `model` (string, optional) — Filter by model name.
- `tool_name` (string, optional) — Filter by tool name.
- `provider` (string, optional) — Filter by provider (e.g. 'openai', 'nim', 'anthropic').
- `agent_id` (string, optional) — Filter by agent identifier.
- `agent_name` (string, optional) — Filter by agent application name (e.g. 'claude-code', 'codex').
- `parent_span_id` (string, optional) — Filter by parent span id. Use to fetch direct children of a span.
- `started_at` (DatetimeFilter, optional) — Filter by span start timestamp.
- `evaluation_id` (string, optional, deprecated) — Deprecated alias for evaluation_name. Use evaluation_name instead.
- `test_case_id` (string, optional, deprecated) — Deprecated alias for test_case_name. Use test_case_name instead.

### Span

- `span_id` (string, required)
- `session_id` (string, required)
- `workspace` (string, required)
- `kind` (enum, required)
  - Allowed values: `LLM`, `CHAIN`, `TOOL`, `RETRIEVER`, `EMBEDDING`, `AGENT`, `RERANKER`, `EVALUATOR`, `GUARDRAIL`, `UNKNOWN`
- `source` (string, required)
- `started_at` (datetime, required)
- `status` (enum, required)
  - Allowed values: `success`, `error`, `cancelled`, `unknown`
- `ingested_at` (datetime, required)
- `project` (string, optional)
- `evaluation_context` (SpanEvaluationContext, optional)
- `parent_span_id` (string, optional)
- `name` (string, optional)
- `trace_id` (string, optional)
- `ended_at` (datetime, optional)
- `error_type` (string, optional)
- `error_message` (string, optional) — Normalized error message. In summary and preview modes this is truncated to 1000 characters.
- `provider` (string, optional)
- `model` (string, optional)
- `prompt_id` (string, optional)
- `agent_id` (string, optional)
- `agent_name` (string, optional)
- `tool_name` (string, optional)
- `input_tokens` (integer, optional)
- `output_tokens` (integer, optional)
- `cached_tokens` (integer, optional)
- `total_tokens` (integer, optional)
- `usage_details` (map from string to integer, optional)
- `cost_total_usd` (double, optional)
- `cost_input_usd` (double, optional)
- `cost_output_usd` (double, optional)
- `cost_details` (map from string to double, optional)
- `input` (string, optional) — Span input text. Omitted in summary mode and truncated to 300 characters in preview mode.
- `output` (string, optional) — Span output text. Omitted in summary mode and truncated to 300 characters in preview mode.
- `raw_attributes` (string, optional)

### PaginationData

- `page` (integer, required) — The current page number.
- `page_size` (integer, required) — The page size used for the query.
- `current_page_size` (integer, required) — The size for the current page.
- `total_pages` (integer, required) — The total number of pages.
- `total_results` (integer, required) — The total number of results.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (map from string to any, optional)

### DatetimeFilter

- `$gte` (datetime, optional) — Filter for results greater than or equal to this datetime.
- `$lte` (datetime, optional) — Filter for results less than or equal to this datetime.

### SpanEvaluationContext

- `evaluation_name` (string, optional) — Name of an existing Evaluation.
- `test_case_name` (string, optional) — Optional producer-supplied test case name.
- `evaluation_id` (string, optional, deprecated) — Deprecated alias for evaluation_name. Use evaluation_name instead.
- `test_case_id` (string, optional, deprecated) — Deprecated alias for test_case_name. Use test_case_name instead.

### ValidationErrorLocItems

## Examples

**Response**

```json
{
  "data": [
    {
      "span_id": "string",
      "session_id": "string",
      "workspace": "string",
      "kind": "LLM",
      "source": "string",
      "started_at": "2024-01-15T09:30:00Z",
      "status": "success",
      "ingested_at": "2024-01-15T09:30:00Z",
      "project": "string",
      "evaluation_context": {
        "evaluation_name": "string",
        "test_case_name": "string",
        "evaluation_id": "string",
        "test_case_id": "string"
      },
      "parent_span_id": "string",
      "name": "string",
      "trace_id": "string",
      "ended_at": "2024-01-15T09:30:00Z",
      "error_type": "string",
      "error_message": "string",
      "provider": "string",
      "model": "string",
      "prompt_id": "string",
      "agent_id": "string",
      "agent_name": "string",
      "tool_name": "string",
      "input_tokens": 1,
      "output_tokens": 1,
      "cached_tokens": 1,
      "total_tokens": 1,
      "usage_details": {},
      "cost_total_usd": 1.1,
      "cost_input_usd": 1.1,
      "cost_output_usd": 1.1,
      "cost_details": {},
      "input": "string",
      "output": "string",
      "raw_attributes": "string"
    }
  ],
  "pagination": {
    "page": 1,
    "page_size": 1,
    "current_page_size": 1,
    "total_pages": 1,
    "total_results": 1
  },
  "sort": "string",
  "filter": {}
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/apis/intake/v2/workspaces/workspace/spans"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://api.example.com/apis/intake/v2/workspaces/workspace/spans';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/apis/intake/v2/workspaces/workspace/spans"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.example.com/apis/intake/v2/workspaces/workspace/spans")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.example.com/apis/intake/v2/workspaces/workspace/spans")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/apis/intake/v2/workspaces/workspace/spans');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/apis/intake/v2/workspaces/workspace/spans");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/apis/intake/v2/workspaces/workspace/spans")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```