Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.codex.io/llms.txt

Use this file to discover all available pages before exploring further.

Codex supports pay-per-request access using MPP (Machine Payments Protocol), an open, payment-method agnostic protocol built on HTTP 402. AI agents and scripts can query the Codex API without an API key by paying $0.001 per request. MPP is co-authored by Tempo and Stripe, and the core Payment HTTP Authentication Scheme is on the IETF standards track.

How it works

Traditional API access requires account creation, API keys, and prepaid credits. With MPP, the flow is:
  1. Send a request to the Codex API
  2. The server responds with HTTP 402 Payment Required and a payment challenge
  3. The client pays $0.001 via USDC on Tempo
  4. The server validates the payment and returns the data
No Codex account signup, no API key, no billing dashboard. Just pay and query.
MPP access is ideal for autonomous agents, bots, and scripts that need programmatic access without manual account setup. For human developers building apps, we still recommend getting an API key for the best experience.

Pricing

Cost per request$0.001 USDC
Payment networkTempo
Payment tokenUSDC
Additional payment networks and Stripe payment methods (cards, wallets) are coming soon.

Quick start

The fastest way is to install the Codex skill:
npx skills add Codex-Data/skills -g --yes
Then follow these steps to get started:
  1. Ask the agent to use Codex to get the top 25 trending tokens (or whatever your query is)
  2. It will then try to execute the query using the API key. If it fails, it will fallback to MPP.
    • Or you can just ask it to use MPP directly
  3. It will then install Tempo’s tempo CLI to manage your Tempo wallet
  4. It will then redirect you to the Tempo website to authorize access
  5. There, you can either fund your new wallet (from Base, Solana, Ethereum, etc), or use an existing one. Your new wallet must have at least 1 USDC on Tempo to continue.
  6. Once funded, you press Continue and you will be prompted to authorize Tempo to access your wallet
  7. Once authorized, your agent will attempt to run the query using MPP
Tempo wallet authorization

Example usage

Ask your agent:
“Get me a list of 20 dog tokens.”
It will then check to see if you have provided an API key. Assuming you have enabled MPP, the skill will guide the agent to run it to generate:
tempo request -t -X POST \
  -H 'X-Codex-Payment: mpp' \
  --json '{"query":"query FilterTokens($phrase: String, $rankings: [TokenRanking], $limit: Int) { filterTokens(phrase: $phrase, rankings: $rankings, limit: $limit) { results { buyVolume24 sellVolume24 circulatingMarketCap liquidity txnCount24 token { info { address name symbol networkId imageThumbUrl } } } } }","variables":{"phrase":"dog","rankings":[{"attribute":"txnCount24","direction":"DESC"}],"limit":20}}' \
  https://graph.codex.io/graphql 2>&1
And it will return a response like this:
  data:
    filterTokens:
      results[20]:
        - buyVolume24: "86690"
          sellVolume24: "86570"
          circulatingMarketCap: "1717"
          liquidity: "1683"
          txnCount24: 47348
          token:
            info:
              address: 7LFwtPuQL2iaziWkFdzJSNyHwG7ypro24txxSz6H79c7
              name: em@doge.gov
              symbol: dogemail
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_7LFwtPuQL2iaziWkFdzJSNyHwG7ypro24txxSz6H79c7_thumb.png"
        - buyVolume24: "254789"
          sellVolume24: "243302"
          circulatingMarketCap: "5689"
          liquidity: "0"
          txnCount24: 16042
          token:
            info:
              address: 44iEvdnRkp9KZxMmsgFRMjxu8YbvRXyNdvrKbcfc8RdT
              name: Dog Eat Dog
              symbol: Dash
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_44iEvdnRkp9KZxMmsgFRMjxu8YbvRXyNdvrKbcfc8RdT_thumb_cdbe60390207.png"
        - buyVolume24: "538396"
          sellVolume24: "524541"
          circulatingMarketCap: "981"
          liquidity: "0"
          txnCount24: 16041
          token:
            info:
              address: 7QTEsUYoMBGSTyGSxm8QFk5nWqeD5ro5WVgHtH9huge9
              name: Dog's POV
              symbol: POV
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_7QTEsUYoMBGSTyGSxm8QFk5nWqeD5ro5WVgHtH9huge9_thumb_efdd1321689b.png"
        - buyVolume24: "248973"
          sellVolume24: "244819"
          circulatingMarketCap: "16855"
          liquidity: "0"
          txnCount24: 13800
          token:
            info:
              address: HQkbFLLhCMj8x4p1AwzA8FbzxomBSkZkTT7fpvqDkxBt
              name: Dog's POV
              symbol: POV
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_HQkbFLLhCMj8x4p1AwzA8FbzxomBSkZkTT7fpvqDkxBt_thumb_efdd1321689b.png"
        - buyVolume24: "228547"
          sellVolume24: "220835"
          circulatingMarketCap: "20608"
          liquidity: "0"
          txnCount24: 10239
          token:
            info:
              address: CBAdBWQ8cSM2YqXxTk4GTs9VRWig8rn6GzgVuvt1D4hx
              name: Advice Dog
              symbol: DOG
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_CBAdBWQ8cSM2YqXxTk4GTs9VRWig8rn6GzgVuvt1D4hx_thumb_97699a101f77.png"
        - buyVolume24: "235342"
          sellVolume24: "224658"
          circulatingMarketCap: "6297"
          liquidity: "0"
          txnCount24: 10009
          token:
            info:
              address: 29c1SNtRS79THqcW8qyt4igoYC9PBXhHuAj4nbyBk5p6
              name: DOGE
              symbol: DOGE
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_29c1SNtRS79THqcW8qyt4igoYC9PBXhHuAj4nbyBk5p6_thumb_17476c0fd6b9.png"
        - buyVolume24: "141184"
          sellVolume24: "123372"
          circulatingMarketCap: "21912"
          liquidity: "0"
          txnCount24: 9844
          token:
            info:
              address: QNvxZCtHhgbWFM9qCvyKRgB9m5AzsiQ6mg37BksTu3Q
              name: DOGE
              symbol: DOGE
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_QNvxZCtHhgbWFM9qCvyKRgB9m5AzsiQ6mg37BksTu3Q_thumb_17476c0fd6b9.png"
        - buyVolume24: "155536"
          sellVolume24: "138576"
          circulatingMarketCap: "3398"
          liquidity: "0"
          txnCount24: 8840
          token:
            info:
              address: 2YEaca3EXNppXobJFgYLdb8sFEx7NTMPJX2D7TWrZXHm
              name: DOGE
              symbol: DOGE
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_2YEaca3EXNppXobJFgYLdb8sFEx7NTMPJX2D7TWrZXHm_thumb_17476c0fd6b9.png"
        - buyVolume24: "147565"
          sellVolume24: "134144"
          circulatingMarketCap: "4791"
          liquidity: "0"
          txnCount24: 7769
          token:
            info:
              address: 68tHc9SKokmimJgsC14wEn28T8hk6RTjufMQszMdCpfe
              name: DOGE
              symbol: DOGE
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_68tHc9SKokmimJgsC14wEn28T8hk6RTjufMQszMdCpfe_thumb_17476c0fd6b9.png"
        - buyVolume24: "55973"
          sellVolume24: "56836"
          circulatingMarketCap: "25633"
          liquidity: "6669"
          txnCount24: 7008
          token:
            info:
              address: F2c9NYX7YKXnXrdRCTEH1gbLYoubc6AVWZJdcxkypump
              name: Dark Doge
              symbol: DarkDoge
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_F2c9NYX7YKXnXrdRCTEH1gbLYoubc6AVWZJdcxkypump_1732216636_thumb.png"
        - buyVolume24: "862735"
          sellVolume24: "799848"
          circulatingMarketCap: "57214767"
          liquidity: "4969132"
          txnCount24: 6225
          token:
            info:
              address: MEW1gQWJ3nEXg2qgERiKu7FAFj79PHvQVREQUzScPP5
              name: cat in a dogs world
              symbol: MEW
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_MEW1gQWJ3nEXg2qgERiKu7FAFj79PHvQVREQUzScPP5_thumb_11d957ce-c1ae-4d0a-a460-7b923f40fb76.png"
        - buyVolume24: "69913"
          sellVolume24: "66098"
          circulatingMarketCap: "117"
          liquidity: "0"
          txnCount24: 5781
          token:
            info:
              address: 5pB2eczikYMfy5fHxEgDhnGBc8V7YD1doaxecF2Q5Jcr
              name: Dog's POV
              symbol: POV
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_5pB2eczikYMfy5fHxEgDhnGBc8V7YD1doaxecF2Q5Jcr_thumb_efdd1321689b.png"
        - buyVolume24: "58304"
          sellVolume24: "54016"
          circulatingMarketCap: "1695"
          liquidity: "0"
          txnCount24: 5622
          token:
            info:
              address: 2dDvi5QpiR1UxzDwJX1t1szMbSyTq9Ldkevgn5DmUKWH
              name: DOGE
              symbol: DOGE
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_2dDvi5QpiR1UxzDwJX1t1szMbSyTq9Ldkevgn5DmUKWH_thumb_17476c0fd6b9.png"
        - buyVolume24: "93700"
          sellVolume24: "89610"
          circulatingMarketCap: "16680"
          liquidity: "0"
          txnCount24: 5122
          token:
            info:
              address: 7BWKvpK7RjEuRxoZnQ9yCePgathaY2F6gRrdTpknsXkJ
              name: Dog Eat Dog
              symbol: Dash
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_7BWKvpK7RjEuRxoZnQ9yCePgathaY2F6gRrdTpknsXkJ_thumb_cdbe60390207.png"
        - buyVolume24: "78378"
          sellVolume24: "154758"
          circulatingMarketCap: "72139728"
          liquidity: "4366889"
          txnCount24: 4911
          token:
            info:
              address: "0xc748673057861a797275cd8a068abb95a902e8de"
              name: Baby Doge Coin
              symbol: BabyDoge
              networkId: 56
              imageThumbUrl: "https://token-media.defined.fi/56_0xc748673057861a797275cd8a068abb95a902e8de_thumb_bac0895ae46f.png"
        - buyVolume24: "255927"
          sellVolume24: "257210"
          circulatingMarketCap: "1878610"
          liquidity: "80782"
          txnCount24: 4781
          token:
            info:
              address: 6iA73gWCKkLWKbVr8rgibV57MMRxzsaqS9cWpgKBpump
              name: what the dog doing?
              symbol: 我的刀盾
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_6iA73gWCKkLWKbVr8rgibV57MMRxzsaqS9cWpgKBpump_thumb_63b436b284e0.png"
        - buyVolume24: "58891"
          sellVolume24: "52566"
          circulatingMarketCap: "1991"
          liquidity: "0"
          txnCount24: 4630
          token:
            info:
              address: E3ZKPeFCEZ5syUK6tdJBiGKhJQCo6CnJSR88kbiaJF9b
              name: DOGE
              symbol: DOGE
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_E3ZKPeFCEZ5syUK6tdJBiGKhJQCo6CnJSR88kbiaJF9b_thumb_17476c0fd6b9.png"
        - buyVolume24: "426486"
          sellVolume24: "436956"
          circulatingMarketCap: "1426107"
          liquidity: "83658"
          txnCount24: 4186
          token:
            info:
              address: "0x640c04ca09c5c5140e62fef42c59e3afdbbd4444"
              name: what the dog doing?
              symbol: 我的刀盾
              networkId: 56
              imageThumbUrl: "https://token-media.defined.fi/56_0x640c04ca09c5c5140e62fef42c59e3afdbbd4444_thumb_b73c93973cee.png"
        - buyVolume24: "32557"
          sellVolume24: "27629"
          circulatingMarketCap: "11200"
          liquidity: "0"
          txnCount24: 3696
          token:
            info:
              address: CSsb7SsJsayWy9ZuDcMzjLzKiUbiJr734kSoVCtUKXBc
              name: DOGE
              symbol: DOGE
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_CSsb7SsJsayWy9ZuDcMzjLzKiUbiJr734kSoVCtUKXBc_thumb_17476c0fd6b9.png"
        - buyVolume24: "42281"
          sellVolume24: "36618"
          circulatingMarketCap: "2278"
          liquidity: "0"
          txnCount24: 3523
          token:
            info:
              address: 6VM8Wp8ireGjWG18ZwPWFaRNkRXyG1aMyepjBCYrWu3b
              name: DOGE
              symbol: DOGE
              networkId: 1399811149
              imageThumbUrl: "https://token-media.defined.fi/1399811149_6VM8Wp8ireGjWG18ZwPWFaRNkRXyG1aMyepjBCYrWu3b_thumb_17476c0fd6b9.png"
And then it will likely summarize the results for you, like this: Codex Skills Summary
This is not an endorsement of any of these tokens, and they may be scams or rugs. Please do your own research before investing. You can also ask your agent to filter out scams.

Supported endpoints

MPP is available for all Codex query endpoints. Here are some of the most popular ones: See the full GraphQL Reference for all available endpoints. The beauty with the Codex Skills, however, is you don’t have to worry about any of this. Just ask your agent to use MPP and it will handle everything for you.
WebSocket subscriptions and webhooks are not available via MPP at this time.

MPP vs x402

Both protocols use HTTP 402 to signal that a request requires payment. MPP extends beyond x402 in several ways:
MPPx402
Payment methodsStablecoins, cards, wallets, custom railsBlockchain only
Session paymentsPay-as-you-go with off-chain vouchersPer-request only
CompatibilityCan consume existing x402 services
MPP is fully compatible with x402. The core x402 flows map directly onto MPP’s charge intent.
At the moment, Codex only supports payments via MPP on the Tempo network. We will add support for other networks and payment methods in the future.

Learn more

  • MPP Documentation — Full protocol docs, SDKs, and guides
  • MPP FAQ — Common questions about the protocol
  • x402 Protocol — The open standard for HTTP-native payments
  • Example repo — Full working example with Codex
  • presto CLI — Command-line client for making paid requests
  • Tempo — The network powering MPP stablecoin payments