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

# Request IDs

> Every response carries X-Request-Id, including the ones with no body, and every error body repeats it as requestId.

**Every response from the Exo API carries an `X-Request-Id` header. It is the one handle that resolves a single call.**

```http theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
HTTP/1.1 403 Forbidden
Content-Type: application/problem+json
X-Request-Id: req_9f2c41ab7d0e5c18
```

The same value appears inside every problem body as `requestId`, so a logged error payload is self-describing even if you discarded the headers.

```json theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
{
  "type": "https://docs.get-exo.com/errors/permission_denied",
  "title": "Permission denied",
  "status": 403,
  "detail": "This operation requires the 'memory:forget' scope.",
  "code": "permission_denied",
  "requestId": "req_9f2c41ab7d0e5c18"
}
```

## It is on every response, including the empty ones

This matters more than it sounds. Four routes return `204 No Content`, and a 204 has no body to put a `requestId` in. Those routes are written to return no body at all rather than an empty response object, precisely so the header the dependency stack stamps survives.

So [`DELETE /v1/keys/{key_id}`](/api-reference/keys/delete-key), [`DELETE /v1/sandbox/keys/{key_id}`](/api-reference/keys/delete-sandbox-key), [`DELETE /v1/subjects/{subject_id}`](/api-reference/subjects/delete-subject) and [`DELETE /v1/me`](/api-reference/admin/delete-me) all give you a request id even though they give you nothing else.

## Capturing it

<CodeGroup>
  ```bash cURL theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
  curl -sS -D - -o body.json https://api.get-exo.com/v1/me \
    -H "X-Exo-API-Key: $EXO_KEY" \
    | grep -i '^x-request-id:'
  ```

  ```python Python theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
  import logging
  import httpx

  response = httpx.get(
      "https://api.get-exo.com/v1/me",
      headers={"X-Exo-API-Key": EXO_KEY},
  )

  request_id = response.headers.get("X-Request-Id")
  logging.info("exo %s %s -> %s [%s]",
               response.request.method, response.request.url.path,
               response.status_code, request_id)
  ```

  ```typescript TypeScript theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
  const response = await fetch("https://api.get-exo.com/v1/me", {
    headers: { "X-Exo-API-Key": process.env.EXO_KEY! },
  });

  const requestId = response.headers.get("X-Request-Id");
  console.info("exo GET /v1/me ->", response.status, `[${requestId}]`);
  ```
</CodeGroup>

The habit worth forming: log the request id on **every** call, not only on failures. When something looks wrong two days later, the successful call is often the one that needs explaining.

## What to do with it

* **Quote it in support.** With a request id, one specific call can be found. Without it, the answer starts with "which one".
* **Attach it to your own traces.** Putting the Exo request id on your span turns a cross-system investigation into a lookup.
* **Include it in user-facing error surfaces**, quietly. A support ticket that arrives with the id already in it skips a round trip.

## The format

Request ids look like `req_` followed by a hex string. Treat the whole value as opaque: match on it, do not parse it, and do not assume the length is fixed.

## Sending your own

There is no supported way to set the request id from the client in v1. The value on the response is the one Exo assigned, and it is the one to quote.

## Next

<Columns cols={2}>
  <Card title="Errors" icon="triangle-alert" href="/platform/errors">
    The problem envelope that repeats this id as `requestId`.
  </Card>

  <Card title="Rate limits" icon="gauge" href="/platform/rate-limits">
    The other headers on every response, and what to do with them.
  </Card>
</Columns>
