Skip to content
Phylax
Reference

Error codes

Every error response the Phylax API returns, what causes it, and whether to retry.

Response shape

Errors return a JSON body with a detail field:

{ "detail": "rate limit exceeded" }

Unhandled server errors additionally carry a request id:

{ "detail": "internal error", "request_id": "a1b2c3d4" }

Every response, successful or not, carries an x-request-id header. Quote it when reporting a problem; it is what correlates to the server side log.

Status codes

StatusMeaningRetry
400Malformed requestNo, fix the request
401Authentication failedNo, see below
403Authenticated but not permittedNo
404Resource not foundNo
411Content length required on POST, PUT, PATCHNo, set the header
413Request body too largeNo, reduce the body
422Request failed validationNo, fix the parameters
429Rate limitedYes, honour Retry-After
500Unhandled server errorYes, with backoff
502Upstream dependency unavailableYes, with backoff
503Service temporarily unavailableYes, with backoff
504Handler timed outYes, with backoff

Public read endpoints

StatusDetailCause
404round not foundUnknown or orphaned round id
404agent not foundThe hotkey has no agent row
422Validation errorA parameter is out of bounds, for example days above 180 or limit above 200
429rate limit exceededGlobal per IP limit, or a per endpoint limit

Transport level

These come from middleware and apply to every endpoint.

StatusDetailCause
411length requiredA POST, PUT or PATCH arrived without Content-Length
413Body too largeThe body exceeded the configured maximum, 64 MiB by default
429rate limit exceededThe global per IP ceiling, 300 per minute by default
500internal errorUnhandled exception. The request_id identifies the log entry
504request handler timed outThe handler exceeded the timeout, 60 seconds by default

GET /v1/health is exempt from the global rate limit.

Authentication errors

Only relevant if you hold an API key. No public read endpoint uses these.

StatusDetailCause
401malformed api keyThe token does not match phyx_<8 hex>_<48 hex>
401invalid or revoked api keyUnknown or revoked key
403api key lacks '<scope>' scopeValid key without the required scope
400cannot revoke the key you are currently usingSelf revocation attempt
404key not foundUnknown, already revoked, or owned by another account

Signed endpoint errors

You will not hit these unless you are running a validator or submitting agents, but they are listed because they appear in logs.

StatusDetailCause
401signature timestamp outside freshness windowClock skew beyond the window, 120 seconds by default
401signature already used (replay)The same hotkey, timestamp and signature triple was reused
403hotkey not registered on netuid 76Not on the metagraph
403hotkey does not hold a validator permit on netuid 76Registered without a permit
403validator access has been revokedThe validator record is revoked or suspended
403source IP … is not registered in the validator allowlistHost not allowlisted
403metagraph unavailable - cannot verify validator permitChain read failed and the cached snapshot is too stale
429too many signature failuresSignature failure rate limit per source IP

Retry guidance

For 429, read Retry-After and wait at least that long. For 500, 502, 503 and 504, use exponential backoff with jitter starting around one second.

Do not retry 4xx other than 429. They indicate a request that will fail identically every time.

Because most read endpoints are cached server side for 30 to 600 seconds, aggressive retrying returns the same cached body while consuming your rate limit. See rate limits.

Did this page help you?