Docs
Buscar⌘ K
  • Inicio
  • Acerca de The Graph
  • Redes Admitidas
  • Protocol Contracts
  • Subgrafos
    • Corrientes secundarias
      • Token API
        • Hypergraph
          • AI Suite
            • Indexación
              • Graph Horizon
                • Recursos
                  Token API > Guides

                  4 minutos

                  How the Token API Powers Custom GPTs

                  Overview

                  The Token API is a pre-indexed blockchain data service that provides real-time access to token balances, metadata, prices, liquidity, and volume across multiple chains. Developers use its REST endpoints to build wallets, trading dashboards, DeFi analytics, and AI systems without maintaining their own indexing stack. Custom GPTs can connect directly to the Token API’s OpenAPI schema.

                  The Token API enables developers to build Custom GPTs to reason over live blockchain data inside ChatGPT that can reason over and respond with live blockchain data directly inside ChatGPT.

                  What the Token API Enables in Custom GPTs

                  When a Custom GPT is wired to the Token API, it gains access to a machine-readable schema and authenticated endpoints. Developers can use this to:

                  • Query real-time onchain data: Balances, token prices, liquidity, and transaction history.
                  • Automate domain-specific tasks: Portfolio tracking, accounting, reconciliation, and market analysis.
                  • Power AI agents with verifiable blockchain context: Use the same data sources dapps rely on.

                  Because the Token API provides a machine-readable schema and authenticated requests, it serves as a structured data layer that enables GPT-5 agents to combine natural language reasoning with live onchain data from The Graph.

                  When to Use the Token API for Custom GPTs

                  Use the Token API when your GPT needs repeatable, domain-specific behavior grounded in blockchain data. This is most effective when the GPT performs the same type of task frequently or enforces a workflow you define. For one-off or exploratory questions, standard ChatGPT prompts are sufficient.

                  Choosing a Use Case

                  Start with a clear, narrow objective, then expand as needed. Common patterns include:

                  • Accounting GPT: Onchain accounting, tax tagging, and portfolio reconciliation.
                  • Trading GPT: Liquidity, pricing, and volume analysis for trading strategies.
                  • Protocol Tracking GPT: Real-time monitoring of transaction activity and liquidity pools.

                  A focused initial goal such as “Retrieve token balances and prices for a wallet” makes it easier to configure reliable behavior before adding complex workflows.

                  Requirements

                  RequirementDescription
                  ChatGPT 5Custom GPT creation requires GPT-5 tier or Pro.
                  Token API SubscriptionSign up at The Graph Market⁠
                  Token API KeyAvailable in your dashboard as the Authentication JWT.

                  Setting Up a Custom GPT

                  Below is an explanatory outline of what happens during setup. This section provides conceptual understanding.

                  Create Custom GPT

                  1. Visit chat.openai.com/gpts in your browser. 2, Click Create (top right).
                  2. Under Configure (in the top left panel), set up your GPT’s personality and scope.

                  Configure Your GPT

                  You define the GPT’s role, scope, and metadata so it knows what it is designed to do. This includes:

                  • Name and Description: Helps users discover your GPT.
                    • For example: Name: Token Tracker GPT Description: An onchain analytics assistant that retrieves live token balances, prices, and liquidity data using The Graph’s Token API.
                  • Instructions: Tells the GPT what tasks it should perform using the Token API.
                    • For example: You are a blockchain data assistant retrieving onchain token data from The Graph’s Token API. Use endpoints to fetch balances, liquidity, and price history across EVM chains. Present results in tables with token symbols, prices, and USD values.
                  • Knowledge: Optional context files such as wallet references, accounting rules, or code snippets.
                  • New Action: At the bottom, click “Create new action” to connect your GPT to the Token API.

                  Connect the Token API

                  To enable live blockchain queries inside ChatGPT, you connect the GPT to the Token API through:

                  Authentication

                  1. Set Authentication to API Key → Bearer.
                  2. Open The Graph Market⁠ and copy your Authentication JWT from your dashboard.
                  3. Paste the token into the ChatGPT prompt where the field shows [HIDDEN].

                  Schema

                  1. Above the Schema box, click Import from URL.
                  2. Paste: https://token-api.thegraph.com/openapi⁠
                  3. Click Import. You’ll now see endpoints like:
                    • getV1EvmTokens
                    • getV1EvmDexes
                    • getV1EvmBalances
                  4. Click Test on one (for example getV1EvmDexes) to verify connection.
                  Privacy
                  1. At the bottom, under Privacy, paste: https://pinax.network/en/legal/privacy⁠

                  Privacy

                  You can attach a privacy policy URL such as: https://pinax.network/en/legal/privacy⁠

                  Example Prompt Patterns

                  These examples help illustrate how a GPT reasons over Token API data.

                  Wallet and Portfolio

                  Get the total USD balance for a wallet across multiple chains, returning token name, symbol, balance, and price.

                  Trading Analysis

                  Compare USDC and DAI liquidity across Uniswap and Curve. Return the top 5 pools by TVL.

                  Accounting

                  List all ERC-20 transfers for this address in the last 30 days. Group by token and total incoming/outgoing volume.

                  Best Practices

                  TipWhy It Matters
                  Scope your GPT narrowly firstSimplifies debugging and validates schema integration.
                  Use clear role instructionsHelps the GPT choose the right endpoints and avoid assumptions.
                  Name endpoints explicitlyImproves routing accuracy when fetching balances, prices, or DEX data.
                  Combine with codeEnables custom parsing or logic for complex workflows.
                  Add Subgraph or Substream contextProvides richer analytics when combined with Token API data.

                  FAQs & Resources

                  • Builders Office Hours (October 23, 2025)
                  • Watch the full session: https://x.com/i/broadcasts/1mrGmBzBarNJy⁠
                  ⁠Editar en GitHub⁠

                  Endpoint PricingUpgrade to v1
                  En esta página
                  • Overview
                  • What the Token API Enables in Custom GPTs
                  • When to Use the Token API for Custom GPTs
                  • Choosing a Use Case
                  • Requirements
                  • Setting Up a Custom GPT
                  • Create Custom GPT
                  • Configure Your GPT
                  • Connect the Token API
                  • Privacy
                  • Example Prompt Patterns
                  • Wallet and Portfolio
                  • Trading Analysis
                  • Accounting
                  • Best Practices
                  • FAQs & Resources
                  The GraphEstadoTestnetRecursos de marcaForoSeguridadPolítica de privacidadTérminos de servicio