anthropics / anthropics/claude-code

[BUG] Claude Desktop gateway health check probes paid Haiku instead of configured free model

Abierto
#89,794 1 comentario 0 reacciones 0 asignados Ver en GitHub
area:providers bug platform:windows
Lenguaje dominante
Python
Estrellas
145k
Forks
23.1k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

### Preflight Checklist

- [x] I have searched [existing issues](https://github.com/anthropics/claude-code/issues?q=is%3Aissue%20state%3Aopen%20label%3Abug) and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code

### What's Wrong?

I use OpenRouter as a third-party inference gateway in Claude Desktop/Claude
Code with the free model `stealth/ox-alpha`.

The gateway connection and API key are valid. However, Claude Desktop's gateway
health check ignores the configured model and sends its test request using
`anthropic/claude-3-haiku`.

Because my OpenRouter account uses only free models and has never purchased
credits, OpenRouter correctly rejects the paid Haiku request with HTTP 402.
Claude Desktop consequently considers the gateway configuration unhealthy,
even though the configured free model does not require credits.

The third-party inference configuration provides no way to choose or override
the model used by this health check.

### What Should Happen?

Claude Desktop should test the model selected in the third-party inference
configuration. In this case, the health check should use
`stealth/ox-alpha`, not `anthropic/claude-3-haiku`.

Alternatively, Desktop should validate connectivity and credentials through a
model-independent endpoint such as `/v1/models`, or provide a configurable
health-check model.

A paid-model billing failure should not prevent use of a different configured
model that is available without paid credits.

### Error Messages/Logs

```shell
Your connection works, but the provider rejected a test request. Often a
model-access or quota issue.

message: Gateway returned HTTP 402
httpStatus: 402
requestUrl: https://openrouter.ai/api/v1/messages
probedModel: anthropic/claude-3-haiku
responseBody: {
"type": "error",
"error": {
"type": "billing_error",
"message": "Insufficient credits. This account never purchased credits. Make sure your key is on the correct account or org, and if so, purchase more at https://openrouter.ai/settings/credits",
"error_type": "payment_required"
},
"request_id": "gen-1787743412-gz2m9RgZKhcyz0LZGrPa",
"metadata": {
"limit_source": "openrouter_credits",
"remedy_hint": "Add credits at https://openrouter.ai/settings/credits, or lower max_tokens / prompt size to fit your remaining balance."
}
}
endpoint: https://openrouter.ai/
checkedAt: 2026-08-26T11:23:29.872Z
```

### Steps to Reproduce

1. Use the latest Claude Desktop version on Windows.
2. Enable Developer Mode through Help → Troubleshooting.
3. Open Developer → Configure Third-Party Inference.
4. Select a Gateway connection.
5. Configure:
- Endpoint: https://openrouter.ai/
- A valid OpenRouter API key from an account that uses free models and has
never purchased credits
- Intended model: stealth/ox-alpha
6. Apply or test the configuration.
7. Observe that the connection and credentials are accepted initially.
8. Observe that the health check sends a request to:
https://openrouter.ai/api/v1/messages
9. Observe that the diagnostic identifies the test model as:
probedModel: anthropic/claude-3-haiku
10. OpenRouter returns HTTP 402 because Haiku is paid.
11. Claude Desktop marks the gateway unhealthy even though the configured
`stealth/ox-alpha` model is free.

### Claude Model

Other

### Is this a regression?

I don't know

### Last Working Version

_No response_

### Claude Code Version

Claude 1.37937.1 (edbd3c) 2026-08-25T22:55:59.000Z

### Platform

Other

### Operating System

Windows

### Terminal/Shell

Other

### Additional Information

This is not an invalid-credential error. Claude Desktop explicitly reports that
the connection works. The failure occurs because its health check selects a
different model from the configured inference model.

No OpenRouter API key is included in this report. The OpenRouter request ID is
included so the provider-side request can be correlated if necessary.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Start by reproducing the gateway configuration on Windows with OpenRouter and the free model `stealth/ox-alpha`, then trace the health-check request that reports `probedModel: anthropic/claude-3-haiku`. Determine where the configured model is ignored and verify that the completed change tests the configured model or uses a model-independent validation path without incorrectly marking the gateway unhealthy.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Área
api
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.