HTTP status codes
HTTP error bodies
HTTP errors use adetail field. Each tool page includes these responses in its response selector.
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 indetail with an error_code and a message.
PRICE_CHANGED example shows only part of credit_catalog.
Headers
Retry-Afteron aPLAN_LIMIT_REACHEDresponse 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: 1is sent withCREDITS_UNAVAILABLE.- The per-key rate limiter’s
429does not sendRetry-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 hasstatus: "error", a message, and the same error_code and fields as above:
Tool-level status markers
A tool call can return200 OK and still contain no data. Nikiwa tools return their data object on success, or one of these markers:
Recommended handling
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.