curl-X POST http://192.168.1.221:8000/v1/chat/completions \-H"Content-Type: application/json"\-d'{"model":"gpt-oss-120b","messages":[{"role":"user","content":"hello"}],"max_tokens":10}'
复制代码
两个接口均正常响应,排除网络问题。
2.3 用 Node.js 直接测试(排除 curl 差异)
node-e"
const http = require('http');
const req = http.request({
hostname: '192.168.1.221', port: 8000,
path: '/v1/completions', method: 'POST',
headers: {'Content-Type': 'application/json'}
}, res => { res.on('data', c => console.log(c.toString())); });