> For the complete documentation index, see [llms.txt](https://docs.otari.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otari.ai/api-reference/otel.md).

# OTel

## Receive Logs

> Ingest LLM usage from OTLP log events (Claude Code, Codex, or GenAI logs).

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.33.0"},"security":[{"ApiKeyAuth":[]},{"XApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"description":"Enter your API key here (sent as Otari-Key header).","in":"header","name":"Otari-Key","type":"apiKey"},"XApiKeyAuth":{"description":"Anthropic-native clients send credentials here (no Bearer prefix).","in":"header","name":"x-api-key","type":"apiKey"}}},"paths":{"/otlp/v1/logs":{"post":{"description":"Ingest LLM usage from OTLP log events (Claude Code, Codex, or GenAI logs).","operationId":"otel-receive_logs","responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"}},"summary":"Receive Logs","tags":["otel"]}}}}
```

## Receive Metrics

> Ingest content-free coding-agent outcome metrics from OTLP metric points.\
> \
> Records the outcome counters a coding agent reports on the metrics signal and\
> that Otari has no other source for: lines of code changed, commits, pull\
> requests, and active time. Points are stored exactly as reported, with their\
> OTLP series identity, so a cumulative counter is turned into an increment at\
> read time rather than re-counted on every export. Metrics that duplicate an\
> already-recorded signal (token/cost usage, already billed; edit decisions,\
> already captured as behavioral events) are skipped, as is any metric name this\
> gateway does not know, so a newer agent version never breaks reception.\
> \
> Outcome metrics are never billable: they touch no budget and no spend. Capture\
> answers to the same \`\`capture\_agent\_telemetry\`\` toggle as behavioral events;\
> with it off, the export still succeeds and simply stores nothing.

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.33.0"},"security":[{"ApiKeyAuth":[]},{"XApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"description":"Enter your API key here (sent as Otari-Key header).","in":"header","name":"Otari-Key","type":"apiKey"},"XApiKeyAuth":{"description":"Anthropic-native clients send credentials here (no Bearer prefix).","in":"header","name":"x-api-key","type":"apiKey"}}},"paths":{"/otlp/v1/metrics":{"post":{"description":"Ingest content-free coding-agent outcome metrics from OTLP metric points.\n\nRecords the outcome counters a coding agent reports on the metrics signal and\nthat Otari has no other source for: lines of code changed, commits, pull\nrequests, and active time. Points are stored exactly as reported, with their\nOTLP series identity, so a cumulative counter is turned into an increment at\nread time rather than re-counted on every export. Metrics that duplicate an\nalready-recorded signal (token/cost usage, already billed; edit decisions,\nalready captured as behavioral events) are skipped, as is any metric name this\ngateway does not know, so a newer agent version never breaks reception.\n\nOutcome metrics are never billable: they touch no budget and no spend. Capture\nanswers to the same ``capture_agent_telemetry`` toggle as behavioral events;\nwith it off, the export still succeeds and simply stores nothing.","operationId":"otel-receive_metrics","responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"}},"summary":"Receive Metrics","tags":["otel"]}}}}
```

## Receive Traces

> Ingest LLM usage from OTLP spans (GenAI semantic conventions).

```json
{"openapi":"3.1.0","info":{"title":"otari","version":"0.33.0"},"security":[{"ApiKeyAuth":[]},{"XApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"description":"Enter your API key here (sent as Otari-Key header).","in":"header","name":"Otari-Key","type":"apiKey"},"XApiKeyAuth":{"description":"Anthropic-native clients send credentials here (no Bearer prefix).","in":"header","name":"x-api-key","type":"apiKey"}}},"paths":{"/otlp/v1/traces":{"post":{"description":"Ingest LLM usage from OTLP spans (GenAI semantic conventions).","operationId":"otel-receive_traces","responses":{"200":{"content":{"application/json":{"schema":{}}},"description":"Successful Response"}},"summary":"Receive Traces","tags":["otel"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.otari.ai/api-reference/otel.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
