gravitational/teleport · error
the inference provider rejected the request as invalid. Chec
Error message
the inference provider rejected the request as invalid. Check the request body for unsupported or invalid fields
What it means
Sentinel error (llmerrors.ErrBadRequest) representing an HTTP 400 from the inference provider (e.g. Anthropic). It fires when the provider maps the provider's invalid_request_error type via NewProviderError, meaning the LLM request body contained unsupported or invalid fields rather than a client-side format problem. The Anthropic proxy compares provider errors against it with errors.Is to shape the API error response.
Source
Thrown at lib/srv/app/llm/errors/errors.go:33
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package errors
import (
"errors"
"fmt"
"net/http"
"github.com/gravitational/trace"
"github.com/gravitational/teleport/lib/utils"
)
var (
// ErrTimeout returned when the request times out.
ErrTimeout = errors.New("the request timed out. Try again or use streaming for long responses")
// ErrBadRequest returned when the request has bad format or invalid fields.
ErrBadRequest = errors.New("the inference provider rejected the request as invalid. Check the request body for unsupported or invalid fields")
// ErrCanceled returned when the request is canceled.
ErrCanceled = errors.New("the request was canceled")
// ErrUnauthorized returned when the request is unauthorized.
ErrUnauthorized = errors.New("the inference provider rejected the request due to authentication or authorization configuration. Contact your Teleport administrator")
// ErrRejected returned when the provider rejects the request.
ErrRejected = errors.New("the inference provider rejected the request due to usage limits. Contact your Teleport administrator")
// ErrUnsupported returned when the requested endpoint is not supported.
ErrUnsupported = errors.New("teleport doesn't support the requested endpoint, please check the list of supported endpoints in the documentation")
// ErrBadResponse returned when the provider replied the request with an unsupported message or format.
ErrBadResponse = errors.New("the inference provider returned an unexpected response. Contact your Teleport administrator")
// ErrConfig returned when the app or app service are misconfigured, requiring admin intervention.
ErrConfig = errors.New("unable to serve request due to an app configuration error. Contact your Teleport administrator")
// ErrInternal returned when there is a Teleport processing error (nothing to do with the inference provider).
ErrInternal = errors.New("unable to serve the request due to an internal error. Contact your Teleport administrator")
// ErrLimitExceeded returned when Teleport rejects the request due to limit exceeded.
ErrLimitExceeded = errors.New("tokens quota exceeded. Contact your Teleport administrator")
// ErrUnknown returned when the handler could not identify the error.
ErrUnknown = errors.New("the inference provider returned an unexpected error. Contact your Teleport administrator")View on GitHub (pinned to 1283425b60)
Solutions
- Check the request body for unsupported or invalid fields per the provider's API
- Remove or correct fields the provider does not accept
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at lib/srv/app/llm/errors/errors.go:33 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of gravitational/teleport@1283425b60 (2026-09-02).
Data as JSON: /api/errors/41a11f3f5801cb37.
Report an issue: GitHub.