> For the complete documentation index, see [llms.txt](https://docs.nansen.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nansen.ai/api/changelog/08-10-2026-error-responses-credits-used.md).

# 08-10-2026: Error Responses Report X-Nansen-Credits-Used: 0

Credits are deducted only for successful (2xx) responses. Until now, an error response from a paid endpoint carried `X-Nansen-Credits-Cost` but no `X-Nansen-Credits-Used`, which made it hard to tell whether the request was charged.

**Every non-2xx response that carries `X-Nansen-Credits-Cost` now also carries `X-Nansen-Credits-Used: 0`.** This includes `422` validation errors and `500` errors. Requests rejected before pricing may carry neither header. `X-Nansen-Credits-Remaining` is sent when an account balance is available, including credit-checked successful responses and insufficient-credit `403` responses.

**Blocked-token `422` errors now name the rejected field.** When a token is not supported on an endpoint (for example Solana USDC or native SOL on `POST /api/v1/tgm/dex-trades`), the error used to report `errors[].field` as `body` and no `param`. It now reports the field that holds the address:

|                  | Before | Now                  |
| ---------------- | ------ | -------------------- |
| `param`          | `null` | `token_address`      |
| `errors[].field` | `body` | `body.token_address` |

The same change applies to every endpoint that rejects a specific token or native-token address, for example `tgm/transfers`, `tgm/jup-dca`, `tgm/flows`, `tgm/pnl-leaderboard` and `profiler/address/counterparties` (where it names the wallet field you sent, such as `wallet_addresses[1]`). The status code, `code` and message do not change.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.nansen.ai/api/changelog/08-10-2026-error-responses-credits-used.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
