trace

Log Traces

post/v2/projects/{project_id}/traces

Path parameters

project_idstring uuid4 required

Request body

log_stream_idstring uuid4 nullable

Log stream id associated with the traces.

experiment_idstring uuid4 nullable

Experiment id associated with the traces.

metrics_testing_idstring uuid4 nullable

Metrics testing id associated with the traces.

logging_method'playground' | 'python_client' | 'typescript_client' | 'api_direct'
client_versionstring nullable
reliableboolean

Whether or not to use reliable logging. If set to False, the method will respond immediately before verifying that the traces have been successfully ingested, and no error message will be returned if ingestion fails. If set to True, the method will wait for the traces to be successfully ingested or return an error message if there is an ingestion failure.

session_idstring uuid4 nullable

Session id associated with the traces.

session_external_idstring nullable

External id of the session (e.g., OTEL session.id from span attributes).

is_completeboolean

Whether or not the records in this request are complete.

include_trace_idsboolean

If True, include the list of ingested trace IDs in the response.

Example request

{
  "log_stream_id": "00000000-0000-0000-0000-000000000000",
  "session_id": "00000000-0000-0000-0000-000000000000",
  "traces": [
    {
      "created_at": "2026-08-24T20:58:23.594985Z",
      "dataset_metadata": {},
      "input": "who is a smart LLM?",
      "metrics": {},
      "name": "",
      "output": "I am!",
      "spans": [
        {
          "created_at": "2026-08-24T20:58:23.594950Z",
          "dataset_metadata": {},
          "input": [
            {
              "content": "Question: who is a smart LLM?",
              "role": "user"
            }
          ],
          "metrics": {},
          "name": "",
          "output": {
            "content": "I am!",
            "role": "user"
          },
          "tags": [],
          "type": "llm",
          "user_metadata": {}
        }
      ],
      "tags": [],
      "type": "trace",
      "user_metadata": {}
    }
  ]
}

Response

Successful Response

log_stream_idstring uuid4 nullable

Log stream id associated with the traces.

experiment_idstring uuid4 nullable

Experiment id associated with the traces.

metrics_testing_idstring uuid4 nullable

Metrics testing id associated with the traces.

project_idstring uuid4 required

Project id associated with the traces.

project_namestring required

Project name associated with the traces.

session_idstring uuid4 nullable

Session id associated with the traces.

records_countinteger required

Total number of records ingested

traces_countinteger required

total number of traces ingested

spans_countinteger required

total number of spans ingested

trace_idsstring[] nullable

List of trace IDs that were ingested. Only included if include_trace_ids=True in request.

Changes

Changed in 3 of the 14 revisions of this API.18

    • added the new optional request property traces/items/spans/items/oneOf[subschema #1: AgentSpan]/spans/items/oneOf[subschema #2: WorkflowSpan]/spans/items/oneOf[subschema #3: LlmSpan]/provider

      new-optional-request-property

    • added the new optional request property traces/items/spans/items/oneOf[subschema #1: AgentSpan]/spans/items/oneOf[subschema #2: WorkflowSpan]/spans/items/oneOf[subschema #4: RetrieverSpan]/spans/items/oneOf[subschema #3: LlmSpan]/provider

      new-optional-request-property

    • added the new optional request property traces/items/spans/items/oneOf[subschema #1: AgentSpan]/spans/items/oneOf[subschema #2: WorkflowSpan]/spans/items/oneOf[subschema #4: RetrieverSpan]/spans/items/oneOf[subschema #5: ToolSpan]/spans/items/oneOf[subschema #3: LlmSpan]/provider

      new-optional-request-property

    • added the new optional request property traces/items/spans/items/oneOf[subschema #1: AgentSpan]/spans/items/oneOf[subschema #2: WorkflowSpan]/spans/items/oneOf[subschema #5: ToolSpan]/spans/items/oneOf[subschema #3: LlmSpan]/provider

      new-optional-request-property

    • added the new optional request property traces/items/spans/items/oneOf[subschema #1: AgentSpan]/spans/items/oneOf[subschema #3: LlmSpan]/provider

      new-optional-request-property

    • added the new optional request property traces/items/spans/items/oneOf[subschema #1: AgentSpan]/spans/items/oneOf[subschema #4: RetrieverSpan]/spans/items/oneOf[subschema #3: LlmSpan]/provider

      new-optional-request-property

    • added the new optional request property traces/items/spans/items/oneOf[subschema #1: AgentSpan]/spans/items/oneOf[subschema #4: RetrieverSpan]/spans/items/oneOf[subschema #5: ToolSpan]/spans/items/oneOf[subschema #3: LlmSpan]/provider

      new-optional-request-property

    • added the new optional request property traces/items/spans/items/oneOf[subschema #1: AgentSpan]/spans/items/oneOf[subschema #5: ToolSpan]/spans/items/oneOf[subschema #3: LlmSpan]/provider

      new-optional-request-property

    • added the new optional request property traces/items/spans/items/oneOf[subschema #2: WorkflowSpan]/spans/items/oneOf[subschema #3: LlmSpan]/provider

      new-optional-request-property

    • added the new optional request property traces/items/spans/items/oneOf[subschema #2: WorkflowSpan]/spans/items/oneOf[subschema #4: RetrieverSpan]/spans/items/oneOf[subschema #3: LlmSpan]/provider

      new-optional-request-property

    • added the new optional request property traces/items/spans/items/oneOf[subschema #2: WorkflowSpan]/spans/items/oneOf[subschema #4: RetrieverSpan]/spans/items/oneOf[subschema #5: ToolSpan]/spans/items/oneOf[subschema #3: LlmSpan]/provider

      new-optional-request-property

    • added the new optional request property traces/items/spans/items/oneOf[subschema #2: WorkflowSpan]/spans/items/oneOf[subschema #5: ToolSpan]/spans/items/oneOf[subschema #3: LlmSpan]/provider

      new-optional-request-property

    • added the new optional request property traces/items/spans/items/oneOf[subschema #3: LlmSpan]/provider

      new-optional-request-property

    • added the new optional request property traces/items/spans/items/oneOf[subschema #4: RetrieverSpan]/spans/items/oneOf[subschema #3: LlmSpan]/provider

      new-optional-request-property

    • added the new optional request property traces/items/spans/items/oneOf[subschema #4: RetrieverSpan]/spans/items/oneOf[subschema #5: ToolSpan]/spans/items/oneOf[subschema #3: LlmSpan]/provider

      new-optional-request-property

    • added the new optional request property traces/items/spans/items/oneOf[subschema #5: ToolSpan]/spans/items/oneOf[subschema #3: LlmSpan]/provider

      new-optional-request-property

    This revision also has 44 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • added the new optional request property traces/items/spans/items/oneOf[subschema #1: AgentSpan]/agent_name

      new-optional-request-property

    This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog

    • the endpoint scheme security ClassicAPIKeyHeader was added to the API

      api-security-added

    This revision also has 15 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog