Skip to main content
Use the REST API to access your development and production observability data from any environment: scripts, dashboards, CI pipelines, or custom integrations.

Prerequisites

  • A Context Company account with at least one project sending data
  • An API key (generated in the next step)

Setup

1

Generate a read-only API key

Go to the Access Data page in your dashboard and create a read-only API key. These keys (prefixed with tcc_key) can only query your data - they cannot ingest traces. Choose an access scope:
Copy your key immediately. You won’t be able to see it again.
Read-only API keys are separate from the ingestion keys (prefixed with tcc_prod) used to send traces from your AI application. Ingestion keys are managed in Settings by admins. Read-only keys can be created by any team member.
2

Make your first request

All endpoints live under https://api.thecontext.company/v1. Pass your key as a Bearer token:

Authentication

Every request requires a Bearer token in the Authorization header:
The key’s scope determines which endpoints you can access. Dev-scoped keys can only query dev data, prod-scoped keys can only query prod data, and dev+prod keys can access both.

Common parameters

Most endpoints accept time-range parameters: You must provide either range or both from and to.

Endpoints

Runs

Sessions

Metrics

Returns aggregate metrics including run count, duration, tokens, and cost.

Models

Returns a breakdown of model usage across your runs.

Tools

Returns a breakdown of tool usage across your runs.

Failures

Returns aggregated error patterns.

Feedback

Returns user feedback metrics over a time range.

Patterns

The patterns, insights, and insight search endpoints require a Pro or Enterprise plan.
Returns detected patterns such as frustration, confusion, and other behavioral signals.

Insights

Returns auto-generated weekly insights.
Insight search requires the monitoring feature on your plan.
Ask natural-language questions about your production data. See insight search for more on what you can ask.