Skip to content

Import from the OpenAI dashboard

Do the shared setup first: an ingest key, pip install metergraphrelay, and a .env holding METERGRAPH_APP_TOKEN.

This path needs no observability tool at all. If your application calls OpenAI with store=True, OpenAI keeps the completion server side, and the relay reads it back. It is the same storage OpenAI’s own dashboard and evals features use.

Stored chat completions, listed through OpenAI’s List Chat Completions API. Only completions created with store=True exist to be read, and an API key only ever sees the completions made with that key.

CredentialsThe OPENAI_API_KEY your application uses
Prerequisitestore=True on the calls you want to import
.env
METERGRAPH_APP_TOKEN=<your ingest key>
OPENAI_API_KEY=sk-...

If your calls do not set store=True yet, add it:

app/llm.py
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "..."}],
store=True,
)
  1. metergraphrelay pull openai -n 100 --route my-app/support-bot --output openai.jsonl
    FlagMeaning
    -n, --countHow many of the most recent stored completions to read. Defaults to 10
    --routeThe route every row lands on. Defaults to openai/backfill
    --include-contentCopy the prompt and response text. Off by default
    --outputWhere to write the JSONL. Defaults to ./traces.jsonl
    --stdoutEcho each row as it is written

    There are no time selectors here. The relay reads the most recent stored completions in descending order, so -n is the only bound.

    Add --include-content only if the prompt and response text may be copied. This is the one import path where content is opt in rather than automatic.

  2. head -n 2 openai.jsonl
    metergraphrelay push openai.jsonl

    metergraphrelay sync openai runs both steps in one command and takes the same flags. It is a convenience, not a scheduled mode.

  3. Open Traces in Metergraph. Every row carries the route you passed, because OpenAI stores no workflow name for the relay to read. One pull is one route.

Every other source can run hourly from cron, holding a checkpoint on the Metergraph side. OpenAI cannot. The server’s list of sources that may take a sync lease is portkey, langfuse, braintrust, phoenix and langsmith (app/src/metergraph_app/import_identity.py:30), and OpenAI is deliberately not on it.

That means OpenAI rows carry no import identity and are not deduplicated. Two pulls over overlapping stored completions import the same call twice. Track what you have loaded, or use -n deliberately.

If you want ongoing capture of OpenAI traffic, instrument the application instead: see OpenAI.

FieldWhere it comes from
RouteWhatever you pass with --route, or openai/backfill
TimestampThe completion’s created time
ProviderAlways openai
ModelThe completion’s model
EndpointAlways chat.completions
Input and output tokensThe completion’s prompt_tokens and completion_tokens
StatusAlways success. A stored completion is one that succeeded
Request idThe completion’s id
TagsThe completion’s metadata object
ContentOnly with --include-content. The request messages and the first choice’s reply

Cost is not carried. Metergraph prices these rows from its own catalog.

  • Cache, cache write and reasoning token buckets. The stored completion exposes only the prompt and completion totals.
  • Latency. Nothing in stored completions records it.
  • Trace, span and session ids. Each row stands alone, so imported OpenAI calls do not assemble into traces.
  • Failed calls. Only successful completions are stored, so a failed call and the input tokens it spent are invisible on this path.
  • Function attribution, streaming detail, outcomes and repository identity, as on every import path.
SymptomLikely causeWhat to do
No stored completions foundThe calls were not made with store=True, or were made with a different keyAdd store=True and use that application’s key
Content columns are empty--include-content was not passedPass it, if the content may be copied
Every route is openai/backfillNo --route was passedPass one. OpenAI stores no workflow name
Rows counted twiceTwo pulls covered the same completionsThis path does not deduplicate