Tool integration

Function calling is a proposal, not permission to execute

The model can suggest a function and arguments. Your application must validate the schema, authorize the action and decide whether execution is safe.

Planned recharge methods: Alipay and USDT. Collection is not enabled yet.

Required application checks

  • Validate every argument against a strict schema.
  • Authorize the user and project for the action.
  • Reject unknown tools and extra fields.
  • Use idempotency for side effects.
  • Require approval for payments, deletion or account changes.

Model support is explicit

Only use tool calling with a model that reports tool support in the live catalog. A compatible endpoint does not make every model tool-capable.

function-calling.tstypescript
const response = await client.chat.completions.create({
  model: "qwen3.7-plus",
  messages: [{ role: "user", content: "What is the order status?" }],
  tools: [{
    type: "function",
    function: {
      name: "get_order_status",
      description: "Return the current order status",
      parameters: {
        type: "object",
        properties: { order_id: { type: "string" } },
        required: ["order_id"]
      }
    }
  }]
});

Common questions

Does the API execute functions for me?

No. The model returns a proposed tool call. Your application owns validation, authorization and execution.

Can tool arguments be trusted?

No. Treat them as untrusted input and validate them exactly as you would validate an external request.

Can I stream tool calls?

Support depends on the selected model and client behavior. Test incremental argument handling before enabling it in production.

Related resources