Skip to main content
Nikiwa signals outcomes at two levels: standard HTTP status codes for transport and auth, and in-body status markers for tool-level results.

HTTP status codes

HTTP error bodies

HTTP errors use a detail field. Each tool page includes these responses in its response selector.
The plan, balance, and reset time above are illustrative. See Credit errors for all credit responses. Request validation errors use an array in detail. For example, a body containing only { returns:
loc identifies the invalid input; msg and type describe the failure. Other validation errors can include different input and ctx values.

Credit errors

Tools API and MCP calls are paid with credits. A call refused for credits is not charged and does not run. Credit errors put an object in detail with an error_code and a message.
The values above are illustrative, and the PRICE_CHANGED example shows only part of credit_catalog.

Headers

  • Retry-After on a PLAN_LIMIT_REACHED response gives the seconds until credits refresh. It is omitted when the refresh date is not known yet, for example while a failed renewal payment is pending.
  • Retry-After: 1 is sent with CREDITS_UNAVAILABLE.
  • The per-key rate limiter’s 429 does not send Retry-After.
  • Successful responses do not include balance headers. Check your balance in the app; see Credits.

On MCP

The MCP server returns credit errors as a tool result rather than a protocol error. The result has status: "error", a message, and the same error_code and fields as above:

Tool-level status markers

A tool call can return 200 OK and still contain no data. Nikiwa tools return their data object on success, or one of these markers:
Always branch on the body, not just the HTTP code. A 200 with {"status": "no_data"} means the query was valid but nothing matched, for example a wallet with no activity on the requested network.
1

Check the HTTP status

For non-200 responses, read detail. Correct 400, 401, 404, and 422 failures before retrying. For 429, distinguish the request-rate limit from PLAN_LIMIT_REACHED. For 409 and 503, check detail.error_code.
2

Check for a status marker

If the body has status: "error", status: "no_data", or an error field, handle it explicitly.
3

Otherwise, use the data

A body with no error or no-data marker is a successful data result.