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

# Ingest Chat Completion

POST /apis/intake/v2/workspaces/{workspace}/ingest/chat-completions
Content-Type: application/json

Reference: https://docs.nvidia.com/nemo-helix/v0.5.1/documentation/reference/api-reference/ingest/chat-completion-apis-intake-v-2-workspaces-workspace-ingest-chat-completions-post

## Request

### Path parameters

- `workspace` (string, required)

### Body (application/json)

This endpoint expects a ChatCompletionsIngestRequest.

- `request` (CapturedChatCompletionsRequest, required) — Flexible captured chat-completions request.
- `response` (CapturedChatCompletionsResponse, required) — Flexible captured chat-completions response.
- `evaluation_context` (EvaluationContext, optional) — Identifies the Evaluation and optional test case associated with ingested telemetry.
- `session_id` (string, optional) — Groups related chat-completions calls without forcing them into the same trace.
- `trace_id` (string, optional) — Opt into joining an existing trace built via OTel or ATIF. This is not a grouping mechanism for chat-completions calls; use session_id to group related calls.
- `provider` (string, optional)
- `cost_usd` (double, optional) — Total estimated cost of this model call in USD. This matches ATIF step metrics; Intake stores it as semantic cost_total_usd on spans.
- `cost_input_usd` (double, optional) — Estimated input-token cost of this model call in USD.
- `cost_output_usd` (double, optional) — Estimated output-token cost of this model call in USD.
- `cost_details` (map from string to double, optional) — Additional estimated cost breakdown fields in USD.

## Response

### 201

Successful Response

- `session_id` (string, required)
- `span_id` (string, required)

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### CapturedChatCompletionsRequest

Flexible captured chat-completions request.

- `messages` (list of CapturedChatMessage, required) — Messages comprising the conversation.
- `model` (string, required) — The model identifier used for this request.

### CapturedChatCompletionsResponse

Flexible captured chat-completions response.

- `choices` (list of map from string to any, optional)
- `error` (map from string to any, optional)

### EvaluationContext

Identifies the Evaluation and optional test case associated with ingested telemetry.

- `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.

### ValidationError

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

### CapturedChatMessage

A flexible message model that requires a valid role field but allows provider-specific fields.

- `role` (enum, required) — The role of the message sender.
  - Allowed values: `user`, `system`, `assistant`, `developer`, `tool`, `function`

### ValidationErrorLocItems

## Examples

**Request**

```json
{
  "request": {
    "messages": [
      {
        "role": "user"
      }
    ],
    "model": "string"
  },
  "response": {
    "error": {}
  }
}
```

**Response**

```json
{
  "session_id": "string",
  "span_id": "string"
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/apis/intake/v2/workspaces/workspace/ingest/chat-completions"

payload = {
    "request": {
        "messages": [{ "role": "user" }],
        "model": "string"
    },
    "response": { "error": {} }
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript
const url = 'https://api.example.com/apis/intake/v2/workspaces/workspace/ingest/chat-completions';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"request":{"messages":[{"role":"user"}],"model":"string"},"response":{"error":{}}}'
};

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://api.example.com/apis/intake/v2/workspaces/workspace/ingest/chat-completions"

	payload := strings.NewReader("{\n  \"request\": {\n    \"messages\": [\n      {\n        \"role\": \"user\"\n      }\n    ],\n    \"model\": \"string\"\n  },\n  \"response\": {\n    \"error\": {}\n  }\n}")

	req, _ := http.NewRequest("POST", 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://api.example.com/apis/intake/v2/workspaces/workspace/ingest/chat-completions")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"request\": {\n    \"messages\": [\n      {\n        \"role\": \"user\"\n      }\n    ],\n    \"model\": \"string\"\n  },\n  \"response\": {\n    \"error\": {}\n  }\n}"

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.post("https://api.example.com/apis/intake/v2/workspaces/workspace/ingest/chat-completions")
  .header("Content-Type", "application/json")
  .body("{\n  \"request\": {\n    \"messages\": [\n      {\n        \"role\": \"user\"\n      }\n    ],\n    \"model\": \"string\"\n  },\n  \"response\": {\n    \"error\": {}\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/apis/intake/v2/workspaces/workspace/ingest/chat-completions', [
  'body' => '{
  "request": {
    "messages": [
      {
        "role": "user"
      }
    ],
    "model": "string"
  },
  "response": {
    "error": {}
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/apis/intake/v2/workspaces/workspace/ingest/chat-completions");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"request\": {\n    \"messages\": [\n      {\n        \"role\": \"user\"\n      }\n    ],\n    \"model\": \"string\"\n  },\n  \"response\": {\n    \"error\": {}\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "request": [
    "messages": [["role": "user"]],
    "model": "string"
  ],
  "response": ["error": []]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/apis/intake/v2/workspaces/workspace/ingest/chat-completions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```