chatbox icon indicating copy to clipboard operation
chatbox copied to clipboard

[BUG] Custom Claude API endpoint fails with "TypeError: Load failed" and path preview strips /v1

Open Asher-S-Wu opened this issue 5 months ago • 0 comments

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

  1. Open ChatBox.
  2. Add a custom provider.
  3. Select Claude API compatible.
  4. Enter an API key.
  5. Configure the endpoint like this:
API Host: https://api.example.com
API Path: /v1/messages
  1. The preview URL unexpectedly becomes:
https://api.example.com/messages

The /v1 path segment is stripped.

  1. Configure the endpoint another way:
API Host: https://api.example.com/v1
API Path: /messages
  1. The preview URL becomes correct:
https://api.example.com/v1/messages
  1. 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:

  1. URL construction issue: when API Host is set to https://api.example.com and API Path is set to /v1/messages, the preview URL drops /v1 and shows https://api.example.com/messages.

  2. Request failure issue: even when the preview URL is correct by setting API Host to https://api.example.com/v1 and API Path to /messages, requests still fail with TypeError: Load failed.

Please let me know if there is a recommended configuration format for Anthropic-compatible custom providers.

Image

Asher-S-Wu avatar Jun 10 '26 09:06 Asher-S-Wu