Summary
The OpenRouter TypeScript SDK (@openrouter/sdk) exposes a stable rerank.rerank() method for document reranking by relevance. This repository instruments OpenRouter's chat.send(), embeddings.generate(), beta.responses.send(), and callModel() — but has zero coverage for the rerank API. Users who call rerank.rerank() get no Braintrust spans.
What instrumentation is missing
| SDK Method |
Description |
client.rerank.rerank() |
Reranks documents by relevance to a query using models like cohere/rerank-v3.5 |
No coverage in any instrumentation layer:
- No channel definition in
js/src/instrumentation/plugins/openrouter-channels.ts — the file defines chatSend, embeddingsGenerate, betaResponsesSend, callModel, callModelTurn, and toolExecute, but nothing for rerank
- No proxy in
js/src/wrappers/openrouter.ts — the wrapper proxies chat, embeddings, beta, and callModel, but not rerank
- No auto-instrumentation config in
js/src/auto-instrumentations/configs/openrouter.ts — configs exist for Chat.send, Embeddings.generate, Responses.send, and OpenRouter.callModel, but not Rerank.rerank
- No plugin handler in
js/src/instrumentation/plugins/openrouter-plugin.ts
- No e2e test scenario for OpenRouter rerank
A grep for rerank (case-insensitive) across js/src/ returns zero matches.
Context
This repo already instruments the parallel Vercel AI SDK rerank() function (tracked in #1662), confirming that rerank is a recognized instrumentation surface. The OpenRouter SDK's rerank.rerank() is the same class of execution API — model inference that scores and ranks documents — but routed through the OpenRouter SDK rather than the Vercel AI SDK.
Braintrust docs status
not_found — The Braintrust OpenRouter integration docs at https://www.braintrust.dev/docs/integrations/ai-providers/openrouter list chat completions, embeddings, and responses API support but do not mention rerank.
Upstream references
Local files inspected
js/src/wrappers/openrouter.ts — no rerank proxy
js/src/instrumentation/plugins/openrouter-channels.ts — no rerank channel
js/src/instrumentation/plugins/openrouter-plugin.ts — no rerank handler
js/src/auto-instrumentations/configs/openrouter.ts — no rerank config
js/src/vendor-sdk-types/openrouter.ts — no rerank types
e2e/scenarios/ — no OpenRouter rerank test scenario
Summary
The OpenRouter TypeScript SDK (
@openrouter/sdk) exposes a stablererank.rerank()method for document reranking by relevance. This repository instruments OpenRouter'schat.send(),embeddings.generate(),beta.responses.send(), andcallModel()— but has zero coverage for the rerank API. Users who callrerank.rerank()get no Braintrust spans.What instrumentation is missing
client.rerank.rerank()cohere/rerank-v3.5No coverage in any instrumentation layer:
js/src/instrumentation/plugins/openrouter-channels.ts— the file defineschatSend,embeddingsGenerate,betaResponsesSend,callModel,callModelTurn, andtoolExecute, but nothing for rerankjs/src/wrappers/openrouter.ts— the wrapper proxieschat,embeddings,beta, andcallModel, but notrerankjs/src/auto-instrumentations/configs/openrouter.ts— configs exist forChat.send,Embeddings.generate,Responses.send, andOpenRouter.callModel, but notRerank.rerankjs/src/instrumentation/plugins/openrouter-plugin.tsA grep for
rerank(case-insensitive) acrossjs/src/returns zero matches.Context
This repo already instruments the parallel Vercel AI SDK
rerank()function (tracked in #1662), confirming that rerank is a recognized instrumentation surface. The OpenRouter SDK'srerank.rerank()is the same class of execution API — model inference that scores and ranks documents — but routed through the OpenRouter SDK rather than the Vercel AI SDK.Braintrust docs status
not_found— The Braintrust OpenRouter integration docs at https://www.braintrust.dev/docs/integrations/ai-providers/openrouter list chat completions, embeddings, and responses API support but do not mention rerank.Upstream references
Local files inspected
js/src/wrappers/openrouter.ts— no rerank proxyjs/src/instrumentation/plugins/openrouter-channels.ts— no rerank channeljs/src/instrumentation/plugins/openrouter-plugin.ts— no rerank handlerjs/src/auto-instrumentations/configs/openrouter.ts— no rerank configjs/src/vendor-sdk-types/openrouter.ts— no rerank typese2e/scenarios/— no OpenRouter rerank test scenario