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

# API errors

> Handle GitHits problem responses, request IDs, rate limits and ambiguous request outcomes.

Errors normally return `application/problem+json`. Use the stable `code` field in your error-handling logic. The `detail` text explains the error for a person and can change. Each endpoint's reference lists its responses and examples.

## Choose the next action

| HTTP status and code                           | Action                                                                                        |
| ---------------------------------------------- | --------------------------------------------------------------------------------------------- |
| `400 VALIDATION_ERROR`                         | Check the endpoint's accepted inputs, encoding, `fields` values and parameter combinations.   |
| `401 AUTHENTICATION_REQUIRED`                  | Supply a usable bearer token. See [authentication](/api/authentication).                      |
| `403 FORBIDDEN`                                | Verify that your account can access the requested resource.                                   |
| `403 ACCOUNT_INACTIVE`                         | Resolve your account's inactive state before retrying.                                        |
| `403 FEATURE_FLAG_REQUIRED`                    | The capability is not enabled for your account. Retrying the same request will not enable it. |
| `403 TERMS_ACCEPTANCE_REQUIRED`                | Review and accept the applicable terms through the documented acceptance flow.                |
| `404 PACKAGE_NOT_FOUND` or `VERSION_NOT_FOUND` | Check the registry, package name and requested version.                                       |
| `429 RATE_LIMITED`                             | Respect `Retry-After` when provided and reduce request frequency.                             |
| `502 UPSTREAM_ERROR` or `504 TIMEOUT`          | Check the endpoint's retry guidance before deciding whether to send another request.          |

This table covers common cases, not every endpoint-specific code. A timeout does not guarantee that work stopped. Repeating [example generation](/api-reference/v1/examples/generate-an-example-from-open-source-references) can save another example. Each [feedback submission](/api-reference/v1/feedback/submit-solution-or-session-feedback) creates a new record, even if you send the same feedback again. [Experimental Ask](/api-reference/v1/experimental/ask-a-source-cited-question) also saves answers and follow-up turns; repeating a request can create another thread or turn.

## Keep the request ID

Save `X-Request-ID` from the response headers. A normal problem response's `instance` matches this ID. Include it with the endpoint, approximate time, status and problem code when reporting a failure. Remove authorization headers and sensitive request content from reports.

If the service cannot create a request identity, it returns an empty HTTP `500` without a request ID. Clients must handle that case without assuming every failure body is JSON.

## Browser request errors

A browser can block a cross-origin response before the playground can display its status or body. Check the destination URL and whether your browser reports a CORS failure. A browser network error alone does not prove your token is invalid or that no work occurred.

The playground sends live requests from `https://docs.githits.com`. If you are reading a preview or another copy of these docs, use the [cURL quickstart](/api/quickstart) in your own terminal. The API does not allow those other sites to send playground requests.
