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

## Changes

- **2026-07-02** `3144ea40dac0` — 1 info
  - added the new `evaluator` enum value to the request property `source`
- **2026-05-08** `b9100cf75dd3` — 1 info
  - added the new optional request property `environment`
- **2026-05-04** `d606e84c75e4` — 1 breaking, 1 warning
  - removed the enum value `evaluator` of the request property `source`
  - removed the request property `environment`

[Change history](https://skmtc.dev/comet-ml/apis/opik-rest-api/changes/v1/private/traces/post.md)

---

[API](https://skmtc.dev/comet-ml/apis/opik-rest-api.md) · [All operations](https://skmtc.dev/comet-ml/apis/opik-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/comet-ml/opik-rest-api/revisions/0739fa5022ca/schema)
