| name | dexter-proxy-apis |
| description | Documentation for all APIs available through Dexter's proxy layer. Use these in x402 resources without managing API keys. |
| version | 1.0.0 |
| author | Dexter |
| license | MIT |
| tags | ["api","proxy","openai","helius","jupiter","solana","dexter"] |
Dexter Proxy APIs
x402 resources have access to powerful APIs through Dexter's proxy layer. You don't need API keys - just call the proxy endpoints and Dexter handles authentication.
Base URL
The proxy base URL is injected as an environment variable into every deployed container.
Always use this pattern in your code:
const PROXY = process.env.PROXY_BASE_URL || 'https://x402.dexter.cash/proxy';
Then build URLs with template literals: `${PROXY}/openai/v1/chat/completions`
NEVER use relative URLs like /proxy/... — they don't work in Node.js server-side code.
AI / LLM APIs
OpenAI (/proxy/openai/*)
Full access to OpenAI's API.
Chat Completions
const PROXY = process.env.PROXY_BASE_URL || 'https://x402.dexter.cash/proxy';
const response = await fetch(`${PROXY}/openai/v1/chat/completions`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'gpt-5.2',
messages: [
{ role: 'system', content: 'You are a helpful assistant.' },
{ role: 'user', content: 'Hello!' }
],
max_completion_tokens: 4096,
}),
});
const data = await response.json();
Embeddings
const response = await fetch(`${PROXY}/openai/v1/embeddings`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'text-embedding-3-small',
input: 'Text to embed',
}),
});
const data = await response.json();
Image Generation
const response = await fetch(`${PROXY}/openai/v1/images/generations`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'gpt-image-1.5',
prompt: 'A sunset over mountains with "Hello World" text',
size: '1024x1024',
n: 1,
}),
});
const data = await response.json();
Video Generation (Sora)
const response = await fetch(`${PROXY}/openai/v1/videos/generations`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'sora-2',
prompt: 'A cat walking on a beach at sunset, cinematic quality',
}),
});
const data = await response.json();
Text-to-Speech
const response = await fetch(`${PROXY}/openai/v1/audio/speech`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'tts-1-hd',
input: 'Hello, welcome to Dexter Lab!',
voice: 'alloy',
}),
});
const audioBlob = await response.blob();
Speech-to-Text
const formData = new FormData();
formData.append('file', audioFile);
formData.append('model', 'gpt-4o-transcribe');
const response = await fetch(`${PROXY}/openai/v1/audio/transcriptions`, {
method: 'POST',
body: formData,
});
const data = await response.json();
Available Models (2026):
Codex (FOR ALL CODE GENERATION):
gpt-5.2-codex - USE THIS FOR CODE - Best agentic coding model, state-of-the-art on SWE-Bench
Standard Chat:
gpt-5.2 - Latest, best all-around ($1.75/$14 per 1M)
gpt-5.1 - Improved instruction following
gpt-5 - Base GPT-5, excellent ($1.25/$10 per 1M)
gpt-5-mini - Small but capable, great value ($0.25/$2 per 1M)
gpt-5-nano - Cheapest, extremely fast ($0.05/$0.40 per 1M)
gpt-4.1 - 1M context window specialist ($2/$8 per 1M)
gpt-4o - Previous flagship with vision ($2.50/$10 per 1M)
gpt-4o-mini - Fast and cheap legacy ($0.15/$0.60 per 1M)
Reasoning (o-series):
o4-mini - Best reasoning per dollar ($1.10/$4.40 per 1M)
o3 - Full reasoning, excellent for complex problems ($2/$8 per 1M)
o3-mini - Improved mini reasoner ($1.10/$4.40 per 1M)
o1 - Original reasoning model ($15/$60 per 1M)
o1-mini - Fast reasoning ($1.10/$4.40 per 1M)
Premium:
gpt-5.2-pro - Maximum capability ($21/$168 per 1M)
gpt-5-pro - Enhanced GPT-5 ($15/$120 per 1M)
o3-pro - Extended reasoning time ($20/$80 per 1M)
o1-pro - Most capable reasoning ($150/$600 per 1M)
Specialized/Research:
o3-deep-research - Extended research sessions with web access ($10/$40 per 1M)
o4-mini-deep-research - Affordable deep research ($2/$8 per 1M)
computer-use-preview - Can control computer interfaces ($3/$12 per 1M)
Realtime Audio:
gpt-realtime - Real-time audio conversation ($4/$16 per 1M)
gpt-realtime-mini - Affordable realtime ($0.60/$2.40 per 1M)
Speech-to-Text:
gpt-4o-transcribe - Best transcription, improved accuracy
gpt-4o-mini-transcribe - Fast transcription
whisper-1 - Legacy transcription
Text-to-Speech:
tts-1 - Optimized for real-time ($0.015/1K chars)
tts-1-hd - High quality audio ($0.030/1K chars)
Embeddings:
text-embedding-3-small - Fast embeddings, 1536 dimensions
text-embedding-3-large - Higher quality, 3072 dimensions
text-embedding-ada-002 - Legacy embeddings
Image Generation:
gpt-image-1.5 - Latest image generation with text rendering
gpt-image-1 - Previous generation
dall-e-3 - High quality, 1024x1024 to 1792x1024
dall-e-2 - Lower cost, editing/variations support
Video Generation:
sora-2 - Video generation from text prompts
sora-2-pro - Extended video generation capabilities
Anthropic Claude (/proxy/anthropic/*)
Access to Claude models.
Messages
const response = await fetch(`${PROXY}/anthropic/v1/messages`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'claude-3-sonnet-20240229',
max_tokens: 1024,
messages: [
{ role: 'user', content: 'Explain quantum computing' }
],
}),
});
const data = await response.json();
Available Models:
Claude 4.5 Family (Latest):
claude-opus-4-5 - USE THIS FOR CODE - Flagship, 1M context, 64K output ($5/$25 per 1M)
claude-sonnet-4-5 - Balanced reasoning/cost, 200K context, 64K output ($3/$15 per 1M)
claude-haiku-4-5 - Fast, cost-efficient, matches Sonnet 4 performance ($1/$5 per 1M)
Claude 3 Family (Legacy):
claude-3-opus-20240229 - Previous flagship, 200K context ($15/$75 per 1M)
claude-3-sonnet-20240229 - Balanced ($3/$15 per 1M)
claude-3-haiku-20240307 - Fast and cheap ($0.25/$1.25 per 1M)
Google Gemini (/proxy/gemini/*)
Access to Gemini models.
Generate Content
const response = await fetch(`${PROXY}/gemini/v1beta/models/gemini-pro:generateContent`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
contents: [
{ parts: [{ text: 'Write a haiku about coding' }] }
],
}),
});
const data = await response.json();
Available Models:
Gemini 3 Family (Latest):
gemini-3-pro-preview - Most intelligent, advanced reasoning
gemini-3-flash-preview - Fast frontier-class performance
gemini-3-pro-image-preview - Text + image generation
Gemini 2.0 Family:
gemini-2.0-flash - GA workhorse, 1M context, optimized for speed/agentic tasks
gemini-2.0-flash-lite - Most cost-efficient
gemini-2.0-pro-experimental - Best for coding and complex prompts
Legacy:
gemini-1.5-pro - Long context (up to 1M tokens)
gemini-pro - Text generation
gemini-pro-vision - Multimodal (text + images)
Solana / Blockchain APIs
Helius (/proxy/helius/*)
Premium Solana RPC, DAS API, webhooks, and enhanced transaction parsing.
Standard RPC
const response = await fetch(`${PROXY}/helius/rpc`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getBalance',
params: ['WalletAddress...'],
}),
});
const response = await fetch(`${PROXY}/helius/rpc`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getTokenAccountsByOwner',
params: [
'WalletAddress...',
{ programId: 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA' },
{ encoding: 'jsonParsed' }
],
}),
});
const response = await fetch(`${PROXY}/helius/rpc`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getSignaturesForAddress',
params: ['WalletAddress...', { limit: 100 }],
}),
});
DAS API (Digital Asset Standard) - NFTs & Compressed Assets
const response = await fetch(`${PROXY}/helius/das`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getAsset',
params: { id: 'AssetMintAddress...' },
}),
});
const response = await fetch(`${PROXY}/helius/das`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getAssetsByOwner',
params: {
ownerAddress: 'WalletAddress...',
page: 1,
limit: 1000,
displayOptions: { showFungible: true, showNativeBalance: true },
},
}),
});
const response = await fetch(`${PROXY}/helius/das`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'searchAssets',
params: {
ownerAddress: 'WalletAddress...',
grouping: ['collection', 'CollectionAddress...'],
page: 1,
limit: 100,
},
}),
});
const response = await fetch(`${PROXY}/helius/das`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getAssetsByCreator',
params: { creatorAddress: 'CreatorAddress...', page: 1, limit: 100 },
}),
});
const response = await fetch(`${PROXY}/helius/das`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getAssetProof',
params: { id: 'CompressedAssetId...' },
}),
});
Enhanced Transaction Parsing
const response = await fetch(`${PROXY}/helius/transactions`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
transactions: ['TxSignature1...', 'TxSignature2...'],
}),
});
Available DAS Methods:
getAsset - Single asset by ID
getAssetBatch - Multiple assets
getAssetProof / getAssetProofBatch - Merkle proofs for compressed
getAssetsByOwner - All assets for wallet
getAssetsByCreator - Assets by creator
getAssetsByAuthority - Assets by authority
getAssetsByGroup - Assets by collection/group
searchAssets - Advanced search with filters
getTokenAccounts - Token accounts for wallet
getNftEditions - NFT edition info
Jupiter (/proxy/jupiter/*)
Solana's leading DEX aggregator. Swap, limit orders, DCA, and price APIs.
Get Quote
const inputMint = 'So11111111111111111111111111111111111111112';
const outputMint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
const amount = '1000000000';
const response = await fetch(`${PROXY}/jupiter/swap/v1/quote`, {
method: 'GET',
params: new URLSearchParams({
inputMint,
outputMint,
amount,
slippageBps: '50',
}),
});
const quote = await response.json();
Execute Swap
const response = await fetch(`${PROXY}/jupiter/swap/v1/swap`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
quoteResponse: quote,
userPublicKey: 'UserWalletAddress...',
wrapAndUnwrapSol: true,
}),
});
const swapResult = await response.json();
Price API
const response = await fetch(`${PROXY}/jupiter/price/v2`, {
method: 'GET',
params: new URLSearchParams({
ids: 'So11111111111111111111111111111111111111112,EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
}),
});
const prices = await response.json();
Limit Orders (Trigger API)
const response = await fetch(`${PROXY}/jupiter/trigger/v1/createOrder`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
inputMint: 'So11111111111111111111111111111111111111112',
outputMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
maker: 'UserWalletAddress...',
makingAmount: '1000000000',
takingAmount: '150000000',
}),
});
const response = await fetch(`${PROXY}/jupiter/trigger/v1/orders?wallet=WalletAddress...`);
const response = await fetch(`${PROXY}/jupiter/trigger/v1/cancelOrder`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
maker: 'UserWalletAddress...',
orderId: 'OrderId...',
}),
});
Token List
const response = await fetch(`${PROXY}/jupiter/tokens/v1/all`);
const tokens = await response.json();
const response = await fetch(`${PROXY}/jupiter/tokens/v1/strict`);
Solscan (/proxy/solscan/*)
Comprehensive Solana blockchain explorer API v2.
Account Endpoints
const response = await fetch(`${PROXY}/solscan/v2/account?address=WalletAddress...`);
const response = await fetch(`${PROXY}/solscan/v2/account/transactions?address=WalletAddress...&limit=20`);
const response = await fetch(`${PROXY}/solscan/v2/account/token-accounts?address=WalletAddress...`);
const response = await fetch(`${PROXY}/solscan/v2/account/transfer?address=WalletAddress...&limit=50`);
const response = await fetch(`${PROXY}/solscan/v2/account/portfolio?address=WalletAddress...`);
const response = await fetch(`${PROXY}/solscan/v2/account/defi?address=WalletAddress...`);
const response = await fetch(`${PROXY}/solscan/v2/account/stake?address=WalletAddress...`);
Token Endpoints
const response = await fetch(`${PROXY}/solscan/v2/token/meta?address=TokenMintAddress...`);
const response = await fetch(`${PROXY}/solscan/v2/token/price?address=TokenMintAddress...`);
const response = await fetch(`${PROXY}/solscan/v2/token/holders?address=TokenMintAddress...&limit=20`);
const response = await fetch(`${PROXY}/solscan/v2/token/transfer?address=TokenMintAddress...&limit=50`);
const response = await fetch(`${PROXY}/solscan/v2/token/markets?address=TokenMintAddress...`);
const response = await fetch(`${PROXY}/solscan/v2/token/trending`);
const response = await fetch(`${PROXY}/solscan/v2/token/search?keyword=BONK`);
Transaction Endpoints
const response = await fetch(`${PROXY}/solscan/v2/transaction?tx=TxSignature...`);
const response = await fetch(`${PROXY}/solscan/v2/transaction/last?limit=20`);
Block Endpoints
const response = await fetch(`${PROXY}/solscan/v2/block?block=123456789`);
const response = await fetch(`${PROXY}/solscan/v2/block/last?limit=10`);
Birdeye (/proxy/birdeye/*)
Token analytics, market data, and trading signals.
Token Overview
const response = await fetch(`${PROXY}/birdeye/defi/token_overview?address=TokenMintAddress...`);
Token Security
const response = await fetch(`${PROXY}/birdeye/defi/token_security?address=TokenMintAddress...`);
Token Price History
const response = await fetch(`${PROXY}/birdeye/defi/history_price?address=TokenMintAddress...&type=1H&time_from=1704067200&time_to=1704153600`);
OHLCV (Candlestick Data)
const response = await fetch(`${PROXY}/birdeye/defi/ohlcv?address=TokenMintAddress...&type=15m&time_from=1704067200&time_to=1704153600`);
Token Trades
const response = await fetch(`${PROXY}/birdeye/defi/txs/token?address=TokenMintAddress...&limit=50`);
Wallet Portfolio
const response = await fetch(`${PROXY}/birdeye/v1/wallet/token_list?wallet=WalletAddress...`);
Multi-Price
const response = await fetch(`${PROXY}/birdeye/defi/multi_price?list_address=Token1,Token2,Token3`);
External APIs
General Proxy (/proxy/external/*)
For any external API not explicitly supported.
const response = await fetch(`${PROXY}/external/api.example.com/endpoint`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ data: 'your data' }),
});
Note: External API calls are rate-limited and monitored. Some domains may be blocked for security.
Rate Limits
| API | Requests/Minute | Notes |
|---|
| OpenAI | 100 | Per session |
| Anthropic | 60 | Per session |
| Gemini | 60 | Per session |
| Helius | 100 | Per session |
| Jupiter | 60 | Per session |
| Birdeye | 30 | Per session |
| External | 30 | Per domain |
If you hit rate limits, you'll receive a 429 Too Many Requests response. Implement backoff in your resource.
Error Handling
All proxy responses preserve the original API's error format. Common patterns:
const response = await fetch(`${PROXY}/openai/v1/chat/completions`, { ... });
if (!response.ok) {
const error = await response.json();
if (response.status === 429) {
await sleep(1000);
return retry();
}
if (response.status === 401) {
console.error('Proxy auth error:', error);
}
throw new Error(error.error?.message || 'API call failed');
}
const data = await response.json();
Best Practices
1. Use Appropriate Models
const model = taskComplexity === 'simple' ? 'gpt-4o-mini' : 'gpt-4o';
2. Cache When Possible
const tokenCache = new Map();
async function getTokenInfo(mint) {
if (tokenCache.has(mint)) {
return tokenCache.get(mint);
}
const info = await fetch(`${PROXY}/helius/token/${mint}`).then(r => r.json());
tokenCache.set(mint, info);
return info;
}
3. Handle Failures Gracefully
async function callWithRetry(fn, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
return await fn();
} catch (error) {
if (i === maxRetries - 1) throw error;
await new Promise(r => setTimeout(r, 1000 * (i + 1)));
}
}
}
4. Stream Long Responses
const response = await fetch(`${PROXY}/openai/v1/chat/completions`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
model: 'gpt-4o-mini',
messages: [...],
stream: true,
}),
});
const reader = response.body.getReader();
Security Notes
- No API keys needed - Dexter handles authentication
- Rate limited - Prevents abuse
- Logged - Usage is tracked for billing/monitoring
- Filtered - Some dangerous operations may be blocked
- Isolated - Your requests don't leak to other users
Quick Reference
const PROXY = process.env.PROXY_BASE_URL || 'https://x402.dexter.cash/proxy';
await fetch(`${PROXY}/openai/v1/chat/completions`, { method: 'POST', body: {...} });
await fetch(`${PROXY}/anthropic/v1/messages`, { method: 'POST', body: {...} });
await fetch(`${PROXY}/gemini/v1beta/models/gemini-pro:generateContent`, { method: 'POST', body: {...} });
await fetch(`${PROXY}/helius/rpc`, { method: 'POST', body: { method: 'getBalance', params: [...] } });
await fetch(`${PROXY}/helius/token/MINT_ADDRESS`);
await fetch(`${PROXY}/jupiter/quote?inputMint=...&outputMint=...&amount=...`);
await fetch(`${PROXY}/birdeye/token/overview?address=MINT_ADDRESS`);
await fetch(`${PROXY}/external/api.example.com/path`, { method: 'POST', body: {...} });