---
title: "Create trace"
method: POST
path: "/v1/private/traces"
tags: ["Traces"]
---

# Create trace

`POST /v1/private/traces`

Get trace

## Request body

- TraceWrite
  - `id` string, uuid
  - `project_name` string — If null, the default project is used
  - `name` string
  - `start_time` string, date-time, required
  - `end_time` string, date-time
  - `input` JsonListStringWrite
  - `output` JsonListStringWrite
  - `metadata` JsonListStringWrite
  - `tags` string[]
  - `error_info` ErrorInfoWrite
    - `exception_type` string, required
    - `message` string
    - `traceback` string, required
  - `last_updated_at` string, date-time
  - `ttft` number, double — Time to first token in milliseconds
  - `thread_id` string
  - `source` 'sdk' | 'experiment' | 'playground' | 'optimization' | 'evaluator'
  - `environment` string

## Response `201`

Created

---

[API](https://skmtc.net/comet-ml/apis/opik-rest-api.md) · [All operations](https://skmtc.net/comet-ml/apis/opik-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/comet-ml/opik-rest-api/versions/4ed2fbc97cc3/schema)
