Tool calling
Every model on the line calls tools. This is what an agent harness relies on, so it is the part worth knowing exactly.
In the OpenAI format
curl
curl https://uncensoredopencode.com/v1/chat/completions \
-H "Authorization: Bearer $UNCENSORED_OPENCODE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "glm-5.3-flash-uncensored",
"messages": [{"role": "user", "content": "What is in the current directory?"}],
"tools": [{"type": "function", "function": {"name": "list_files", "description": "List files in a directory", "parameters": {"type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"]}}}]
}'The reply's message.tool_calls holds the call. Run it, then send the result back as a tool message with the matching tool_call_id.
What to know
parallel_tool_callsis passed on. If a model cannot take it, the request is sent again without it rather than failing.- Some models only accept
tool_choice: "auto"and answer anything else with a 400 and the codetool_choice_unsupported. On others, naming one tool is honoured by offering only that tool. - In the messages format your own tools are translated both ways and the stop reason is
tool_use. In the responses format, function tools are supported. - Reasoning counts as output. A tight
max_tokenson a reasoning model can spend the whole budget thinking and return an empty answer withfinish_reason: "length". Leave the limit off, or set it generously, in an agent loop.