diff --git a/metagpt/provider/openai_api.py b/metagpt/provider/openai_api.py index 1d2057e50..bd9c02231 100644 --- a/metagpt/provider/openai_api.py +++ b/metagpt/provider/openai_api.py @@ -114,9 +114,6 @@ async def _achat_completion_stream(self, messages: list[dict], timeout=USE_CONFI elif hasattr(chunk.choices[0], "usage"): # The usage of some services is an attribute of chunk.choices[0], such as Moonshot usage = CompletionUsage(**chunk.choices[0].usage) - elif "openrouter.ai" in self.config.base_url and chunk_has_usage: - # due to it get token cost from api - usage = chunk.usage has_finished = True log_llm_stream("\n")