> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crazyrouter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Responses Function Calling

> 基于 2026-03-23 Crazyrouter 生产环境验证的 Responses 工具调用

> 更新日期：2026-06-06

# Responses Function Calling

```
POST /v1/responses
```

截至 2026 年 3 月 23 日，Crazyrouter 生产环境已验证 `gpt-5.5` 在 Responses API 下可稳定返回 `function_call`。

<Note>
  Claude 当前不支持 `POST /v1/responses`。如果你需要 Claude 的工具调用，请改用 `POST /v1/messages` 或 `POST /v1/chat/completions`。
</Note>

***

## 第一步：让模型产出函数调用

```bash theme={null}
curl https://api.crazyrouter.com/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "gpt-5.5",
    "input": "What is the weather in Beijing? Use the tool.",
    "tools": [
      {
        "type": "function",
        "name": "get_weather",
        "description": "Get weather info for a city",
        "parameters": {
          "type": "object",
          "properties": {
            "city": {"type": "string"}
          },
          "required": ["city"],
          "additionalProperties": false
        }
      }
    ]
  }'
```

生产环境实际响应的关键形态：

```json theme={null}
{
  "output": [
    {
      "type": "function_call",
      "name": "get_weather",
      "arguments": "{\"city\":\"Beijing\"}"
    }
  ]
}
```

***

## 第二步：回传函数结果

拿到 `function_call` 之后，把你自己执行函数得到的结果作为 `function_call_output` 再发回去：

```json theme={null}
{
  "model": "gpt-5.5",
  "input": [
    {
      "type": "function_call",
      "call_id": "call_123",
      "name": "get_weather",
      "arguments": "{\"city\":\"Beijing\"}"
    },
    {
      "type": "function_call_output",
      "call_id": "call_123",
      "output": "{\"temperature\":22,\"condition\":\"sunny\"}"
    }
  ],
  "tools": [
    {
      "type": "function",
      "name": "get_weather",
      "description": "Get weather info for a city",
      "parameters": {
        "type": "object",
        "properties": {
          "city": {"type": "string"}
        },
        "required": ["city"],
        "additionalProperties": false
      }
    }
  ]
}
```

<Note>
  当前页面只保留了生产环境已验证成功的 `function_call` 路径。更复杂的多工具串联或流式参数增量，请在接入前自行再做一次当日生产验证。
</Note>
