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

# OTLP/HTTP ingest endpoint (OTel GenAI semconv v1.29.0)

> Accepts an OpenTelemetry `ExportTraceServiceRequest` payload, either as
protobuf (`application/x-protobuf`) or JSON (`application/json`). Maps
OTel GenAI semantic convention attributes onto TruLayer's span model
and routes each span through the standard ingestion pipeline
(Kafka → processor → TimescaleDB).

Point your OTel Collector's `otlphttp` exporter at this URL to
dual-ship traces to TruLayer without a second SDK.




## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/otlp/traces
openapi: 3.1.0
info:
  title: TruLayer API
  version: 0.1.0
  description: |
    Trace ingestion, evaluation, query, and feedback API for TruLayer AI.

    ### Authentication

    Two auth schemes coexist: SDK API keys (`Authorization: Bearer tl_...`)
    and Clerk session JWTs (dashboard). Routes marked "requires Clerk auth"
    in their summary are unreachable via API key.

    ### Roles (TRU-234)

    Dashboard requests carry one of three organization roles: `owner`,
    `member`, `viewer`. Endpoints enforce role allowlists, not rank
    comparisons. See `docs/security.md` for the full role-permission
    matrix.

    - **owner** — full control including billing, member management,
      destructive deletes on failure-rules/model-routes/webhooks/eval-rules,
      control-loop execution, and DLQ resolution.
    - **member** — read + write (ingest, feedback, evals, API keys,
      projects, failure-rules, model-routes, webhooks).
    - **viewer** — read-only dashboard access plus compliance read access
      to `/v1/audit-log` and `/v1/dlq`.
servers:
  - url: https://api.trulayer.ai
    description: Production
  - url: http://localhost:8080
    description: Local development
security:
  - BearerAuth: []
tags:
  - name: health
  - name: ingest
  - name: traces
  - name: metrics
  - name: feedback
  - name: evals
  - name: eval-rules
  - name: control
  - name: apikeys
  - name: model-routes
  - name: datasets
  - name: search
  - name: anomaly
  - name: webhooks
  - name: failure-rules
  - name: eval-runs
  - name: ci
  - name: otlp
  - name: billing
  - name: deprecations
  - name: audit
  - name: failures
  - name: projects
  - name: compliance
  - name: dsr
  - name: policies
  - name: members
paths:
  /v1/otlp/traces:
    post:
      tags:
        - otlp
        - ingest
      summary: OTLP/HTTP ingest endpoint (OTel GenAI semconv v1.29.0)
      description: |
        Accepts an OpenTelemetry `ExportTraceServiceRequest` payload, either as
        protobuf (`application/x-protobuf`) or JSON (`application/json`). Maps
        OTel GenAI semantic convention attributes onto TruLayer's span model
        and routes each span through the standard ingestion pipeline
        (Kafka → processor → TimescaleDB).

        Point your OTel Collector's `otlphttp` exporter at this URL to
        dual-ship traces to TruLayer without a second SDK.
      operationId: otlpIngestTraces
      requestBody:
        required: true
        content:
          application/x-protobuf:
            schema:
              type: string
              format: binary
          application/json:
            schema:
              $ref: '#/components/schemas/OTLPExportTraceServiceRequest'
      responses:
        '200':
          description: >-
            OTLP `ExportTraceServiceResponse`. `partial_success` is populated
            iff one or more spans failed to persist.
          content:
            application/x-protobuf:
              schema:
                type: string
                format: binary
            application/json:
              schema:
                $ref: '#/components/schemas/OTLPExportTraceServiceResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '413':
          description: Request body exceeds 20 MiB
        '415':
          description: >-
            Unsupported Content-Type (must be application/x-protobuf or
            application/json)
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    OTLPExportTraceServiceRequest:
      type: object
      description: OTLP ExportTraceServiceRequest — passthrough of the OTel protobuf shape.
      properties:
        resourceSpans:
          type: array
          items:
            $ref: '#/components/schemas/OTLPResourceSpans'
    OTLPExportTraceServiceResponse:
      type: object
      properties:
        partialSuccess:
          type: object
          properties:
            rejectedSpans:
              type: integer
              format: int64
            errorMessage:
              type: string
    OTLPResourceSpans:
      type: object
      properties:
        resource:
          type: object
          properties:
            attributes:
              type: array
              items:
                $ref: '#/components/schemas/OTLPKeyValue'
        scopeSpans:
          type: array
          items:
            $ref: '#/components/schemas/OTLPScopeSpans'
        schemaUrl:
          type: string
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
    OTLPKeyValue:
      type: object
      properties:
        key:
          type: string
        value:
          type: object
          description: >-
            OTel AnyValue — one of stringValue, intValue, boolValue,
            doubleValue, arrayValue, kvlistValue, bytesValue.
          additionalProperties: true
    OTLPScopeSpans:
      type: object
      properties:
        scope:
          type: object
          properties:
            name:
              type: string
            version:
              type: string
        spans:
          type: array
          items:
            $ref: '#/components/schemas/OTLPSpan'
        schemaUrl:
          type: string
    OTLPSpan:
      type: object
      properties:
        traceId:
          type: string
          description: 128-bit trace id
          base64 or hex per OTel transport: null
        spanId:
          type: string
          description: 64-bit span id
          base64 or hex per OTel transport: null
        parentSpanId:
          type: string
        name:
          type: string
        startTimeUnixNano:
          type: string
          format: int64
        endTimeUnixNano:
          type: string
          format: int64
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/OTLPKeyValue'
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: SDK API key (`tl_...`) or Clerk session JWT

````