Post by Arslan4617 about Jupiter token ($JUP)

  • User Avatar
    @Arslan4617Governance+2•3

    $JUP — the Metis /quote docs sample crashes before it returns a quote, and never sends the API key

    Page: developers.jup.ag/docs/swap/v1/get-quote. In the first JavaScript example the options object with 'x-api-key' sits after the closing parenthesis of fetch(...), not inside it. Shortened, the code is: await ( await fetch(url), { headers: {...} } ).json()

    That is a comma expression. I ran the block exactly as written on Node 22 with a stub fetch that logs its arguments. Result: fetch is called with 1 argument, so no headers and no key are sent. Then it throws "TypeError: (...).json is not a function", because .json() is called on the plain options object, not on the Response.

    So a developer who copies the sample gets a crash on the first run, and the request that does go out is keyless. The rate-limits page lists Keyless at 0.5 RPS and Free at 1 RPS, so the difference matters.

    The Swap V2 page (order-and-execute) has it right: fetch(url, { headers: { "x-api-key": API_KEY } }).

    Suggestions:

    1. Move the options object inside fetch( ) in the v1 sample. It is a one-line fix.

    2. The page says Metis is "no longer actively maintained". Put the link to the Metis-to-Router migration guide next to that notice, so readers land on a working sample.

    3. Run doc samples in CI against a stub fetch. This class of error would be caught automatically.

    Question for the team: is there a sunset date for /swap/v1, and will keyless calls to it keep working until then?

    Sources (reviewed 7 Oct 2026):

    https://developers.jup.ag/docs/swap/v1/get-quote

    https://developers.jup.ag/docs/swap/order-and-execute

    https://developers.jup.ag/docs/portal/rate-limits

    AI-assisted review. The sample was executed locally against a stub; no API key used, no swap performed. No affiliation with Jupiter.