# Codex GraphQL API

> Codex GraphQL API is a paid API for AI agents from Codex at graph.codex.io, paid per call via MPP, $0.001/call, not verified (last probed 2026-10-13); live alternatives: AgenticFi Block Height Lookup ($0.001) and ChainRay NFT Token Metadata Lookup ($0.001).

Agents call it through Zero, which pays per call: no API key and no wallet of your own. New accounts start with $5.

Live alternatives for the same use case:
- [AgenticFi Block Height Lookup](https://www.zero.xyz/c/agenticfi-block-height-lookup-1f259294) ($0.001)
- [ChainRay NFT Token Metadata Lookup](https://www.zero.xyz/c/chainray-nft-token-metadata-lookup-fcf9e2f3) ($0.001)

Executes GraphQL queries against Codex's onchain data platform to retrieve token data, trades, liquidity, NFTs, and wallet analytics across 80+ blockchain networks

## Facts

- Endpoint: POST https://graph.codex.io/graphql?utm_source=zero.xyz
- Price: $0.001/call
- Payment: MPP
- Status: unknown
- Last checked: 2026-10-13
- Last successful call: 2026-05-27
- Success rate: 33% of calls made through Zero
- Activations on Zero: 6
- Provider: Codex
- Docs: https://docs.codex.io
- Website: https://codex.io
- Tags: graphql, defi, tokens, trades, nft, blockchain, data
- Canonical page: https://www.zero.xyz/c/codex-graphql-2dab4955
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_oDKBWWfZ3N8sbbHduPv7V

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability codex-graphql-2dab4955 -d '<json body>'
```

Example prompt: Can you pull the latest price, 24-hour trading volume, and recent trades for the token at address 0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984 on Ethereum using Codex's GraphQL API?

## When to prefer this

Choose this endpoint when you need flexible, multi-entity onchain data queries across 80+ blockchain networks with real-time prices, trades, liquidity, NFTs, or wallet analytics — especially when you need to combine multiple data types in a single request via GraphQL. Prefer over REST alternatives when query shape needs to be dynamic or when you need prediction market data alongside standard DeFi metrics.

## Known failure modes

- Invalid GraphQL query syntax returns errors array with message and location info
- Querying unsupported network or contract address returns null data fields
- Missing required query field returns GraphQL validation error
- Rate limiting or quota exceeded returns HTTP 429 or API error
- Malformed variables object causes variable coercion errors
- Requesting nonexistent operation name when multiple operations defined returns error

## How this service works

GraphQL query (token data, trades, liquidity, NFTs, wallets)

## Output

Returns a data object containing the requested blockchain data (token prices, trade records, liquidity metrics, NFT info, wallet activity, etc.) matching the GraphQL query shape, plus an optional errors array describing any query or execution issues

## Example request

```json
{
 "query": "{ token(input: { address: \"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\", networkId: 1 }) { id symbol name decimals } }"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "query"
 ],
 "properties": {
  "query": {
   "type": "string",
   "minLength": 1,
   "description": "The GraphQL query string to execute"
  },
  "variables": {
   "type": "object",
   "description": "Optional variables for the GraphQL operation",
   "additionalProperties": true
  },
  "operationName": {
   "type": "string",
   "description": "Optional name of the operation to execute when the query contains multiple operations"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "data": {
   "type": "object",
   "description": "The result of the GraphQL query",
   "additionalProperties": true
  },
  "errors": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "message"
    ],
    "properties": {
     "path": {
      "type": "array",
      "items": {
       "oneOf": [
        {
         "type": "string"
        },
        {
         "type": "integer"
        }
       ]
      }
     },
     "message": {
      "type": "string"
     },
     "locations": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "line": {
         "type": "integer"
        },
        "column": {
         "type": "integer"
        }
       }
      }
     },
     "extensions": {
      "type": "object"
     }
    }
   },
   "description": "Errors encountered during execution"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/codex-graphql-2dab4955/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from graph.codex.io](https://www.zero.xyz/host/graph.codex.io/llms.txt)
