Skip to main content
POST
/
v1
/
ingest
Ingest a single trace
curl --request POST \
  --url https://api.trulayer.ai/v1/ingest \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": "<string>",
  "external_id": "<string>",
  "name": "<string>",
  "input": "<string>",
  "output": "<string>",
  "model": "<string>",
  "latency_ms": 123,
  "cost": 123,
  "error": "<string>",
  "tags": {},
  "metadata": {},
  "spans": [
    {
      "name": "<string>",
      "type": "llm",
      "id": "<string>",
      "parent_span_id": "<string>",
      "input": "<string>",
      "output": "<string>",
      "model": "<string>",
      "latency_ms": 123,
      "cost": 123,
      "error": "<string>",
      "prompt_tokens": 123,
      "completion_tokens": 123,
      "metadata": {},
      "start_time": "2023-11-07T05:31:56Z",
      "end_time": "2023-11-07T05:31:56Z"
    }
  ],
  "events": [
    {
      "message": "<string>",
      "id": "<string>",
      "span_id": "<string>",
      "level": "info",
      "metadata": {}
    }
  ]
}
'
{
  "status": "duplicate"
}

Documentation Index

Fetch the complete documentation index at: https://docs.trulayer.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

SDK API key (tl_...) or Clerk session JWT

Body

application/json
id
string
external_id
string | null
name
string | null
input
string | null
output
string | null
model
string | null
latency_ms
integer | null
cost
number | null
error
string | null
tags
object

User-defined key→value tags for the trace. Maximum 20 keys; keys and values are strings up to 64 characters each. Queryable via the tag_key / tag_value query parameters on GET /v1/traces. Omit or send an empty object when unused.

metadata
object
spans
object[]
events
object[]

Response

Duplicate — already ingested (idempotent)

status
string
required
Example:

"duplicate"