> ## Documentation Index
> Fetch the complete documentation index at: https://openrouter.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# APIErrorType

Canonical OpenRouter error type, stable across all API formats

## Example Usage

```go theme={null}
import (
	"github.com/OpenRouterTeam/go-sdk/models/components"
)

value := components.APIErrorTypeContextLengthExceeded

// Open enum: custom values can be created with a direct type cast
custom := components.APIErrorType("custom_value")
```

## Values

| Name | Value |
| - | - |
| `APIErrorTypeContextLengthExceeded` | context\_length\_exceeded |
| `APIErrorTypeMaxTokensExceeded` | max\_tokens\_exceeded |
| `APIErrorTypeTokenLimitExceeded` | token\_limit\_exceeded |
| `APIErrorTypeStringTooLong` | string\_too\_long |
| `APIErrorTypeAuthentication` | authentication |
| `APIErrorTypePermissionDenied` | permission\_denied |
| `APIErrorTypePaymentRequired` | payment\_required |
| `APIErrorTypeRateLimitExceeded` | rate\_limit\_exceeded |
| `APIErrorTypeProviderOverloaded` | provider\_overloaded |
| `APIErrorTypeProviderUnavailable` | provider\_unavailable |
| `APIErrorTypeInvalidRequest` | invalid\_request |
| `APIErrorTypeInvalidPrompt` | invalid\_prompt |
| `APIErrorTypeNotFound` | not\_found |
| `APIErrorTypePreconditionFailed` | precondition\_failed |
| `APIErrorTypePayloadTooLarge` | payload\_too\_large |
| `APIErrorTypeUnprocessable` | unprocessable |
| `APIErrorTypeContentPolicyViolation` | content\_policy\_violation |
| `APIErrorTypeRefusal` | refusal |
| `APIErrorTypeInvalidImage` | invalid\_image |
| `APIErrorTypeImageTooLarge` | image\_too\_large |
| `APIErrorTypeImageTooSmall` | image\_too\_small |
| `APIErrorTypeUnsupportedImageFormat` | unsupported\_image\_format |
| `APIErrorTypeImageNotFound` | image\_not\_found |
| `APIErrorTypeImageDownloadFailed` | image\_download\_failed |
| `APIErrorTypeServer` | server |
| `APIErrorTypeTimeout` | timeout |
| `APIErrorTypeUnmapped` | unmapped |
