Skip to main content
POST
/
v0
/
otel
/
traces
Ingest OTLP traces
curl --request POST \
  --url https://api.avidoai.com/v0/otel/traces \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --header 'x-application-id: <api-key>' \
  --data '
{
  "resourceSpans": [
    {
      "scopeSpans": [
        {
          "spans": [
            {
              "traceId": "4bf92f3577b34da6a3ce929d0e0e4736",
              "spanId": "00f067aa0ba902b7",
              "name": "llm.generate",
              "startTimeUnixNano": "1737052800000000000",
              "endTimeUnixNano": "1737052800500000000",
              "attributes": [
                {
                  "key": "openinference.span.kind",
                  "value": {
                    "stringValue": "LLM"
                  }
                },
                {
                  "key": "llm.model_name",
                  "value": {
                    "stringValue": "gpt-4o-2024-08-06"
                  }
                },
                {
                  "key": "input.value",
                  "value": {
                    "stringValue": "Tell me a joke."
                  }
                },
                {
                  "key": "output.value",
                  "value": {
                    "stringValue": "Why did the chicken cross the road?"
                  }
                },
                {
                  "key": "llm.token_count.prompt",
                  "value": {
                    "intValue": 12
                  }
                },
                {
                  "key": "llm.token_count.completion",
                  "value": {
                    "intValue": 18
                  }
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}
'
{
  "data": [
    {
      "success": true,
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "error": "Failed to write to database"
    }
  ]
}

Authorizations

x-api-key
string
header
required

Your unique Avido API key

x-application-id
string
header
required

Your unique Avido Application ID

Body

application/json

OpenTelemetry Protocol traces request payload in JSON format. Contains resourceSpans array with nested spans, attributes, and metadata following the OTLP specification.

resourceSpans
OTLP Resource Span · object[]

Response

Successfully ingested OTLP traces.

Response schema for successful event ingestion.

data
object[]
required

Array of results for each ingested event.