Skip to content

Error Codes

Every error returned by the Openfish API is a JSON object containing a single error field:

{
"error": "<message>"
}

The server maps errors to HTTP status codes through five internal variants:

// From openfish-clob-server error.rs
pub enum AppError {
BadRequest(String), // 400
Unauthorized(String), // 401
NotFound(String), // 404
Conflict(String), // 409
Internal(String), // 500
}

These responses may appear on any authenticated endpoint.

StatusMessageCause
401Unauthorized/Invalid api keyAPI key is missing, expired, or invalid
401Invalid L1 Request headersL1 authentication headers are malformed or the signature does not match
429Too Many RequestsRate limit exceeded; implement exponential backoff
500database errorInternal database failure; retry with backoff

StatusMessageCause
400invalid OPENFISH_ADDRESSThe address header is not a valid Ethereum address
401L1 verification failureSignature, timestamp, or nonce does not pass L1 verification
409API key already exists for this address and nonceA key with this address/nonce combination already exists
StatusMessageCause
404no API key found for this address and nonceNo key exists for the given address and nonce
StatusMessageCause
401L2 authentication failureInvalid or missing L2 auth headers
StatusMessageCause
404API key not foundThe key does not exist or does not belong to your account

StatusMessageCause
400builderId requiredThe request body is missing the builderId field
401L2 authentication failureInvalid or missing L2 auth headers
500could not create builder api keyServer-side error during key creation
StatusMessageCause
500could not get builder api keysServer-side error fetching keys
StatusMessageCause
400invalid apiKeyThe apiKey query parameter is not a valid UUID
404builder API key not foundThe key does not exist or does not belong to your account

StatusMessageCause
400Invalid token idThe token_id parameter is missing or invalid
404No orderbook exists for the requested token idNo market found for this token
StatusMessageCause
400Invalid payloadRequest body is malformed or missing required fields
400Payload exceeds the limitToo many token IDs in a single request

StatusMessageCause
400Invalid order payloadRequest body is malformed or contains invalid values
400the order owner has to be the owner of the API KEYMaker address does not match your API key
400'{address}' address bannedThe address has been banned from trading
400'{address}' address in closed only modeThe address is restricted to closing positions only

All errors from POST /order apply, plus:

StatusMessageCause
400Too many orders in payload: {N}, max allowed: {M}Batch exceeds the maximum order count per request

These errors pass initial validation but fail during matching engine processing.

StatusMessageCause
400invalid post-only order: order crosses bookA maker-only order would immediately match; adjust the price
400order {id} is invalid. Price ({price}) breaks minimum tick size rule: {tick}Price does not align with the market’s tick size
400order {id} is invalid. Size ({size}) lower than the minimum: {min}Order size below market minimum
400order {id} is invalid. Duplicated.Duplicate order submission
400not enough balance / allowanceInsufficient USDC.e balance or token allowance
400invalid nonceOrder nonce already used or invalid
400invalid expirationExpiration timestamp is in the past
400order couldn't be fully filled. FOK orders are fully filled or killed.Fill-or-Kill order could not be completely filled
400no orders found to match with FAK order.Fill-and-Kill order found no matching orders

StatusMessageCause
400Invalid order payloadRequest body is malformed
400Invalid orderIDThe order ID is not a valid format
StatusMessageCause
400Too many orders in payload, max allowed: {N}Too many IDs in a single cancellation request

StatusMessageCause
400OPENFISH_BUILDER_ID header requiredThe OPENFISH_BUILDER_ID header is missing or empty
400invalid JSON: {details}Request body is not valid JSON
400missing 'order' fieldThe order key is missing from the request body
StatusMessageCause
400OPENFISH_BUILDER_ID header requiredMissing builder attribution header
400invalid JSON: {details}Request body is not valid JSON

StatusMessageCause
400tokenId and size requiredMissing or zero-value token ID or size
StatusMessageCause
400valid rfqId requiredThe rfqId is missing or not a valid UUID
400price requiredMissing or unparseable price
400RFQ not found, expired, or already filledThe RFQ is no longer open
StatusMessageCause
400rfqId or quoteId requiredNeither identifier was provided
400RFQ not found or not owned by youThe RFQ does not belong to the authenticated user
404no valid quotes availableNo non-expired PENDING quotes exist for this RFQ
404quote not found, expired, or already processedThe selected quote is no longer valid

StatusMessageCause
400Invalid token idThe token_id parameter is missing or invalid
400Invalid sideThe side parameter must be BUY or SELL
404No orderbook exists for the requested token idNo market found

StatusMeaningCommon Causes
400Bad RequestInvalid parameters, malformed payload, business logic violation
401UnauthorizedMissing or invalid API key, bad HMAC signature
404Not FoundMarket does not exist, order not found, token ID not recognised
409ConflictDuplicate resource (e.g., API key already exists)
429Too Many RequestsRate limit exceeded; implement exponential backoff
500Internal Server ErrorUnexpected server error; retry with backoff