Authentication Errors
Error: "Your API key was not found" / UNAUTHENTICATED / 401
Error: "Your API key was not found" / UNAUTHENTICATED / 401
- Verify you’re passing the key in the
Authorizationheader:"Authorization": "your-api-key" - For short-lived tokens (JWTs), use the
Bearerprefix:"Authorization": "Bearer <token>" - Check that your key hasn’t been deactivated on the dashboard
- If using the SDK, ensure you’re passing the key correctly:
new Codex("your-api-key")
"Not authorized: please upgrade your plan"
"Not authorized: please upgrade your plan"
Previously working API key suddenly returns errors
Previously working API key suddenly returns errors
- Check that you haven’t exceeded your plan’s monthly request limit — overages are charged at the same rate as your plan
- Verify the key is still active on the dashboard
- If using a short-lived token, it may have expired — generate a new one with
createApiTokens
WebSocket & Subscription Errors
Socket closed with event 4403 Forbidden
Socket closed with event 4403 Forbidden
- Wrong plan: Subscriptions require a Growth or Enterprise plan
- Missing auth: You must pass your API key in the
connection_initpayload, not as a URL parameter - Exceeded connection limit: Growth plans are limited to 300 concurrent WebSocket connections
Socket closed with event 4401 / Subscribing before connection_ack
Socket closed with event 4401 / Subscribing before connection_ack
subscribe message before the server has acknowledged your connection. You must wait for the connection_ack message before subscribing.graphql-ws, this is handled automatically.WebSocket disconnects after a period of inactivity
WebSocket disconnects after a period of inactivity
- SDK users: Heartbeats are handled automatically
- Custom implementations: Send a
pingmessage periodically. See the graphql-ws protocol for details
403 errors appearing intermittently on an active subscription
403 errors appearing intermittently on an active subscription
- You may have hit your plan’s connection limit (300 for Growth plans) — check if you have stale connections that weren’t properly closed
- Ensure you close subscriptions and connections when they’re no longer needed
- Deactivating an API key does not close active subscriptions — they persist until disconnected
I can't send queries through WebSockets — only subscriptions work
I can't send queries through WebSockets — only subscriptions work
https://graph.codex.io/graphql for queries and mutations. See the Subscriptions concept for more details.GraphQL Validation Errors
These errors mean your query has a field or argument that doesn’t exist on the type you’re querying. The error message tells you exactly what’s wrong.Cannot query field "isVerified" on type "EnhancedToken"
Cannot query field "isVerified" on type "EnhancedToken"
isVerified response field. Codex uses isScam instead — isScam: false is the equivalent of a token being “verified.”- To filter for verified tokens: use
isVerified: trueinfilterTokensfilters - To read verification status: use
isScamon the token object
Cannot query field "X" on type "Y" — general fix
Cannot query field "X" on type "Y" — general fix
| You wrote | Fix |
|---|---|
token { marketCap } | marketCap is on TokenFilterResult, not EnhancedToken. Use filterTokens to get it |
token { priceChange5m } | priceChange5m is only on PairMetadata. TokenFilterResult has priceChange1/4/12/24 but not 5m |
pair { factoryAddress } | factoryAddress is not a field on Pair |
detailedPairStats { pairId } | Use pairAddress instead |
tokenInfo { thumbHashUrl } | Use imageThumbUrl instead |
Unknown argument "inputs" on field — Did you mean "input"?
Unknown argument "inputs" on field — Did you mean "input"?
input (singular) while others use inputs (plural). Check the exact parameter name in the API reference.Common ones:onPricesUpdatedusesinput(singular) containing a list of tokensgetTokenPricesusesinputs(plural)tokenusesinput(singular)
Unknown argument "rankings" on field "Query.filterTokenWallets"
Unknown argument "rankings" on field "Query.filterTokenWallets"
filterTokenWallets does not support a rankings argument. It uses filters and pagination parameters (cursor, limit). Only filterTokens and filterPairs support rankings.Field "token0" must not have a selection since type "String!" has no subfields
Field "token0" must not have a selection since type "String!" has no subfields
Pair type, token0 and token1 are strings (token addresses), not objects. If you want token metadata from a pair query, use pairMetadata with enhancedToken0 / enhancedToken1 instead.GraphQL syntax errors (IDENT, LBRACE, COLON)
GraphQL syntax errors (IDENT, LBRACE, COLON)
- Missing colons between field names and arguments —
unexpected token - got: IDENT want one of: [COLON] - Template literals not rendering — if you’re using a tool like n8n, Make, or Retool, ensure your template syntax (
{{ }}) isn’t conflicting with GraphQL - Missing closing braces — count your
{and}to make sure they match
Null or Empty Results
getTokenPrices returns [null] for a token
getTokenPrices returns [null] for a token
- Token hasn’t traded yet — Codex only has price data for tokens with trading activity
- Pre-graduation launchpad token — bonding curve tokens may not have a price available via
getTokenPrices. UseonLaunchpadTokenEventBatchfor launchpad token prices, orfilterTokenswhich includespriceUSDfor launchpad tokens - Wrong address format — for Tron, use the hex (0x) address, not the base58 (T…) address
- Wrong networkId — verify you’re using the correct network ID for the chain
filterTokens returns empty results
filterTokens returns empty results
- Filters too narrow — loosen your filters and add them back one at a time to identify which one is excluding results
- Launchpad graduation filters —
launchpadGraduationPercentusesgt/lt/gte/lte, make sure your range isn’t excluding everything (e.g.,gt: 100won’t match anything since graduation maxes at 100) - Missing network filter — without a
networkfilter, results come from all chains which may dilute what you expect - Scam filtering — tokens flagged as potential scams are excluded by default. Add
includeScams: trueto include them
Null fields in subscription responses (balanceUsd, socialLinks, etc.)
Null fields in subscription responses (balanceUsd, socialLinks, etc.)
getTokenBars / getBars returns null
getTokenBars / getBars returns null
- Verify the
fromandtotimestamps are Unix timestamps (seconds, not milliseconds) - Check that the token/pair had trading activity during the requested time range
getTokenBarshas limited historical data — it may not cover older time ranges- For older historical data, use
getBarswith a specific pair address instead
getDetailedPairStats returns null for some pairs
getDetailedPairStats returns null for some pairs
listPairsWithMetadataForToken.getTokenEvents returns null / DOWNSTREAM_SERVICE_ERROR
getTokenEvents returns null / DOWNSTREAM_SERVICE_ERROR
getTokenEventsqueries the top pair by default — if the token has multiple pairs, events on other pairs won’t appear. UselistPairsWithMetadataForTokento find all pairs- If you’re getting a
DOWNSTREAM_SERVICE_ERROR, this is usually a temporary issue. Retry after a few seconds - Verify the token address and networkId are correct
filterTokenWallets returns empty results for a wallet that holds the token
filterTokenWallets returns empty results for a wallet that holds the token
filterTokenWallets only tracks wallets that acquired tokens via DEX swaps. If a wallet received tokens via a direct transfer (not a swap), it won’t appear in results. Use the balances query instead for a complete view of token holdings.Connection Limits & Rate Limits
How many WebSocket connections can I have?
How many WebSocket connections can I have?
- Growth plans: 300 concurrent WebSocket connections
- Enterprise plans: No hard limit — contact the team if you need guidance
How do connections vs subscriptions work?
How do connections vs subscriptions work?
- A connection is a single WebSocket to
wss://graph.codex.io/graphql - A subscription is a single
subscribemessage on that connection (e.g., oneonPriceUpdatedfor one token) - You can run multiple subscriptions on one connection — just send additional
subscribemessages - Some subscriptions accept multiple tokens (e.g.,
onPricesUpdatedcan watch up to 25 tokens)
HTTP 400 from too many items in a batch request
HTTP 400 from too many items in a batch request
getTokenPrices— max 25 tokens per requestfilterTokens— max 200 results per requestfilterWallets— has a limit on wallet addresses per request
What are the rate limits?
What are the rate limits?
- Batch requests where possible (e.g.,
getTokenPricesaccepts multiple tokens) - Cache responses that don’t change frequently (token metadata, social links)
- Use subscriptions instead of polling for real-time data
- Contact the team on Discord for custom rate limits if needed
Data Discrepancies
Liquidity values are lower than other platforms
Liquidity values are lower than other platforms
Prices differ from DexScreener / Birdeye / other platforms
Prices differ from DexScreener / Birdeye / other platforms
getTokenEvents.Tron tokens returning no data
Tron tokens returning no data
- Base58:
TXYZabc123...(what you see on explorers) - Hex:
0x41abc123...(what Codex requires)
Native tokens (ETH, SOL, BNB) — which address to use?
Native tokens (ETH, SOL, BNB) — which address to use?
Still Stuck?
- Test your queries in the explorer — it has autocomplete and will show validation errors instantly
- Browse the GraphQL Reference for exact field names and types
- Check the FAQ for questions about data coverage and best practices
- Ask on Discord — the team and community are active