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

# Get Trace

GET https://host.com/apis/intake/v2/workspaces/{workspace}/traces/{id}

Reference: https://nemo-platform.docs.buildwithfern.com/nemo/platform/nemo/platform/documentation/reference/api-reference/traces/get-trace-apis-intake-v-2-workspaces-workspace-traces-id-get

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Nemo Platform API
  version: 1.0.0
paths:
  /apis/intake/v2/workspaces/{workspace}/traces/{id}:
    get:
      operationId: get-trace-apis-intake-v-2-workspaces-workspace-traces-id-get
      summary: Get Trace
      tags:
        - subpackage_traces
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
        - name: id
          in: path
          required: true
          schema:
            type: string
        - name: mode
          in: query
          description: >-
            Use summary for root-span trace fields only, or detailed to include
            token, cost, and span-count rollups.
          required: false
          schema:
            $ref: >-
              #/components/schemas/ApisIntakeV2WorkspacesWorkspaceTracesIdGetParametersMode
            default: detailed
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Trace'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
servers:
  - url: https://host.com
    description: Default
components:
  schemas:
    ApisIntakeV2WorkspacesWorkspaceTracesIdGetParametersMode:
      type: string
      enum:
        - summary
        - detailed
      default: detailed
      description: >-
        Use summary for root-span trace fields only, or detailed to include
        token, cost, and span-count rollups.
      title: ApisIntakeV2WorkspacesWorkspaceTracesIdGetParametersMode
    SpanEvaluationContext:
      type: object
      properties:
        evaluation_id:
          type: string
        evaluation_sha:
          type: string
        evaluation_run_id:
          type: string
        dataset_id:
          type: string
        dataset_name:
          type: string
        dataset_version:
          type: string
        test_case_id:
          type: string
        metadata:
          type: object
          additionalProperties:
            description: Any type
      title: SpanEvaluationContext
    SpanStatus:
      type: string
      enum:
        - success
        - error
        - cancelled
        - unknown
      title: SpanStatus
    Trace:
      type: object
      properties:
        id:
          type: string
        root_span_id:
          type: string
        session_id:
          type: string
        workspace:
          type: string
        name:
          type: string
        evaluation_context:
          $ref: '#/components/schemas/SpanEvaluationContext'
        started_at:
          type: string
          format: date-time
        ended_at:
          type: string
          format: date-time
        duration_ms:
          type: number
          format: double
        status:
          $ref: '#/components/schemas/SpanStatus'
        input_tokens:
          type: integer
        output_tokens:
          type: integer
        cached_tokens:
          type: integer
        total_tokens:
          type: integer
        cost_usd:
          type: number
          format: double
        cost_input_usd:
          type: number
          format: double
        cost_output_usd:
          type: number
          format: double
        span_count:
          type: integer
        error_count:
          type: integer
      required:
        - id
        - session_id
        - workspace
        - started_at
        - status
      title: Trace
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
        input:
          description: Any type
        ctx:
          type: object
          additionalProperties:
            description: Any type
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError

```

## Examples



**Request**

```json
{}
```

**Response**

```json
{
  "id": "trace-9f8b7c6d-1234-4a56-b789-0a1b2c3d4e5f",
  "session_id": "session-20240115-093000",
  "workspace": "nemo-analytics",
  "started_at": "2024-01-15T09:30:00Z",
  "status": "success",
  "root_span_id": "span-1a2b3c4d5e6f7g8h",
  "name": "User Login Flow Trace",
  "evaluation_context": {
    "evaluation_id": "eval-20240115-001",
    "evaluation_sha": "a1b2c3d4e5f67890123456789abcdef123456789",
    "evaluation_run_id": "run-20240115-01",
    "dataset_id": "dataset-user-auth-2024",
    "dataset_name": "User Authentication Dataset",
    "dataset_version": "v1.2.3",
    "test_case_id": "tc-login-success",
    "metadata": {
      "environment": "production",
      "region": "us-east-1"
    }
  },
  "ended_at": "2024-01-15T09:30:01Z",
  "duration_ms": 1023.5,
  "input_tokens": 150,
  "output_tokens": 300,
  "cached_tokens": 50,
  "total_tokens": 400,
  "cost_usd": 0.0125,
  "cost_input_usd": 0.0045,
  "cost_output_usd": 0.008,
  "span_count": 5,
  "error_count": 0
}
```

**SDK Code**

```python
import requests

url = "https://host.com/apis/intake/v2/workspaces/workspace/traces/id"

payload = {}
headers = {"Content-Type": "application/json"}

response = requests.get(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://host.com/apis/intake/v2/workspaces/workspace/traces/id';
const options = {method: 'GET', headers: {'Content-Type': 'application/json'}, body: '{}'};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://host.com/apis/intake/v2/workspaces/workspace/traces/id"

	payload := strings.NewReader("{}")

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

	req.Header.Add("Content-Type", "application/json")

	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://host.com/apis/intake/v2/workspaces/workspace/traces/id")

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

request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

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://host.com/apis/intake/v2/workspaces/workspace/traces/id")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://host.com/apis/intake/v2/workspaces/workspace/traces/id', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://host.com/apis/intake/v2/workspaces/workspace/traces/id");
var request = new RestRequest(Method.GET);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://host.com/apis/intake/v2/workspaces/workspace/traces/id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```