Skip to content

Model provider

OpenAI + Cloudmind

Trace every OpenAI chat completion, embedding and assistant run with a one-line client wrapper. Full token and cost accounting included.

How it works

The OpenAI integration wraps your existing client object. Every call made through the wrapped client is traced with the full message array, the completion, token counts priced at current rates, latency, and any errors or retries.

Streaming is supported: Cloudmind records time to first token separately from total duration, and reassembles the streamed completion into the trace.

Setup

import OpenAI from "openai";
import { monitorOpenAI } from "@cloudmind-ai/js/openai";

const openai = monitorOpenAI(new OpenAI());

const result = await openai.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "Hello" }],
});

Supported

  • Chat completions

  • Streaming completions

  • Embeddings

  • Assistants and threads

  • Function and tool calling

  • Structured outputs

Stop guessing whether your AI feature got better

Free for 50,000 traces a month. No credit card, no sales call, five minutes to your first trace.

Start free