gusflo
12/05/2025, 1:31 PMResponseMetaInfo
Hi! I'm using the OpenRouter client and noticed that the response id from OpenRouterChatCompletionResponse isn't included in the ResponseMetaInfo when processing chat responses.
In processProviderChatResponse, the implementation calls createMetaInfo(response.usage) which only captures token counts and timestamp, but omits `response.id`:
kotlin
override fun processProviderChatResponse(response: OpenRouterChatCompletionResponse): ListLLMChoice {
require(response.choices.isNotEmpty()) { "Empty choices in response" }
return response.choices.map {
it.message.toMessageResponses(
it.finishReason,
createMetaInfo(response.usage), // ← response.id is lost here
)
}
}
The id field is available in the response object:
kotlin
@Serializable
public class OpenRouterChatCompletionResponse(
override val id: String, // ← This ID
public val choices: ListOpenRouterChoice,
public val usage: OpenAIUsage?,
// ... other fields
) : OpenAIBaseLLMResponse
Use case: OpenRouter's Generations API requires this id to query generation details after the fact. Without it stored in metadata, I cannot see a way to correlate responses with their OpenRouter generation records.
Is this omission intentional (for provider-agnosticism)?Andrey Bragin
12/05/2025, 5:30 PMgusflo
12/06/2025, 9:51 AM