Summary
This repo's OpenAI Batch API instrumentation (js/src/instrumentation/plugins/openai-batch-instrumentation.ts) creates spans for batch jobs submitted against /v1/chat/completions and /v1/responses, but the OpenAI Batch API officially supports six additional endpoints — including /v1/embeddings, a core embeddings execution surface that is explicitly in-scope for this repo's instrumentation (every other embeddings-capable provider wrapper here — OpenAI's own synchronous embeddings.create, Cohere, Mistral, Groq, HuggingFace, Voyage AI, AI SDK embed/embedMany — instruments embeddings calls). Batch embeddings jobs currently get zero tracing: no task span, no child spans, nothing.
What's missing
In js/src/instrumentation/plugins/openai-batch-instrumentation.ts:
SUPPORTED_ENDPOINTS (line 29) is hardcoded to new Set(["/v1/chat/completions", "/v1/responses"]).
readBatchInputs (line 333) rejects any JSONL record whose url isn't in that set — for a /v1/embeddings batch file, every record fails SUPPORTED_ENDPOINTS.has(url) (line 349) and is pushed onto issues as "OpenAI Batch input contains an invalid record" (line 353).
- Because every record is rejected,
endpoint is never set, so readBatchInputs also reports "OpenAI Batch input contains no supported records" (line 370).
interceptOpenAIFilesCreateTraced (line 399) and completeBatch (line 646) both bail out silently whenever inputData.issues.length > 0 (lines 416, 616), so an embeddings batch job produces no task span and no per-request child spans at all — not even a degraded/partial one.
extractOpenAIBatchInput in js/src/instrumentation/plugins/openai-span-data.ts (line 36-46) only branches on endpoint === "/v1/chat/completions" vs. everything else defaulting to params.input (the Responses API input shape) — it has no embeddings-specific extraction (e.g. minimizing the input the way extractOpenAIChatInput/existing sync embeddings paths do), so even if the endpoint filter were relaxed, embeddings batch requests would need their own extraction branch.
This means a customer submitting a client.batches.create({ endpoint: "/v1/embeddings", ... }) job — a fully supported, documented OpenAI API call — gets no trace of that batch job in Braintrust whatsoever, while the same customer's synchronous embeddings.create calls are traced.
Note: OpenAI's Batch API also supports /v1/completions, /v1/moderations, /v1/images/generations, /v1/images/edits, and /v1/videos, which are not generative/embeddings execution gaps of the same kind (image/video generation batch coverage would need to be assessed against this repo's existing image/video generation instrumentation separately) — this issue is scoped specifically to the /v1/embeddings batch endpoint, which is a clean, additive embeddings-execution gap in an otherwise-instrumented lifecycle.
Braintrust docs status
not_found. https://www.braintrust.dev/docs/providers/openai does not mention the Batch API, /v1/batches, or batch job tracing anywhere (TypeScript, Python, Ruby, Go, Java, or .NET sections). It documents only synchronous embeddings.create tracing ("output records the embedding length, not the raw vector"). No Braintrust docs page describes batch-endpoint coverage at all, so there's no documented claim to reconcile against — the instrumentation itself is the only source of truth, and it explicitly excludes /v1/embeddings.
Upstream sources
- https://developers.openai.com/api/docs/guides/batch — lists the exact supported
endpoint values: /v1/responses, /v1/chat/completions, /v1/embeddings, /v1/completions, /v1/moderations, /v1/images/generations, /v1/images/edits, /v1/videos. Also notes /v1/embeddings batches are capped at 50,000 embedding inputs per batch.
- https://developers.openai.com/api/reference/resources/batches/methods/create — the
create endpoint reference; the endpoint parameter description: "The endpoint to be used for all requests in the batch. Currently /v1/responses, /v1/chat/completions, /v1/embeddings, /v1/completions, /v1/moderations, /v1/images/generations, /v1/images/edits, and /v1/videos are supported."
Braintrust docs sources checked
Local repo files inspected
js/src/instrumentation/plugins/openai-batch-instrumentation.ts — SUPPORTED_ENDPOINTS set (line 29), readBatchInputs validation (lines 333-373), interceptOpenAIFilesCreateTraced (line 399), completeBatch (line 646)
js/src/instrumentation/plugins/openai-span-data.ts — extractOpenAIBatchInput (lines 36-46), contrasted with extractOpenAIChatInput/embeddings-minimization patterns used elsewhere
js/src/instrumentation/plugins/openai-batch-instrumentation.test.ts — existing test coverage only exercises /v1/chat/completions and /v1/responses batch scenarios
js/src/instrumentation/plugins/openai-channels.ts — batchesRetrieveTraced / batchesCompleteTrace channel definitions (no endpoint-specific typing)
js/src/openai-batch-types.ts — shared batch types referenced by the plugin
Summary
This repo's OpenAI Batch API instrumentation (
js/src/instrumentation/plugins/openai-batch-instrumentation.ts) creates spans for batch jobs submitted against/v1/chat/completionsand/v1/responses, but the OpenAI Batch API officially supports six additional endpoints — including/v1/embeddings, a core embeddings execution surface that is explicitly in-scope for this repo's instrumentation (every other embeddings-capable provider wrapper here — OpenAI's own synchronousembeddings.create, Cohere, Mistral, Groq, HuggingFace, Voyage AI, AI SDKembed/embedMany— instruments embeddings calls). Batch embeddings jobs currently get zero tracing: no task span, no child spans, nothing.What's missing
In
js/src/instrumentation/plugins/openai-batch-instrumentation.ts:SUPPORTED_ENDPOINTS(line 29) is hardcoded tonew Set(["/v1/chat/completions", "/v1/responses"]).readBatchInputs(line 333) rejects any JSONL record whoseurlisn't in that set — for a/v1/embeddingsbatch file, every record failsSUPPORTED_ENDPOINTS.has(url)(line 349) and is pushed ontoissuesas"OpenAI Batch input contains an invalid record"(line 353).endpointis never set, soreadBatchInputsalso reports"OpenAI Batch input contains no supported records"(line 370).interceptOpenAIFilesCreateTraced(line 399) andcompleteBatch(line 646) both bail out silently wheneverinputData.issues.length > 0(lines 416, 616), so an embeddings batch job produces no task span and no per-request child spans at all — not even a degraded/partial one.extractOpenAIBatchInputinjs/src/instrumentation/plugins/openai-span-data.ts(line 36-46) only branches onendpoint === "/v1/chat/completions"vs. everything else defaulting toparams.input(the Responses API input shape) — it has no embeddings-specific extraction (e.g. minimizing the input the wayextractOpenAIChatInput/existing sync embeddings paths do), so even if the endpoint filter were relaxed, embeddings batch requests would need their own extraction branch.This means a customer submitting a
client.batches.create({ endpoint: "/v1/embeddings", ... })job — a fully supported, documented OpenAI API call — gets no trace of that batch job in Braintrust whatsoever, while the same customer's synchronousembeddings.createcalls are traced.Note: OpenAI's Batch API also supports
/v1/completions,/v1/moderations,/v1/images/generations,/v1/images/edits, and/v1/videos, which are not generative/embeddings execution gaps of the same kind (image/video generation batch coverage would need to be assessed against this repo's existing image/video generation instrumentation separately) — this issue is scoped specifically to the/v1/embeddingsbatch endpoint, which is a clean, additive embeddings-execution gap in an otherwise-instrumented lifecycle.Braintrust docs status
not_found. https://www.braintrust.dev/docs/providers/openai does not mention the Batch API,/v1/batches, or batch job tracing anywhere (TypeScript, Python, Ruby, Go, Java, or .NET sections). It documents only synchronousembeddings.createtracing ("output records the embedding length, not the raw vector"). No Braintrust docs page describes batch-endpoint coverage at all, so there's no documented claim to reconcile against — the instrumentation itself is the only source of truth, and it explicitly excludes/v1/embeddings.Upstream sources
endpointvalues:/v1/responses,/v1/chat/completions,/v1/embeddings,/v1/completions,/v1/moderations,/v1/images/generations,/v1/images/edits,/v1/videos. Also notes/v1/embeddingsbatches are capped at 50,000 embedding inputs per batch.createendpoint reference; theendpointparameter description: "The endpoint to be used for all requests in the batch. Currently/v1/responses,/v1/chat/completions,/v1/embeddings,/v1/completions,/v1/moderations,/v1/images/generations,/v1/images/edits, and/v1/videosare supported."Braintrust docs sources checked
Local repo files inspected
js/src/instrumentation/plugins/openai-batch-instrumentation.ts—SUPPORTED_ENDPOINTSset (line 29),readBatchInputsvalidation (lines 333-373),interceptOpenAIFilesCreateTraced(line 399),completeBatch(line 646)js/src/instrumentation/plugins/openai-span-data.ts—extractOpenAIBatchInput(lines 36-46), contrasted withextractOpenAIChatInput/embeddings-minimization patterns used elsewherejs/src/instrumentation/plugins/openai-batch-instrumentation.test.ts— existing test coverage only exercises/v1/chat/completionsand/v1/responsesbatch scenariosjs/src/instrumentation/plugins/openai-channels.ts—batchesRetrieveTraced/batchesCompleteTracechannel definitions (no endpoint-specific typing)js/src/openai-batch-types.ts— shared batch types referenced by the plugin