[BUG] Custom Claude API endpoint fails with "TypeError: Load failed" and path preview strips /v1
Description
When using a custom Anthropic / Claude API compatible provider in ChatBox, requests fail with:
API Error: Error from Custom Claude: TypeError: Load failed (api.example.com)
The provider uses a standard Anthropic Messages API style endpoint:
POST https://api.example.com/v1/messages
The actual provider domain has been redacted in this report.
This issue has also been reproduced on the web app, so it does not seem limited to a single native client.
Environment
- App: ChatBox
- Platform: Web app and mobile app, if applicable
- App version: TODO
- Browser / OS: TODO
- Network: TODO
- Provider type: Custom Claude / Claude API compatible
- Provider host:
https://api.example.com - Provider endpoint: Anthropic-compatible
/v1/messages
Steps to reproduce
- Open ChatBox.
- Add a custom provider.
- Select
Claude API compatible. - Enter an API key.
- Configure the endpoint like this:
API Host: https://api.example.com
API Path: /v1/messages
- The preview URL unexpectedly becomes:
https://api.example.com/messages
The /v1 path segment is stripped.
- Configure the endpoint another way:
API Host: https://api.example.com/v1
API Path: /messages
- The preview URL becomes correct:
https://api.example.com/v1/messages
- Try to check the API or send a message.
Actual behavior
The request fails with:
API Error: Error from Custom Claude: TypeError: Load failed (api.example.com)
Enabling the network compatibility option does not resolve the issue.
Expected behavior
ChatBox should preserve the full custom path and send requests to:
https://api.example.com/v1/messages
For Anthropic / Claude compatible providers, ChatBox should be able to call a custom /v1/messages endpoint successfully using the configured API key.
Notes
There appear to be two related issues:
-
URL construction issue: when
API Hostis set tohttps://api.example.comandAPI Pathis set to/v1/messages, the preview URL drops/v1and showshttps://api.example.com/messages. -
Request failure issue: even when the preview URL is correct by setting
API Hosttohttps://api.example.com/v1andAPI Pathto/messages, requests still fail withTypeError: Load failed.
Please let me know if there is a recommended configuration format for Anthropic-compatible custom providers.