Skip to main content
Code for each endpoint: Chat Completions, Responses, Messages.

Rules

  • Every call needs its result, and every result its call. A tool call without a matching result, or a result without its call (tool_output_unmatched), fails with 400 before the request reaches a provider.
  • Responses keeps no state. Send the earlier function_call items back together with their function_call_output items. See Conversation state.
  • Models without tool support lose the tools. If tools is missing from a model’s supported_parameters, NagaAI removes the tools from the request and the model answers in text.
  • Some models accept only tool_choice: "auto". For claude-opus-5.5, claude-fable-5.1 and Mythos 5.1, NagaAI turns required or a named tool into auto, so the model may answer in text.
  • NagaAI refuses legacy fields. functions, the function role and function_call on a message fail with 400, and NagaAI drops a top-level function_call. Use tools, tool_choice, tool_calls and the tool role.
  • Function tools and web search only. NagaAI supports your own function tools and web search. NagaAI drops other server-side tools, see Differences.