Replace the deprecated Assistants endpoint with the Responses API endpoint

Question: Why does POST /stream/create/assistants return a 400 error when sending an OpenAI gpt-4o-mini request?

Answer: The /stream/create/assistants route still uses OpenAI’s deprecated Assistants threads/runs API. For chat-style requests containing messages and model, use the Responses API endpoint instead:

POST https://indephr.clientportal.cloud/llm/query

The existing request body can remain unchanged. /llm/query maps the request to OpenAI Responses using input and responses.create. Use "stream": false for a non-streaming response, or set "stream": true and retain channels and actionName when streaming results back to FileMaker. Requests that still use assistant_id, thread_id, or run_id require a full Assistants API migration rather than only changing the URL.

Thread Attachments


Original Slack Thread

User U057L133LV6: We have API calls not working any more… is this the reason?
User UBBJX2EHM: All calls from what to what?
User U057L133LV6: From Filemaker to:  POST /stream/create/assistants
User UBBJX2EHM: Ah, could be. 
User U057L133LV6: I was wondering if you guys use the Assistents API of OpenAI under the hood. All was working fine up till today… And I found the OPEN AI message, that is point to the no longer supported api since yesterday… to big a coincidence I guess
User UBBJX2EHM: No, we use the responses api. Changed when it was first released
User U057L133LV6: Mmm. then it is coincidence , we get no replies no more… let us check what is going on
User U057L133LV6: <@UBBJX2EHM> why is this failing…
POST <https://indephr.clientportal.cloud/stream/create/assistants>

{
  “apiKey”: “BFAPI_24E333BF-3664-4B42-BE7B-XXXXXXXXXX”,
  “channels”: [
    “anonymous”
  ],
  “actionName”: “assistantReceiveResultsStream”,
  “payload”: {
    “provider”: “openai”,
    “apiKey”: “sk-proj-xxxxxxxxxxx”,
    “stream”: false,
    “model”: “gpt-4o-mini”,
    “messages”: [
      {
        “role”: “user”,
        “content”: “Reply exactly with: BetterForms Responses API works.”
      }
    ]
  }
}

Response:
{
  “message”: “Failed to process AI request Assistants.“,
  “code”: 400
}
User UBBJX2EHM: let me compare that …
User UBBJX2EHM: <@U0ARC8J5KA5> Thoughts?
User UBBJX2EHM: <@U0ARC8J5KA5> Its the responses api, check docs
User UBBJX2EHM: <@U0ARC8J5KA5> yeah can you link to the responses api and rewrite the query shape to match
(Jeroen this is experimental)
User UBBJX2EHM: <@U057L133LV6> this below is accurate

Here is the same test, rewritten for `/llm/query` (Responses API). Keep the URL change; the body can stay as they already had it.
`POST <https://indephr.clientportal.cloud/llm/query>`
`{`
  `"apiKey": "BFAPI_24E333BF-3664-4B42-BE7B-XXXXXXXXXX",`
  `"channels": ["anonymous"],`
  `"actionName": "assistantReceiveResultsStream",`
  `"payload": {`
    `"provider": "openai",`
    `"apiKey": "sk-proj-xxxxxxxxxxxx",`
    `"stream": false,`
    `"model": "gpt-4o-mini",`
    `"messages": [`
      `{`
        `"role": "user",`
        `"content": "Reply exactly with: BetterForms Responses API works."`
      `}`
    `]`
  `}`
`}`
That is the drop-in replacement for `/stream/create/assistants`. `/llm/query` already maps this to OpenAI Responses (`input` + `responses.create`), not Assistants threads/runs.
Notes for them:
• Donotkeep calling`/stream/create/assistants`. That route still uses`openai.beta.threads.*`, which shut down on Aug 26.
• `stream: false`is fine for this probe. They can omit`channels`and`actionName`on non-streaming calls.
• If they want tokens pushed into FileMaker via`assistantReceiveResultsStream`, set`"stream": true`and keep`channels`+`actionName`.
• This only covers chat-style`messages`+`model`. If production still sends`assistant_id`,`thread_id`, or`run_id`, that is a real Assistants migration, not a URL swap.

User UBBJX2EHM: <@U057L133LV6>
<@U0ARC8J5KA5> STFU please

The main diff is the endpoint you are connecting to, KS supports the not depricated assistants and the new responses api, <https://docs.klai.studio/reference/apis-and-services/streaming-proxy/bf-streaming-api-llm-query#non-streaming-response-payload.stream-false|docs.klai.studio/reference/apis-and-services/streaming-proxy/bf-streaming-api-llm-query#…> the llm/query endpoint supports three froteir companies also
User UBBJX2EHM: <@U091LT54RT9> your bot has too much constraingin prompts and that is why it is not truly helping here.