**Question about OpenRouter response ID in `Respon...
# koog-agentic-framework
g
Question about OpenRouter response ID in
ResponseMetaInfo
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`:
Copy code
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:
Copy code
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)?
a
No, it was not intentional, and I don’t see any reason not to add it. Created an issue https://youtrack.jetbrains.com/issue/KG-599/Support-response-id-parameter-in-message-ResponseMetaInfo-info-for-OpenRouter
❤️ 1
g
Thank you!