-
Notifications
You must be signed in to change notification settings - Fork 718
claude-code connection failed on remote API endpoint (NPM/Reverse Proxy) while curl works #309
Description
Describe the bug
I have confirmed that claude-code works perfectly when connecting to a local oMLX instance, but it fails with a 503/500 Internal Server Error when connecting to a remote endpoint exposed via Nginx Proxy Manager (NPM).
To Reproduce
Steps to reproduce the behavior:
ANTHROPIC_BASE_URL='https://claude.xxx.xxx.com:8443' ANTHROPIC_AUTH_TOKEN='omlx-xxxx' ANTHROPIC_DEFAULT_OPUS_MODEL='GLM-4.5-Air-MLX-6bit' ANTHROPIC_DEFAULT_SONNET_MODEL='GLM-4.5-Air-MLX-6bit' ANTHROPIC_DEFAULT_HAIKU_MODEL='GLM-4.5-Air-MLX-6bit' API_TIMEOUT_MS=3000000 CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 claude
Expected behavior
claude code can success connect the api
Screenshots
Desktop (please complete the following information):
- OS: macbookpro m2 item2
- Version brew omlx 0.2.17
Additional context
curlis okay
(base) ➜ Desktop curl -i -X POST https://claude.xxxx.xxxx.com:8443/v1/chat/completions \
-H "Authorization: Bearer omlx-xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "GLM-4.5-Air-MLX-6bit",
"messages": [{"role": "user", "content": "hi"}],
"stream": true
}'
HTTP/2 200
server: openresty
date: Thu, 19 Mar 2026 06:54:31 GMT
content-type: text/event-stream; charset=utf-8
x-served-by: claude.api.codesdancing.com
: keep-alive
data: {"id":"chatcmpl-ee349404","object":"chat.completion.chunk","created":1773903271,"model":"GLM-4.5-Air-MLX-6bit","choices":[{"index":0,"delta":{"role":"assistant"}}]}
data: {"id":"chatcmpl-ee349404","object":"chat.completion.chunk","created":1773903272,"model":"GLM-4.5-Air-MLX-6bit","choices":[{"index":0,"delta":{"content":"\n"}}]}
data: {"id":"chatcmpl-ee349404","object":"chat.completion.chunk","created":1773903272,"model":"GLM-4.5-Air-MLX-6bit","choices":[{"index":0,"delta":{"reasoning_content":"Okay"}}]}