{
  "id": 21548749,
  "title": "Streaming tool_calls on a non-OpenAI upstream",
  "url": "https://urgent.news/2026/11/24/streaming-tool-calls-on-a-non-openai-upstream",
  "topic": "ai",
  "section": "AI",
  "published": "2026-11-24T05:32:01.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/paipizze/streaming-toolcalls-on-a-non-openai-upstream-5mc"
  },
  "original_language": "en",
  "account": "Streaming API calls can cause issues when the underlying model is not from OpenAI. The function calling feature in the OpenAI contract is prone to errors in this scenario, with arguments arriving as incomplete fragments and finish_reason switching to tool_calls instead of stop. This article provides a runnable tool loop example, followed by the streaming variant that gathers fragments by index. The article highlights three main failures that cause most integration issues, as well as the implications when a gateway bill charges tool schemas as input tokens on every turn.",
  "summary": "Function calling is the part of the OpenAI contract most likely to break when the model behind the endpoint is not OpenAI's, and the breakage is rarely a clean error. Arguments arrive as fragments, content is null on the turn that emits a call, finish_reason becomes tool_calls instead of stop , and JSON Schema mode may not exist at all. This article walks a complete, runnable tool loop, then the…",
  "key_points": [
    "Streaming API calls cause issues with non-OpenAI models",
    "Function calling feature prone to errors in this scenario",
    "Tool schemas charged as input tokens on every turn"
  ],
  "editors_take": "Implementing fragment gathering by index mitigates the integration errors and incorrect finish reasons that occur when developers attempt to use OpenAI-style function calling with non-OpenAI model providers.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}