Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.openlayer.com/llms.txt

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

Every request through the gateway can be published as a trace in Openlayer, with no code in your apps. It’s the visibility side of the gateway: while usage limits and guardrails enforce your rules, observability shows you what actually happened.

Connect your Openlayer project

On the Config page, under Observability:
  • Turn observability on.
  • Set the Openlayer API key env var, the name of the environment variable holding your Openlayer key (set on the gateway host).
  • Paste your inference pipeline ID from the Openlayer project you want traces to land in.
Save, and new requests start showing up as traces in that project.

What’s in a trace

Each trace captures the full shape of the request:
  • The model and provider that served it.
  • Input messages and the output text.
  • Tokens, latency, and cost.
  • Status, success or error, with the error message when one occurs.
  • Any guardrail violations, as steps in the trace.
Every gateway request becomes a trace in Openlayer

Attribute traffic to a user

When an API key is created with a User ID, every request it makes carries that ID into the trace. In Openlayer you can then group and filter traffic by user.

It never blocks a response

Tracing is fire-and-forget. The gateway sends each trace in the background after the response has gone out, so observability never slows a request down, and never fails one if Openlayer is unreachable.

Correlate with your logs

Send an X-Request-ID header with a request and the gateway uses it as the trace ID, so you can line up your own logs with the trace in Openlayer. Omit it and the gateway generates one.

Go further

Traces are the foundation for Openlayer’s monitoring: run tests on your live traffic, track quality over time, and get alerted when something regresses. See the Observability section to set that up.