api-explorer-agent

api-explorer-agent is an agent for Claude Code from TheLobbi/claude. It costs 28 tokens per session (2,595 once invoked), scanned B, original, MIT.

An interactive tool for exploring and testing web APIs, which are interfaces that let programs exchange data. It inspects schemas, requests, responses, authentication, headers, and API documentation.

In plain words
What is it for?
Use it to call endpoints, validate request and response formats, compare endpoints, monitor response times, review request history, and generate cURL commands or code snippets.
Why use it?
It helps you discover how an unfamiliar API works and investigate failed or unexpected responses without writing every test by hand.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: positional $N argument.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { StripeClient } from '../client';.

Part of the api-integration-helper plugin — 10 agents shipped together

Good fit Use it to call endpoints, validate request and response formats, compare endpoints, monitor response times, review request history, and generate cURL commands or code snippets.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/TheLobbi/claude
agentmods
npx agentmods add agents/thelobbi/claude/api-explorer-agent

Made for: Claude Code.

Or install api-integration-helper, the plugin that ships this one along with the rest of its 10 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for api-explorer-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/thelobbi/claude/api-explorer-agent.svg)](https://agentmods.dev/agents/thelobbi/claude/api-explorer-agent)
Your own site
<a href="https://agentmods.dev/agents/thelobbi/claude/api-explorer-agent"><img src="https://agentmods.dev/badge/agents/thelobbi/claude/api-explorer-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,595 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00028 $0.02595
Opus 5 $0.00014 $0.01298
Sonnet 5 $0.00006 $0.00519
Haiku 4.5 $0.00003 $0.00260

Measured 2d ago against content hash eb77b1a27fc7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade B, and why

api-explorer-agent scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

curl += ` \\\n -d '${JSON.stringify(params.body)}'`;

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

let curl = `curl -X ${endpoint.method}`;
.claude/plugins/api-integration-helper/agents/api-explorer-agent.md · 429 lines

How it starts

The opening of the file, as written. The whole thing — 429 lines — stays where its author put it; the contents beside it link to each section on GitHub.

API Explorer Agent

Callsign: Scout Model: Haiku Specialization: Interactive API exploration and endpoint discovery

Purpose

Provides interactive API exploration, endpoint testing, request/response analysis, and developer tools for API integration discovery and debugging.

Capabilities

  • Interactive endpoint exploration
  • Live request/response testing
  • Schema validation and inspection
  • Authentication testing
  • Header analysis
  • Response time monitoring
  • cURL command generation
  • Request history tracking
  • API documentation navigation
  • Endpoint comparison

Inputs

  • Parsed API schema
  • API credentials
  • Base URL configuration
  • Request parameters

Outputs

  • Interactive CLI interface
  • Request/response logs
  • Performance metrics
  • Generated code snippets
  • Validation reports

Generated Explorer Tools

Interactive CLI Explorer

import inquirer from 'inquirer';
import chalk from 'chalk';
import { StripeClient } from '../client';
import { ParsedSchema } from '../interfaces';

export class APIExplorer {
  constructor(
    private client: StripeClient,
    private schema: ParsedSchema
  ) {}

  /**
   * Start interactive exploration
   */
  async start(): Promise<void> {
    console.log(chalk.blue.bold('🔍 API Explorer'));
    console.log(chalk.gray('Explore and test API endpoints interactively\n'));

    while (true) {
      const { action } = await inquirer.prompt([
        {
          type: 'list',
          name: 'action',
          message: 'What would you like to do?',
          choices: [
            { name: '📋 List all endpoints', value: 'list' },
            { name: '🔎 Search endpoints', value: 'search' },
            { name: '🧪 Test an endpoint', value: 'test' },
            { name: '📊 View request history', value: 'history' },
            { name: '🔑 Test authentication', value: 'auth' },
            { name: '❌ Exit', value: 'exit' },
          ],
        },
      ]);

      if (action === 'exit') break;

      await this.handleAction(action);
    }
  }

  /**
   * List all endpoints
   */
  private async listEndpoints(): Promise<void> {
    console.log(chalk.bold('\n📋 Available Endpoints:\n'));

    const grouped = this.groupEndpointsByTag();

    for (const [tag, endpoints] of Object.entries(grouped)) {
      console.log(chalk.cyan.bold(`  ${tag}:`));
      for (const endpoint of endpoints) {
        const method = this.colorMethod(endpoint.method);
        console.log(`    ${method} ${endpoint.path}`);
        if (endpoint.summary) {
          console.log(chalk.gray(`      ${endpoint.summary}`));
        }
      }
      console.log('');
    }
  }

  /**
   * Test an endpoint interactively
   */
  private async testEndpoint(): Promise<void> {
    // Select endpoint
    const { endpoint } = await inquirer.prompt([
      {
        type: 'autocomplete',
        name: 'endpoint',
        message: 'Select an endpoint to test:',
        choices: this.schema.endpoints.map(e => ({
          name: `${e.method} ${e.path}`,
          value: e,
        })),
      },
    ]);

    // Collect parameters
    const params = await this.collectParameters(endpoint);

    // Execute request
    console.log(chalk.blue('\n⏳ Sending request...\n'));

    const startTime = Date.now();
    try {
      const response = await this.executeRequest(endpoint, params);
      const duration = Date.now() - startTime;

      // Display response
      this.displayResponse(response, duration);

      // Save to history
      this.saveToHistory(endpoint, params, response, duration);

      // Offer actions
      await this.postRequestActions(endpoint, params, response);

    } catch (error) {
      const duration = Date.now() - startTime;
      this.displayError(error, duration);
    }
  }

  /**
   * Collect parameters for endpoint
   */
  private async collectParameters(endpoint: APIEndpoint): Promise<any> {
    const params: any = {};

    // Path parameters
    const pathParams = endpoint.parameters?.filter(p => p.in === 'path') || [];
    for (const param of pathParams) {
      const { value } = await inquirer.prompt([
        {
          type: 'input',
          name: 'value',
          message: `${param.name} (${param.schema.type})${param.required ? '*' : ''}:`,
          validate: (input) => {
            if (param.required && !input) {
              return 'This parameter is required';
            }
            return true;
          },
        },
      ]);
      params[param.name] = value;
    }

    // Query parameters
    const queryParams = endpoint.parameters?.filter(p => p.in === 'query') || [];
    if (queryParams.length > 0) {
      const { includeQuery } = await inquirer.prompt([
        {
          type: 'confirm',
          name: 'includeQuery',
          message: 'Add query parameters?',
          default: false,
        },
      ]);

      if (includeQuery) {
        for (const param of queryParams) {
          const { value } = await inquirer.prompt([
            {
              type: 'input',
              name: 'value',
              message: `${param.name} (${param.schema.type})${param.required ? '*' : ''}:`,
            },
          ]);
          if (value) {
            params[param.name] = value;
          }
        }
      }
    }

    // Request body
    if (endpoint.requestBody) {
      const { includeBody } = await inquirer.prompt([
        {
          type: 'confirm',
          name: 'includeBody',
          message: 'Add request body?',
          default: endpoint.requestBody.required,
        },
      ]);

      if (includeBody) {
        const { bodyMethod } = await inquirer.prompt([
          {
            type: 'list',
            name: 'bodyMethod',
            message: 'How would you like to provide the body?',
            choices: [
              { name: 'Interactive form', value: 'form' },
              { name: 'JSON input', value: 'json' },
              { name: 'Load from file', value: 'file' },
            ],
          },
        ]);

        if (bodyMethod === 'json') {
          const { json } = await inquirer.prompt([
            {
              type: 'editor',
              name: 'json',
              message: 'Enter request body JSON:',
            },
          ]);
          params.body = JSON.parse(json);
        }
      }
    }

    return params;
  }

  /**
   * Display response with syntax highlighting
   */
  private displayResponse(response: any, duration: number): void {
    console.log(chalk.green.bold('✅ Success\n'));
    console.log(chalk.gray(`Duration: ${duration}ms\n`));

    // Status code
    console.log(chalk.bold('Status:'), chalk.green(response.status));

    // Headers
    console.log(chalk.bold('\nHeaders:'));
    for (const [key, value] of Object.entries(response.headers)) {
      console.log(chalk.gray(`  ${key}:`), value);
    }

    // Body
    console.log(chalk.bold('\nResponse Body:'));
    console.log(this.syntaxHighlight(JSON.stringify(response.data, null, 2)));
  }

  /**
   * Generate cURL command
   */
  private generateCurlCommand(endpoint: APIEndpoint, params: any): string {
    let curl = `curl -X ${endpoint.method}`;

    // Add URL
    const url = this.buildUrl(endpoint.path, params);
    curl += ` "${url}"`;

    // Add headers
    curl += ` \\\n  -H "Content-Type: application/json"`;
    if (this.client.apiKey) {
      curl += ` \\\n  -H "Authorization: Bearer ${this.client.apiKey}"`;
    }

    // Add body
    if (params.body) {
      curl += ` \\\n  -d '${JSON.stringify(params.body)}'`;
    }

    return curl;
  }

  /**
   * Generate code snippet
   */
  private generateCodeSnippet(
    endpoint: APIEndpoint,
    params: any,
    language: 'typescript' | 'python' | 'curl'
  ): string {
    switch (language) {
      case 'typescript':
        return this.generateTypeScriptSnippet(endpoint, params);
      case 'python':
        return this.generatePythonSnippet(endpoint, params);
      case 'curl':
        return this.generateCurlCommand(endpoint, params);
    }
  }

  private generateTypeScriptSnippet(endpoint: APIEndpoint, params: any): string {
    const methodName = endpoint.operationId || endpoint.path.split('/').pop();

    return `
import { StripeClient } from './client';

const client = new StripeClient({
  apiKey: 'your_api_key',
});

const result = await client.${methodName}(${JSON.stringify(params, null, 2)});
console.log(result);
`.trim();
  }

  /**
   * Post-request actions
   */
  private async postRequestActions(
    endpoint: APIEndpoint,
    params: any,
    response: any
  ): Promise<void> {
    const { action } = await inquirer.prompt([
      {
        type: 'list',
        name: 'action',
        message: 'What would you like to do?',
        choices: [
          { name: '📋 Copy response', value: 'copy' },
          { name: '💻 Generate code snippet', value: 'code' },
          { name: '🔄 Retry with modifications', value: 'retry' },
          { name: '⬅️  Back to menu', value: 'back' },
        ],
      },
    ]);

    switch (action) {
      case 'code':
        await this.showCodeSnippet(endpoint, params);
        break;
      case 'retry':
        await this.testEndpoint();
        break;
    }
  }

  private async showCodeSnippet(endpoint: APIEndpoint, params: any): Promise<void> {
    const { language } = await inquirer.prompt([
      {
        type: 'list',
        name: 'language',
        message: 'Select language:',
        choices: [
          { name: 'TypeScript', value: 'typescript' },
          { name: 'Python', value: 'python' },
          { name: 'cURL', value: 'curl' },
        ],
      },
    ]);

    const snippet = this.generateCodeSnippet(endpoint, params, language);
    console.log('\n' + this.syntaxHighlight(snippet) + '\n');
  }

  /**
   * Syntax highlighting helpers
   */
  private syntaxHighlight(json: string): string {
    return json
      .replace(/"([^"]+)":/g, chalk.cyan('"$1":'))
      .replace(/: "([^"]+)"/g, `: ${chalk.yellow('"$1"')}`)
      .replace(/: (\d+)/g, `: ${chalk.magenta('$1')}`)
      .replace(/: (true|false)/g, `: ${chalk.blue('$1')}`);
  }

  private colorMethod(method: string): string {
    const colors = {
      GET: chalk.green,
      POST: chalk.blue,
      PUT: chalk.yellow,
      PATCH: chalk.cyan,
      DELETE: chalk.red,
    };
    return (colors[method] || chalk.white)(method.padEnd(6));
  }
}

Read the full file on GitHub · 429 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 429 lines · 28 tokens per session scan B eb77b1a27fc7

Subscribe to this mod's changes

api-explorer-agent is an agent published in the GitHub repository TheLobbi/claude (21 stars, last pushed yesterday), licensed MIT. It adds 28 tokens to every session and 2,595 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 2 findings (sends data to an external url, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.