chatboxai/chatbox · error · ApiError

JSON.stringify(json)

Error message

JSON.stringify(json)

What it means

Error "JSON.stringify(json)" thrown in chatboxai/chatbox.

Source

Thrown at src/shared/providers/definitions/models/custom-claude.ts:107

  public async listModels(): Promise<ProviderModelInfo[]> {
    type Response = {
      data: { id: string; type: string }[]
    }
    const url = `${this.options.apiHost}/models?limit=990`
    const res = await this.dependencies.request.apiRequest({
      url: url,
      method: 'GET',
      useProxy: this.options.useProxy,
      headers: {
        'anthropic-version': '2023-06-01',
        'anthropic-dangerous-direct-browser-access': 'true',
        'x-api-key': this.options.apiKey,
      },
    })
    const json: Response = await res.json()
    if (!json['data']) {
      throw new ApiError(JSON.stringify(json))
    }
    return json['data']
      .filter((item) => item.type === 'model')
      .map((item) => ({
        modelId: item.id,
        type: 'chat',
      }))
  }
}

View on GitHub (pinned to 81571269ad)

Solutions

  1. Verify the custom provider's API host URL is correct and reachable.
  2. Check that the x-api-key configured for the custom Claude provider is valid.
  3. Read the stringified response body to see the upstream error detail.
  4. Ensure the endpoint implements the Anthropic /models API and returns a 'data' field.

Example fix

const json: Response = await res.json()
if (!json['data']) {
  console.error('Custom Claude listModels error:', json)
}

When it happens

Trigger: Thrown at src/shared/providers/definitions/models/custom-claude.ts:107 when the library encounters an invalid state.

Common situations: Occurs in src/shared/providers/definitions/models/custom-claude.ts when a custom Claude-compatible endpoint returns an error response whose JSON body is thrown as an ApiError.


AI-assisted analysis of chatboxai/chatbox@81571269ad (2026-08-12). Data as JSON: /api/errors/6dd1b22356c1b8fa. Report an issue: GitHub.