OpenAI
Ingest traces from this provider into AITracer via the SDK or API.
Agent Lab: Run local Ollama agents in the dashboard — no SDK required (Quick Start). This guide is for ingesting traces from this provider via the SDK or API.
Use the SDK or API to store OpenAI runs in AITracer — the same Traces view you get from Agent Lab and coach.
Each ingested record typically includes:
- prompt and response text
- model and action name
- token counts and latency
- optional tool-call metadata
Production runs land next to local Ollama traces, so you can search history, compare coach sessions, and export training data from one place.
OpenAI integration workflow
Standard API requests
After your app calls the Chat Completions or Responses API, call trace.record (or POST /api/traces) with:
prompt/response(or structured input/output)model(e.g.gpt-4o)metrics:promptTokens,completionTokens,latencyMsactionNameorworkflowfor filtering in the dashboard
See Trace Ingestion API for the full schema.
Tool and agent workflows
If OpenAI triggers function calls or multi-step agents, include tool metadata in parameters or nested spans (OpenAI Agents guide: OpenAI Agents Integration).
Useful fields:
- function name and arguments
- retry count
- failure reason
- parent trace or conversation id
Coach and training
Traces from OpenAI ingest can be:
- reviewed in Traces alongside Agent Lab runs
- sent through Coach if you copy a production example into a local draft
- exported from Training when marked curated (
trainingPreferred)
You do not need governance or verification enabled to use these flows.
Optional advanced (production compliance)
If your deployment enables them on ingest:
- Governance Engine — policy and PII signals
- Verification Layer — integrity checks
- Audit Vault — long-term audit exports
Most Agent Lab users can skip this section until they have a concrete compliance requirement.