---
name: Dexter
description: Dexter (x402.dexter.cash) is a multi-purpose API host offering Solana token swap quoting via Jupiter, x402 payment ecosystem analytics, sandboxed code execution, and a set of novelty/demo endpoints (collaborative story and leaderboard). It operates as both a utility provider and a showcase for x402 micropayment-gated APIs.
host: x402.dexter.cash
---

# Dexter

Dexter serves developers and agents building on the x402 payment protocol and Solana DeFi ecosystem. It provides Jupiter swap quote lookups (standard and pro-tier), x402 leaderboard analytics, a sandboxed code interpreter, and demo endpoints that illustrate x402 micropayment gating in practice. It is not a single-domain tool; its skills span DeFi quoting, ecosystem analytics, compute, and interactive demos.

## When to use this host

Use this host when an agent needs Solana Jupiter swap quotes (pre-execution only), x402 ecosystem leaderboard analytics, or a sandboxed code interpreter with x402 payment gating. The pro-tier quote skill (fetch-jupiter-quote-pro) adds USD value estimates over the standard skill; prefer it when USD context matters. Do not use this host for executing swap transactions — neither Jupiter skill submits trades. Do not use for cross-chain or non-Solana quotes. Do not use for production payment settlement; verify-x402-payment-test is a test route only. The story and king endpoints are demo/novelty tools and should not be used in production agent pipelines. For real-time streaming execution or interactive REPL sessions, this host is not suitable — submit-code-interpreter-job is single-shot only.

## Capabilities

### Solana Swap Quoting

Fetches Jupiter swap route quotes for Solana token pairs, returning atomic amounts, price impact, slippage, route plan legs, and USD value estimates before any trade is executed.

- **`fetch-jupiter-swap-quote`** — Returns a Jupiter swap route and quote for a given input/output mint pair on Solana, including atomic amounts, price impact, slippage, and route plan legs.
- **`fetch-jupiter-quote-pro`** — Returns a Jupiter swap quote for a Solana token pair including route plan, atomic in/out amounts, price impact, and USD value via the pro-tier endpoint.

### x402 Ecosystem Analytics

Retrieves paginated leaderboard statistics on x402 facilitators, servers, agents, and tools — including transaction volume, counts, and unique participant metrics over configurable timeframes.

- **`fetch-x402-scan-leaderboard-stats`** — Returns a paginated leaderboard of x402 facilitators, servers, agents, or tools with transaction counts, volume, unique buyer/seller counts, and optional aggregate summary for a given timeframe and chain.

### x402 Payment Verification

Tests and confirms that an x402 v2 payment flow is functioning end-to-end via middleware settlement, useful for integration validation before production deployment.

- **`verify-x402-payment-test`** — Sends a POST request to the x402 v2 test endpoint and returns a confirmation that payment was verified and settled by middleware.

### Sandboxed Code Execution

Submits arbitrary code jobs to a paid sandboxed interpreter and returns the execution result, enabling automated pipelines to run code with x402 micropayment settlement.

- **`submit-code-interpreter-job`** — Submits a paid code interpreter job via the Dexter x402 API and returns the job result after execution.

### Demo and Novelty Endpoints

Provides two x402-gated demo interactions: appending a single word to a shared collaborative story and posting a decree to claim the top spot on a daily leaderboard, each costing 0.01 USDC.

- **`append-story-word`** — Appends a single word (max 20 chars, no spaces) to the shared Infinite Story and returns the added entry with author and timestamp.
- **`post-king-usurp-decree`** — Posts a royal decree message to claim the top spot on the Dexter King daily leaderboard, paying 0.01 USDC via x402.

## Workflows

### Compare Standard vs Pro Jupiter Quote

*Use when an agent needs to compare the standard and pro-tier Jupiter quote responses for the same token pair to decide which endpoint to rely on in production.*

1. **`fetch-jupiter-swap-quote`** — Fetch the standard Jupiter quote for the target input/output mint pair and amount.
2. **`fetch-jupiter-quote-pro`** — Fetch the pro-tier Jupiter quote for the same pair and amount, then compare route plan, price impact, and USD value fields against the standard result.

### x402 Integration Smoke Test

*Use when an agent needs to validate that x402 payment middleware is operational and then confirm ecosystem activity before going live.*

1. **`verify-x402-payment-test`** — Confirm the x402 v2 test route settles correctly end-to-end via middleware.
2. **`fetch-x402-scan-leaderboard-stats`** — Pull current leaderboard stats to verify the ecosystem is active and transactions are being recorded.

## Skill reference

### `fetch-jupiter-swap-quote`

**Jupiter Swap Quote** — Returns a Jupiter swap route and quote for a given input/output mint pair on Solana, including atomic amounts, price impact, slippage, and route plan legs.

*Use when:* Use when an agent needs a Jupiter swap quote with expected output amount, price impact, slippage threshold, and route plan before executing or displaying a Solana token swap.

*Not for:* Do not use for executing a swap transaction; this endpoint returns a quote preview only. Not suitable for non-Solana chains or cross-chain bridge quotes.

**Inputs:**

- `amount` (string) — Trade amount in SOL units. Defaults to 10 SOL when blank.
- `swapMode` (string) — Swap mode forwarded to Jupiter: ExactIn or ExactOut. Defaults to ExactIn when blank.
- `amountOut` (string) — Desired output amount in Donica units (ExactOut mode). Overrides amount when provided.
- `inputMint` (string) — Input mint address. Defaults to SOL when blank.
- `outputMint` (string) — Output mint address. Defaults to the Donica Lewinsky (DONICA) mint when blank.
- `slippageBps` (integer) — Slippage tolerance in basis points. Defaults to 100 (1%) when blank.

**Returns:** Returns ok=true plus a quote object with atomic in/out amounts, human-readable UI amounts, price impact, slippage, and a routePlan array describing each AMM hop Jupiter will execute.

**Example:** `GET https://x402.dexter.cash/api/jupiter/quote?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=10&swapMode=ExactIn&slippageBps=100`

---

### `submit-code-interpreter-job`

**Dexter Code Interpreter Job** — Submits a paid code interpreter job via the Dexter x402 API and returns the job result after execution.

*Use when:* Use when an agent needs to execute arbitrary code in a sandboxed interpreter environment and retrieve the output, as part of an automated pipeline that can handle x402 micropayment settlement.

*Not for:* Do not use for real-time streaming code execution or interactive REPL sessions; this is a single-shot job submission endpoint.

**Inputs:**

- `body` (object, required) — Request body for the code interpreter job. Exact fields are not declared in the accepts schema; consult the Dexter API documentation for required job parameters.

**Returns:** Returns a job result object whose exact fields are not specified in the available schema; expected to contain execution output or status.

**Example:** `POST https://x402.dexter.cash/api/tools/code-interpreter/jobs
Content-Type: application/json

{"code": "print('hello world')"}`

---

### `fetch-x402-scan-leaderboard-stats`

**x402 Scan Leaderboard Stats** — Returns a paginated leaderboard of x402 facilitators, servers, agents, or tools with transaction counts, volume, unique buyer/seller counts, and optional aggregate summary for a given timeframe and chain.

*Use when:* Use when an agent needs ranked statistics on x402 ecosystem participants — facilitators, servers, agents, or tools — including volume, transaction counts, and unique buyer/seller metrics over a rolling time window.

*Not for:* Do not use for real-time streaming payment monitoring or individual transaction lookups; this endpoint returns aggregated leaderboard snapshots, not live event feeds.

**Inputs:**

- `entity` (string) — Leaderboard entity to query: facilitators, servers, agents, or tools. Defaults to facilitators.
- `ids` (string) — Comma-separated IDs to filter specific facilitators, servers, agents, or tools.
- `chain` (string) — Optional chain filter (solana, base, polygon, optimism). Only applies to facilitator/server lookups.
- `timeframe` (string) — Rolling window such as 1d, 7d, 30d, or a numeric day count. Defaults to 1d.
- `sort_by` (string) — Sort key for the entity (e.g. tx_count, total_amount, latest_block_timestamp, unique_buyers, unique_sellers).
- `direction` (string) — Sort direction: asc or desc. Defaults to desc.
- `page` (integer) — Zero-based page index. Defaults to 0.
- `limit` (integer) — Rows per page (1-50). Defaults to 10.
- `include_summary` (boolean) — When false, skips the aggregate summary lookup. Defaults to true.

**Returns:** Returns ok=true with a ranked items array of facilitator records (id, name, addresses, chains, and metrics including txCount, totalAmountUsd, uniqueBuyers), pagination metadata, and an optional aggregate summary for the queried timeframe.

**Example:** `GET https://x402.dexter.cash/api/tools/x402/scan/stats?entity=facilitators&timeframe=7d&sort_by=tx_count&direction=desc&limit=10&page=0&include_summary=true`

---

### `verify-x402-payment-test`

**x402 Payment Test API** — Sends a POST request to the x402 v2 test endpoint and returns a confirmation that payment was verified and settled by middleware.

*Use when:* Use when an agent needs to verify that an x402 payment flow is functioning end-to-end on the v2 test route, confirming middleware settlement before integrating into production.

*Not for:* Do not use for production payment verification or actual fund settlement; this is a test route only. Not suitable for querying balances, swap quotes, or any non-payment-verification purpose.

**Returns:** Returns ok=true, a message confirming the x402 v2 test route was reached with payment verified and settled, and an ISO timestamp of response generation.

**Example:** `{"chain":"base","amount":"0.5","explorer":{"tx_hash":"0x0000000000000000000000000000000000000000000000000000000000000000"},"test_mode":true,"token_type":"erc20","amount_unit":"USDC","payer_wallet":"0x402Feee072D655B85e08f1751AF9ddbCd249521f","token_address":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","fiat_reference":{"currency":"USD","target_price_test":true},"recipient_wallet":"0x402Feee072D655B85e08f1751AF9ddbCd249521f"}`

---

### `append-story-word`

**StoryWord Append** — Appends a single word (max 20 chars, no spaces) to the shared Infinite Story and returns the added entry with author and timestamp.

*Use when:* Use when an agent or user wants to contribute one word to the collaborative Infinite Story, paying $0.01 USDC per word appended.

*Not for:* Do not use for appending multiple words or sentences at once; the endpoint accepts only a single word per request. Not suitable for reading or retrieving the story — use a separate read endpoint for that.

**Inputs:**

- `word` (string, required) — The single word to append to the story. Maximum 20 characters, no spaces allowed.

**Returns:** Returns ok=true and an added object containing the appended word, the author wallet address (or 'anonymous'), and a millisecond Unix timestamp.

**Example:** `{"word": "analysis"}`

---

### `post-king-usurp-decree`

**King Usurp** — Posts a royal decree message to claim the top spot on the Dexter King daily leaderboard, paying 0.01 USDC via x402.

*Use when:* Use when an agent or user wants to claim the current King position on the Dexter leaderboard by submitting a custom decree message (up to 140 characters) that will be publicly displayed.

*Not for:* Do not use for reading or querying the current leaderboard state without claiming the throne; this endpoint always costs 0.01 USDC and writes a new usurpation record.

**Inputs:**

- `message` (string, required) — Your royal decree, up to 140 characters. This text is displayed publicly on the Dexter King leaderboard.

**Returns:** Returns ok=true plus a state object with the caller's kingAddress, posted message, new bid amount, timestamp, daily history array, global stats, and a pastKings history array.

**Example:** `{"message": "By royal decree, I claim the Dexter throne today."}`

---

### `fetch-jupiter-quote-pro`

**Jupiter Quote Pro** — Returns a Jupiter swap quote for a Solana token pair including route plan, atomic in/out amounts, price impact, and USD value via the pro-tier endpoint.

*Use when:* Use when an agent needs a Jupiter swap quote on Solana with route plan details, price impact, slippage threshold, and USD value estimate before executing or presenting a trade to a user.

*Not for:* Do not use for executing swaps — this is a read-only quote preview. Do not use for cross-chain trades; this endpoint is Solana-only.

**Inputs:**

- `amount` (string) — Trade amount in SOL units. Defaults to 10 SOL when blank.
- `swapMode` (string) — Swap mode forwarded to Jupiter: ExactIn or ExactOut. Defaults to ExactIn when blank.
- `amountOut` (string) — Desired output amount in Donica units for ExactOut mode. Overrides amount when provided.
- `inputMint` (string) — Input mint address. Defaults to SOL when blank.
- `outputMint` (string) — Output mint address. Defaults to the Donica Lewinsky (DONICA) mint when blank.
- `slippageBps` (integer) — Slippage tolerance in basis points. Defaults to 100 (1%) when blank.

**Returns:** Returns ok=true and a quote object with atomic in/out amounts, human-readable UI amounts, price impact, slippage threshold, USD value, and a routePlan array describing each AMM hop.

**Example:** `GET https://x402.dexter.cash/api/jupiter/quote/pro?inputMint=So11111111111111111111111111111111111111112&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v&amount=10&swapMode=ExactIn&slippageBps=100`

---
