API Reference

Error Reference

All Hive API errors follow a consistent envelope so your code can parse failures programmatically.


REST API Error Format

Every REST error response returns this shape:

{
  "ok": false,
  "error": {
    "type": "authentication_error",
    "code": "AUTH_REQUIRED",
    "message": "API key required. Set Authorization: Bearer <key> (or x-api-key) header.",
    "request_id": "req_12345",
    "doc_url": "https://docs.hiveintelligence.xyz/errors#auth-required"
  }
}
FieldDescription
okAlways false on errors
error.typeMachine-readable error category
error.codeSpecific error code for programmatic handling
error.messageHuman-readable explanation
error.request_idUnique ID for the request (include in support tickets)
error.doc_urlLink to the relevant documentation section

HTTP Status Codes

StatusError TypeCodeWhen It Happens
400invalid_request_errorVALIDATION_ERRORMissing required parameter, invalid JSON
400invalid_request_errorMISSING_PARAMRequired parameter not provided
401authentication_errorAUTH_REQUIREDNo API key in request
403authentication_errorINVALID_API_KEYAPI key is invalid or revoked
404not_found_errorTOOL_NOT_FOUNDTool name doesn't exist in catalog
404not_found_errorENDPOINT_NOT_FOUNDURL path doesn't match any route
429rate_limit_errorRATE_LIMITEDToo many requests in the current window
429rate_limit_errorQUOTA_EXCEEDEDMonthly credit quota exhausted
500internal_errorINTERNAL_ERRORServer error
502provider_errorAPI_ERRORUpstream provider (CoinGecko, DeFiLlama, etc.) returned an error
503internal_errorSHUTTING_DOWNServer is restarting

Rate Limit Headers

All responses include rate limit headers:

RateLimit-Limit: 1000
RateLimit-Policy: 1000;w=60
X-RateLimit-Remaining: 999
X-Quota-Remaining: 499992
Retry-After: 60  (only on 429 responses)
HeaderDescription
RateLimit-LimitMaximum requests allowed in the current window
RateLimit-PolicyWindow size in seconds (w=60 means per minute)
X-RateLimit-RemainingRequests remaining before throttling
X-Quota-RemainingMonthly credits remaining for the account, or unlimited
Retry-AfterSeconds to wait before retrying (only present on 429 responses)

Rate Limits by Plan

PlanRate LimitMonthly Credits
Demo (Free)30 req/min10,000
Analyst ($129/mo)500 req/min500,000
Pro ($499/mo)1,000 req/min2,000,000
Enterprise3,000 req/minUnlimited

Upgrade your plan from the Dashboard Plans page.


Tool-Level Error Codes

These codes appear in the error.code field when a tool execution fails:

CodeWhen It Happens
INVALID_PARAMETERParameter value is wrong type or out of range
INVALID_COIN_IDCoin ID doesn't exist (e.g., typo in CoinGecko ID)
INVALID_NETWORK_IDNetwork/chain ID not supported
INVALID_ADDRESSWallet or contract address is malformed
COIN_NOT_FOUNDCoinGecko can't find the requested coin
POOL_NOT_FOUNDDEX pool doesn't exist
TOKEN_NOT_FOUNDToken contract not found on the specified chain
RATE_LIMITProvider-level rate limit (separate from Hive rate limit)
TIMEOUTRequest to upstream provider timed out
NETWORK_ERRORConnection to upstream provider failed

Provider Error Handling

When an upstream provider (CoinGecko, DeFiLlama, GoPlus, etc.) returns an error, Hive follows this sequence:

  1. Retries with exponential backoff - up to 3 attempts before giving up
  2. Returns 502 with provider_error type if all retries fail
  3. Circuit breaker opens after 5 consecutive failures to the same provider, failing fast for 30 seconds before testing recovery

A 502 response with error.type: "provider_error" means the issue is upstream, not with your request. Retry after a short delay or check the provider's status page.


MCP Error Format

MCP errors follow the JSON-RPC 2.0 specification:

{
  "jsonrpc": "2.0",
  "error": {
    "code": -32603,
    "message": "Internal server error"
  },
  "id": null
}

MCP Error Codes

CodeMeaning
-32700Parse error - invalid JSON received
-32600Invalid request - missing required JSON-RPC fields
-32601Method not found - the method name doesn't exist
-32603Internal error - server-side failure

Troubleshooting

"AUTH_REQUIRED" but I'm sending my key

Check that you're using the correct header format:

Authorization: Bearer YOUR_KEY

or (legacy alias)

x-api-key: YOUR_KEY

Common causes: sending the key as a query parameter instead of a header, or using Authorization: YOUR_KEY without the Bearer prefix.

"RATE_LIMITED" on the free tier

The Demo tier allows 30 requests per minute. Wait for the Retry-After period indicated in the response header, or upgrade to Analyst (500 req/min) from the Dashboard Plans page.

"TOOL_NOT_FOUND"

Tool names are case-sensitive. Use the REST discovery endpoint to find the correct name:

curl https://mcp.hiveintelligence.xyz/api/v1/tools?search=price \
  -H "Authorization: Bearer YOUR_KEY"

Or use the MCP resource hive://tools for the full live tool inventory.

Provider returning empty results

Some providers require specific parameter formats. Check hive://tools or the REST discovery endpoint for the exact schema:

curl https://mcp.hiveintelligence.xyz/api/v1/tools?search=TOOL_NAME \
  -H "Authorization: Bearer YOUR_KEY"