Skip to content

请求部分ai接口报错 #1342

Description

@aogg

apifox导入curl然后执行时正确的
切换model的时候会报错

curl -X POST "https://yuanyuaicloud.cn/v1/chat/completions" -H "host: yuanyuaicloud.cn" -H "content-type: application/json" -H "authorization: Bearer sk-qwe" -H "user-agent: cli-proxy-openai-compat" --data-raw "{\"model\":\"glm-5.2\",\"messages\":[{\"role\":\"system\",\"content\":[{\"type\":\"text\",\"text\":\"You are Claude Code, Anthropic's official CLI for Claude.\"}]},{\"role\":\"user\",\"content\":[{\"type\":\"text\",\"text\":\"Hi\"}]}],\"max_tokens\":1,\"stream\":false}"

nohost转发的时候

HTTP/2.0 200 OK
server: nginx
date: Mon, 27 Jul 2026 09:30:10 GMT
content-type: application/json
cache-control: private, no-store, no-cache, max-age=0
cf-placement: remote-ORD
cf-ray: a21a9fad78d8a384-SEA
permissions-policy: geolocation=(), microphone=(), camera=(), geolocation=(), microphone=(), camera=()
referrer-policy: strict-origin-when-cross-origin, strict-origin-when-cross-origin
strict-transport-security: max-age=31536000; includeSubDomains, max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN, SAMEORIGIN

From: Whistle@2.10.6
Node: v24.17.0
Host: d60808aae068
Date: 7/27/2026, 9:30:10 AM
Error [ERR_HTTP2_STREAM_ERROR]: Stream closed with error code NGHTTP2_PROTOCOL_ERROR
    at ClientHttp2Stream._destroy (node:internal/http2/core:2482:13)
    at _destroy (node:internal/streams/destroy:122:10)
    at ClientHttp2Stream.destroy (node:internal/streams/destroy:84:5)
    at Writable.destroy (node:internal/streams/writable:1120:11)
    at Http2Stream.onStreamClose (node:internal/http2/core:611:12)

alpine的curl执行

curl: (92) [HTTP2] [1] received invalid frame: FRAME[DATA, len=414, eos=1, padlen=0], error -532: Violation in HTTP messaging rule
{"id":"8795f4b9-c3c3-429c-bd7f-1bfe21607173","object":"chat.completion","created":1785145317,"model":"glm-5.2","choices":[{"index":0,"finish_reason":"length","logprobs":null,"message":{"role":"assistant","content":"我是"}}],"usage":{"prompt_tokens":683,"completion_tokens":1,"total_tokens":684,"prompt_cache_hit_tokens":640,"prompt_cache_miss_tokens":43,"prompt_tokens_details":{"cached_tokens":640}},"cost":"0"}dc306f0b67bb:~# 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions