Agents

AI Agents Integration

Integrate Nexus with AI agents to enable autonomous API payments. This allows AI assistants to make paid API calls on behalf of users.

The Nexus MCP URL is

https://nexus-api.thirdweb.com/mcp

which gives every agent:

  • A wallet to pay for API calls
  • A semantic search engine to find APIs
  • A tool to pay for API calls following the x402 protocol

Integrate into popular AI clients

Install Nexus MCP in ChatGPT

  1. Go to ChatGPT
  2. Click Settings > Apps & Connectors (enable Developer mode in Advanced Settings first) > Create
  3. Enter the MCP name: "Nexus"
  4. Enter the MCP URL:
  5. Click Save and follow the authentication steps

Using Nexus with Your Own Agent

If you're building your own AI agent, you can integrate Nexus MCP as a remote server:

Prerequisites

  1. Create a agent wallet from the Nexus Dashboard
  2. Get your wallet secret

Integration

Add the Nexus MCP URL as a remote MCP server transport and replace <YOUR_WALLET_SECRET> with your agent wallet secret:

import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const mcpClient = await createMCPClient({
  transport: new StreamableHTTPClientTransport(
    new URL("https://nexus-api.thirdweb.com/mcp"),
    {
      requestInit: {
        headers: {
          Authorization: `Bearer <YOUR_WALLET_SECRET>`,
        },
      },
    },
  ),
});

const response = await generateText({
  model: openai("gpt-4o"),
  tools: await mcpClient.tools(),
  prompt: "What stocks should I buy and sell today?",
});