Also it looks like you have the messages array backwards. Lower in the array (higher index) is more
Also it looks like you have the messages array backwards. Lower in the array (higher index) is more recent.
unshift adds the system message to the start of the arraytool_calls instead of string content: https://platform.openai.com/docs/api-reference/chat/createX
•7/22/25, 8:52 PM
allminiLmv6 in cloudflare workers ai.



{"errors":[{"code":7000,"message":"No route for that URI"}]} and {"code":2002,"message":"Internal server error"}


{
"role": "assistant",
"tool_calls": [
{
"id": "039920ecd55b4b5ba689d692933602cc",
"function": {
"name": "Query Vector Database",
"arguments": "{\"Query\": \"joe\"}"
},
"type": "function"
}
],
"content": ""
}✘ [ERROR] Uncaught (in promise) InferenceUpstreamError: 10000: Authentication error
at _parseError (cloudflare-internal:ai-api:107:24){"errors":[{"code":7000,"message":"No route for that URI"}]}{"code":2002,"message":"Internal server error"}