# Integrator quickstart

Pay GEDX402 from **your** wallet on Base. No MCP, no API keys.

```bash
npm install @x402/fetch @x402/core @x402/evm viem
```

Discovery: [GET /.well-known/agents.json?bundle=winners](https://gedx402.com/.well-known/agents.json?bundle=winners)

## Winner endpoints (copy AM shapes)

| API | URL | Wire (manifest worst-case) |
| --- | --- | --- |
| OpenAI chat | `POST https://chat.gedx402.com/v1/chat/completions` | $0.001+ |
| Tavily search | `POST https://search.gedx402.com/v1/search` | $0.01 |
| Firecrawl scrape | `POST https://browser.gedx402.com/v1/firecrawl/scrape` | $0.01–$0.02 |
| Social profile | `POST https://social.gedx402.com/v1/social/outcome/profile` | $0.02 |
| SociaVault catalog | `POST https://social.gedx402.com/v1/sociavault/tiktok/profile` | $0.02 |
| Translate | `POST https://embed.gedx402.com/v1/translate` | $0.004–$0.0125 |

Live prices: [GET /v1/models?bundle=winners](https://gedx402.com/v1/models?bundle=winners). Full SociaVault API: `/v1/sociavault/*` (106 routes) — [SOCIAL-SHARD.md](./SOCIAL-SHARD.md). Tavily full API: `/v1/tavily/*` — [SEARCH-BUNDLE.md](./SEARCH-BUNDLE.md).

## Chat completions

```typescript
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const signer = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
client.register("eip155:*", new ExactEvmScheme(signer));
const fetchWithPayment = wrapFetchWithPayment(fetch, client);

const res = await fetchWithPayment("https://chat.gedx402.com/v1/chat/completions", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    messages: [{ role: "user", content: "Hello" }],
    max_tokens: 128,
  }),
});
```

## Search (Tavily shape)

```typescript
const res = await fetchWithPayment("https://search.gedx402.com/v1/search", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ query: "x402 micropayments", max_results: 5 }),
});
```

## Scrape

```typescript
const res = await fetchWithPayment("https://browser.gedx402.com/v1/firecrawl/scrape", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ url: "https://example.com" }),
});
```

## Social profile (SociaVault)

**Catalog route (preferred):**

```typescript
const res = await fetchWithPayment("https://social.gedx402.com/v1/sociavault/tiktok/profile", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ handle: "example" }),
});
```

**Legacy convenience route:**

```typescript
const res = await fetchWithPayment("https://social.gedx402.com/v1/social/outcome/profile", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ platform: "tiktok", handle: "example" }),
});
```

Full catalog: [GET /v1/models?full=1](https://gedx402.com/v1/models?full=1)

## Frontier models (gateway shard)

OpenAI/Anthropic/Google via unified billing — **per-model** x402 wire (not ~$1.85 max-across-allowlist).

Discovery: [GET /.well-known/agents.json?shard=gateway&bundle=frontier](https://gedx402.com/.well-known/agents.json?shard=gateway&bundle=frontier)

| API | URL | Wire (gpt-4o-mini worst-case) |
| --- | --- | --- |
| OpenAI chat (frontier) | `POST https://gateway.gedx402.com/v1/chat/completions` | ~$0.08 |
| Unified run | `POST https://gateway.gedx402.com/v1/unified/run` | per `model` in body |

```typescript
const res = await fetchWithPayment("https://gateway.gedx402.com/v1/chat/completions", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    model: "openai/gpt-4o-mini",
    messages: [{ role: "user", content: "Hello" }],
    max_tokens: 128,
  }),
});
```

See [GATEWAY-SHARD.md](./GATEWAY-SHARD.md).
