Quickstart: Vercel AI SDK
In about five minutes, you export a Vercel AI SDK call to Mibo with OpenTelemetry, send one trace, and create a test from it. Mibo evaluates the traces your code sends. It never calls your Agent. If you already export traces to another backend, keep it and add Mibo with the Collector fan-out.
Before you start
Section titled “Before you start”- A Mibo account with a verified email. Mibo rejects traces and AI features until you verify. See Email verification.
- Node.js 22.15 or later.
- AI SDK 7 and an OpenAI API key. Another AI SDK provider works the same way.
1. Set up your Agent in Mibo
Section titled “1. Set up your Agent in Mibo”- Create an account at app.mibo-ai.com, or sign in, and click Set up your Agent.
- Enter an Agent Name and choose the Other agent type. Click Continue to API key.
- Click Create Agent API key and copy the key. Mibo shows it only once. Click I’ve saved it — continue to traces.
- In the Agent navigation, open Set up agent. Set OTLP Service Name to
support-agent-prodand click Save Changes.
Mibo routes each OTLP trace to the Agent whose OTLP Service Name equals the trace’s service.name. A missing name returns 400 OTLP_SERVICE_NAME_REQUIRED, and an unknown one returns 404 OTLP_PLATFORM_NOT_FOUND.
2. Install the packages
Section titled “2. Install the packages”npm install ai @ai-sdk/otel @ai-sdk/openai @opentelemetry/sdk-node @opentelemetry/exporter-trace-otlp-proto zod3. Point the exporter at Mibo
Section titled “3. Point the exporter at Mibo”export OTEL_SERVICE_NAME=support-agent-prodexport OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://api.mibo-ai.com/public/tracesexport OTEL_EXPORTER_OTLP_TRACES_HEADERS=x-api-key=<YOUR_MIBO_API_KEY>export OTEL_METRICS_EXPORTER=noneexport OTEL_LOGS_EXPORTER=noneexport OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>Use the traces-specific OTEL_EXPORTER_OTLP_TRACES_ENDPOINT. The exporter sends to that URL as written. The generic OTEL_EXPORTER_OTLP_ENDPOINT appends /v1/traces, which Mibo does not serve. The last two lines stop the SDK from exporting metrics and logs, which Mibo does not accept.
4. Send your first trace
Section titled “4. Send your first trace”Save this as agent.mjs:
import { OpenTelemetry } from '@ai-sdk/otel';import { openai } from '@ai-sdk/openai';import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-proto';import { NodeSDK } from '@opentelemetry/sdk-node';import { generateText, registerTelemetry, stepCountIs, tool } from 'ai';import { z } from 'zod';
const sdk = new NodeSDK({ traceExporter: new OTLPTraceExporter() });sdk.start();registerTelemetry(new OpenTelemetry({ agentSpanName: 'functionId' }));
const { text } = await generateText({ model: openai('gpt-4o-mini'), system: 'You are a support agent for an online store.', prompt: 'Where is my order A-1042?', tools: { lookupOrder: tool({ description: 'Look up an order by ID', inputSchema: z.object({ orderId: z.string() }), execute: async ({ orderId }) => ({ orderId, status: 'shipped', eta: 'Friday' }), }), }, stopWhen: stepCountIs(3), telemetry: { functionId: 'support-agent' },});
console.log(text);await sdk.shutdown();Run it:
node agent.mjsThe script prints the model’s reply, for example Your order A-1042 has shipped and should arrive on Friday. sdk.shutdown() flushes the trace before the process exits. In a long-running server, start the SDK once at startup instead.
Open the Agent’s Traces page in Mibo. The trace has an invoke_agent support-agent root span, a step span per model step, a chat gpt-4o-mini span per model call, and an execute_tool lookupOrder span.
5. Create your first test
Section titled “5. Create your first test”- In the Agent navigation, open Create tests with AI.
- Click Use real trace. In Ground generation on a real trace, select your trace and click Use this trace.
- Review the generated test cases and click Save. Keep the test enabled, with Passive behavior set to Always run or Run when relevant.
- Run
node agent.mjsagain. Mibo evaluates each new trace against your saved tests. - Open the test and check Last Result.
What Mibo reads from the trace
Section titled “What Mibo reads from the trace”| Data | Attribute | Recorded by default |
|---|---|---|
| User input | gen_ai.input.messages |
Yes, while telemetry.recordInputs is true |
| Final response | gen_ai.output.messages |
Yes, while telemetry.recordOutputs is true |
| Tool calls | gen_ai.tool.name and gen_ai.tool.call.arguments on execute_tool spans |
Arguments only while recordInputs is true |
| Token usage | gen_ai.usage.input_tokens and gen_ai.usage.output_tokens |
Yes |
Both content options default to true. If you set recordInputs: false, Mibo has no user input, so Run when relevant tests are skipped and the trace shows No usable input. Always run tests still run. If you set recordOutputs: false, checks on the reply have no text to read. In AI SDK 7, experimental_telemetry is a deprecated alias of telemetry and takes the same options.
Prompts and replies can contain personal data. Mibo always redacts secrets and redacts personal data when your project enables it. See Data handling.
Endpoint reference
Section titled “Endpoint reference”| Setting | Value |
|---|---|
| Endpoint | POST https://api.mibo-ai.com/public/traces. Set the full URL. Exporters that take a base URL append /v1/traces. |
| Authentication | x-api-key header |
| Encoding | OTLP/HTTP protobuf or JSON. Mibo does not accept OTLP/gRPC. |
| Compression | gzip is accepted. Set OTEL_EXPORTER_OTLP_TRACES_COMPRESSION=gzip to enable it. |
| Size limit | 10 MB per request. See Payload size limits. |
| Routing | service.name must match the Agent’s OTLP Service Name. |
What’s next
Section titled “What’s next”- Keep your existing backend and send Mibo a copy.
- OpenTelemetry (OTLP) for batching, error codes, and attribute mapping.
- Creating test cases to refine the generated tests.