Send traces to Langtrace using the OpenTelemetry trace format. This endpoint accepts traces for various operations including OpenAI chat completions, function calls, and other LLM interactions.

Headers

x-api-key
string
required

Your Langtrace API key

Content-Type
string
required

Must be application/json

User-Agent
string
required

Must be opentelemetry-python

Body

resourceSpans
array
required

Array of resource spans containing trace data

resourceSpans[].resource.attributes
object
required

Resource attributes identifying the service and environment

resourceSpans[].scopeSpans
array
required

Array of scope spans containing individual operation traces

resourceSpans[].scopeSpans[].spans
array
required

Array of spans representing individual operations

Request Example for OpenAI Chat Completion

Response

status
number

HTTP status code (200 for success)

message
string

Success or error message

Error Codes

401
string

Invalid or missing API key

400
string

Invalid request format or missing required fields

500
string

Internal server error