Skip to content

Commit f2aa872

Browse files
idalithbbenface
andauthored
Adding Guide (#1050)
* Adding Guide * Update website/src/pages/en/token-api/guides/gbt.mdx Co-authored-by: Benoît Rouleau <[email protected]> * updating * update * fixing build --------- Co-authored-by: Benoît Rouleau <[email protected]>
1 parent 7db31d3 commit f2aa872

File tree

5 files changed

+130
-1
lines changed

5 files changed

+130
-1
lines changed

website/src/pages/en/token-api/_meta.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ export default {
1111
'tvm-dexs': titles['tvm-dexs'] ?? '',
1212
monitoring: titles['monitoring'] ?? '',
1313
'endpoint-pricing': '',
14+
guides: 'Guides',
1415
faq: '',
15-
'upgrade-to-v1': '',
1616
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"gpt": "Create Custom GPTS",
3+
"upgrade-to-v1": ""
4+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export default {
2+
gpt: '',
3+
'upgrade-to-v1': '',
4+
}
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
---
2+
title: How the Token API Powers Custom GPTs
3+
sidebarTitle: Create Custom GPTs
4+
---
5+
6+
## Overview
7+
8+
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.
9+
10+
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.
11+
12+
## What the Token API Enables in Custom GPTs
13+
14+
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:
15+
16+
- **Query real-time onchain data**: Balances, token prices, liquidity, and transaction history.
17+
- **Automate domain-specific tasks**: Portfolio tracking, accounting, reconciliation, and market analysis.
18+
- **Power AI agents with verifiable blockchain context**: Use the same data sources dapps rely on.
19+
20+
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.
21+
22+
## When to Use the Token API for Custom GPTs
23+
24+
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.
25+
26+
## Choosing a Use Case
27+
28+
Start with a clear, narrow objective, then expand as needed. Common patterns include:
29+
30+
- **Accounting GPT**: Onchain accounting, tax tagging, and portfolio reconciliation.
31+
- **Trading GPT**: Liquidity, pricing, and volume analysis for trading strategies.
32+
- **Protocol Tracking GPT**: Real-time monitoring of transaction activity and liquidity pools.
33+
34+
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.
35+
36+
## Requirements
37+
38+
| Requirement | Description |
39+
| ---------------------- | -------------------------------------------------------- |
40+
| ChatGPT 5 | Custom GPT creation requires GPT-5 tier or Pro. |
41+
| Token API Subscription | Sign up at [The Graph Market](https://thegraph.market./) |
42+
| Token API Key | Available in your dashboard as the Authentication JWT. |
43+
44+
## Setting Up a Custom GPT
45+
46+
Below is an explanatory outline of what happens during setup. This section provides conceptual understanding.
47+
48+
### Create Custom GPT
49+
50+
1. Visit chat.openai.com/gpts in your browser. 2, Click Create (top right).
51+
2. Under Configure (in the top left panel), set up your GPT's personality and scope.
52+
53+
### Configure Your GPT
54+
55+
You define the GPT's role, scope, and metadata so it knows what it is designed to do. This includes:
56+
57+
- **Name and Description**: Helps users discover your GPT.
58+
- 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.
59+
- **Instructions**: Tells the GPT what tasks it should perform using the Token API.
60+
- 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.
61+
- **Knowledge**: Optional context files such as wallet references, accounting rules, or code snippets.
62+
- **New Action**: At the bottom, click “Create new action” to connect your GPT to the Token API.
63+
64+
### Connect the Token API
65+
66+
To enable live blockchain queries inside ChatGPT, you connect the GPT to the Token API through:
67+
68+
#### Authentication
69+
70+
1. Set Authentication to API Key → Bearer.
71+
2. Open [The Graph Market](https://thegraph.market./) and copy your Authentication JWT from your dashboard.
72+
3. Paste the token into the ChatGPT prompt where the field shows [HIDDEN].
73+
74+
#### Schema
75+
76+
1. Above the Schema box, click Import from URL.
77+
2. Paste: https://token-api.thegraph.com/openapi
78+
3. Click Import. You'll now see endpoints like:
79+
- `getV1EvmTokens`
80+
- `getV1EvmDexes`
81+
- `getV1EvmBalances`
82+
4. Click Test on one (for example `getV1EvmDexes`) to verify connection.
83+
84+
##### Privacy
85+
86+
1. At the bottom, under Privacy, paste: https://pinax.network/en/legal/privacy
87+
88+
### Privacy
89+
90+
You can attach a privacy policy URL such as: https://pinax.network/en/legal/privacy
91+
92+
## Example Prompt Patterns
93+
94+
These examples help illustrate how a GPT reasons over Token API data.
95+
96+
### Wallet and Portfolio
97+
98+
Get the total USD balance for a wallet across multiple chains, returning token name, symbol, balance, and price.
99+
100+
### Trading Analysis
101+
102+
Compare USDC and DAI liquidity across Uniswap and Curve. Return the top 5 pools by TVL.
103+
104+
### Accounting
105+
106+
List all ERC-20 transfers for this address in the last 30 days. Group by token and total incoming/outgoing volume.
107+
108+
## Best Practices
109+
110+
| Tip | Why It Matters |
111+
| --------------------------------- | ---------------------------------------------------------------------- |
112+
| Scope your GPT narrowly first | Simplifies debugging and validates schema integration. |
113+
| Use clear role instructions | Helps the GPT choose the right endpoints and avoid assumptions. |
114+
| Name endpoints explicitly | Improves routing accuracy when fetching balances, prices, or DEX data. |
115+
| Combine with code | Enables custom parsing or logic for complex workflows. |
116+
| Add Subgraph or Substream context | Provides richer analytics when combined with Token API data. |
117+
118+
## FAQs & Resources
119+
120+
- Builders Office Hours (October 23, 2025)
121+
- Watch the full session: https://x.com/i/broadcasts/1mrGmBzBarNJy
File renamed without changes.

0 commit comments

Comments
 (0)