AONISDocs

POST / API reference

Tool Calling

Allow a model to request the execution of functions defined by your application.

POST/v1/chat/completions
https://api.aonis.space/v1/chat/completions
Supported

Request example

json · Tool Calling request
{
  "model": "claude-sonnet-5",
  "messages": [{
    "role": "user",
    "content": "What is the weather in São Paulo? Use the get_weather tool."
  }],
  "tools": [{
    "type": "function",
    "function": {
      "name": "get_weather",
      "description": "Get the current weather for a city",
      "parameters": {
        "type": "object",
        "properties": { "city": { "type": "string", "description": "City name" } },
        "required": ["city"]
      }
    }
  }],
  "tool_choice": { "type": "function", "function": { "name": "get_weather" } }
}

Tool response

A tool request is returned as an assistant message with tool calls.

json · Conceptual response
{
  "role": "assistant",
  "content": null,
  "tool_calls": [{
    "id": "call_...",
    "type": "function",
    "function": { "name": "get_weather", "arguments": "{\"city\":\"São Paulo\"}" }
  }]
}

Application responsibility