> 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 Span

GET https://host.com/apis/intake/v2/workspaces/{workspace}/spans/{span_id}

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Nemo Platform API
  version: 1.0.0
paths:
  /apis/intake/v2/workspaces/{workspace}/spans/{span_id}:
    get:
      operationId: get-span-apis-intake-v-2-workspaces-workspace-spans-span-id-get
      summary: Get Span
      tags:
        - subpackage_spans
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
        - name: span_id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Span'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
servers:
  - url: https://host.com
    description: Default
components:
  schemas:
    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
    SpanKind:
      type: string
      enum:
        - LLM
        - CHAIN
        - TOOL
        - RETRIEVER
        - EMBEDDING
        - AGENT
        - RERANKER
        - EVALUATOR
        - GUARDRAIL
        - UNKNOWN
      title: SpanKind
    SpanStatus:
      type: string
      enum:
        - success
        - error
        - cancelled
        - unknown
      title: SpanStatus
    Span:
      type: object
      properties:
        span_id:
          type: string
        session_id:
          type: string
        workspace:
          type: string
        project:
          type: string
        evaluation_context:
          $ref: '#/components/schemas/SpanEvaluationContext'
        parent_span_id:
          type: string
        kind:
          $ref: '#/components/schemas/SpanKind'
        name:
          type: string
        source:
          type: string
        trace_id:
          type: string
        started_at:
          type: string
          format: date-time
        ended_at:
          type: string
          format: date-time
        status:
          $ref: '#/components/schemas/SpanStatus'
        error_type:
          type: string
        error_message:
          type: string
        provider:
          type: string
        model:
          type: string
        prompt_id:
          type: string
        prompt_name:
          type: string
        prompt_version:
          type: string
        agent_id:
          type: string
        agent_name:
          type: string
        tool_name:
          type: string
        input_tokens:
          type: integer
        output_tokens:
          type: integer
        cached_tokens:
          type: integer
        total_tokens:
          type: integer
        usage_details:
          type: object
          additionalProperties:
            type: integer
        cost_total_usd:
          type: number
          format: double
        cost_input_usd:
          type: number
          format: double
        cost_output_usd:
          type: number
          format: double
        cost_details:
          type: object
          additionalProperties:
            type: number
            format: double
        input:
          type: string
        output:
          type: string
        raw_attributes:
          type: string
        ingested_at:
          type: string
          format: date-time
      required:
        - span_id
        - session_id
        - workspace
        - kind
        - source
        - started_at
        - status
        - ingested_at
      title: Span
    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
{
  "span_id": "a3f5c9d2-7b4e-4f1a-9c3e-2d8f7b6a1e4c",
  "session_id": "session-987654321",
  "workspace": "marketing-team",
  "kind": "LLM",
  "source": "nemo-platform",
  "started_at": "2024-01-15T09:30:00Z",
  "status": "success",
  "ingested_at": "2024-01-15T09:30:10Z",
  "project": "ad-campaign-2024",
  "evaluation_context": {
    "evaluation_id": "eval-20240115-001",
    "evaluation_sha": "d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3",
    "evaluation_run_id": "run-20240115-01",
    "dataset_id": "dataset-2024-q1",
    "dataset_name": "Q1 Marketing Dataset",
    "dataset_version": "v1.2.3",
    "test_case_id": "tc-1001",
    "metadata": {
      "environment": "production",
      "region": "us-east-1"
    }
  },
  "parent_span_id": "b2d3e4f5-6a7b-8c9d-0e1f-2a3b4c5d6e7f",
  "name": "Generate Ad Copy",
  "trace_id": "trace-1234567890abcdef",
  "ended_at": "2024-01-15T09:30:05Z",
  "error_type": "",
  "error_message": "",
  "provider": "OpenAI",
  "model": "gpt-4-turbo",
  "prompt_id": "prompt-abc123",
  "prompt_name": "Ad Copy Generator",
  "prompt_version": "v2.0",
  "agent_id": "agent-42",
  "agent_name": "MarketingBot",
  "tool_name": "TextGenerator",
  "input_tokens": 150,
  "output_tokens": 200,
  "cached_tokens": 0,
  "total_tokens": 350,
  "usage_details": {
    "input_tokens": 150,
    "output_tokens": 200,
    "cached_tokens": 0
  },
  "cost_total_usd": 0.035,
  "cost_input_usd": 0.015,
  "cost_output_usd": 0.02,
  "cost_details": {
    "input_cost": 0.015,
    "output_cost": 0.02
  },
  "input": "Create a catchy ad copy for our new product launch targeting young adults.",
  "output": "Introducing the all-new XPhone! Sleek, powerful, and designed just for you. Get yours today and experience innovation like never before!",
  "raw_attributes": "{\"language\":\"en\",\"tone\":\"energetic\"}"
}
```

**SDK Code**

```python
import requests

url = "https://host.com/apis/intake/v2/workspaces/workspace/spans/span_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/spans/span_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/spans/span_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/spans/span_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/spans/span_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/spans/span_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/spans/span_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/spans/span_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()
```