> ## 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. |
| `409 DOCUMENTATION_PAGE_OWNER_CONFLICT` | Use the `docs_read_target` returned for the intended documentation corpus. |
| `422 DOCUMENTATION_SECTION_UNRESOLVED` | Use an indexed documentation fragment or explicit line bounds; see [read requests](/api/requests-and-responses#read-documentation-or-source-code). |
| `429 RATE_LIMITED` | Respect `Retry-After` when provided and reduce request frequency. |
| `503 PACKAGE_INDEXING` | Code is not ready. Retry later or set a positive `wait_timeout_ms` on the read request. |
| `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 Research](/api-reference/v1/experimental/research-a-question-with-cited-sources) also saves answers and follow-up turns; repeating a request can create another thread or turn.

Research answer generation can take up to 210 seconds. Set your client timeout longer than 210 seconds. A `504 TIMEOUT` does not make retrying safe: generation may continue, and repeating the 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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.