Skip to main content

Debugging

Every response includes an x-api-gateway-request-id header. This is the same request ID that appears in your team’s Request Logs, so you can match a failed client request to its full server-side record (status, latency breakdown, firewall decision, credits consumed). Log this header on every response. When reporting an issue to support, include it alongside the response body so we can look up the request immediately.
const response = await fetch("https://api.jup.ag/swap/v2/order?...", {
  headers: { "x-api-key": API_KEY },
});

if (!response.ok) {
  const requestId = response.headers.get("x-api-gateway-request-id");
  const body = await response.text();
  console.error(`[${response.status}] request=${requestId} body=${body}`);
}
Product-specific error codes are documented on each product’s page.

HTTP status codes

CodeDescriptionDebug
200SuccessRequest completed successfully.
400Bad RequestCheck the request parameters and syntax.
401UnauthorisedSent when you provide an invalid or unknown API key. A request with no x-api-key header is treated as keyless, not rejected. Check that your key is correct and active.
403ForbiddenEither your API key lacks permission for the endpoint (message: API key does not have access to this endpoint) or a firewall rule blocked the request (message: Request blocked by firewall).
404Not FoundCheck the endpoint URL.
429Rate LimitedYou exceeded a rate limit. The message tells you which: [API Gateway] Too many requests is your plan limit, Too many requests is a firewall rate-limit rule. Slow down or implement backoff. See Rate Limits for details.
5xxServer ErrorRetry with backoff. If persistent, submit a Portal Enquiry or reach out in Discord Dev Support.