Signpost AI Logo
WorkersTools

Api Connector

📸 Screenshots

Here are visual examples of this section:

Api Connector - Worker Configuration Interface Api Connector - Worker Configuration Interface

1. Overview and Purpose

The API Connector worker provides a unified interface for making HTTP requests to external APIs. It supports both standalone API calls and LLM tool-callable endpoints with comprehensive authentication options, rate limiting, automatic retries, and OAuth2 client credentials flow. This worker handles various HTTP methods and provides robust error handling for reliable API integrations.

2. Configuration Parameters

The Worker accepts the following parameters:

  • toolName: Name of the tool when used as an LLM-callable function (defaults to "api_call")
  • toolDescription: Description of what the API tool does for LLM context
  • endpoint: The API endpoint URL to call
  • method: HTTP method to use (GET, POST, PUT, PATCH, DELETE)
  • params: JSON string of static parameters to include in requests
  • paramsSchema: JSON array defining parameter schema for LLM tool usage
  • headers: JSON string of HTTP headers to include in requests
  • timeout: Request timeout in milliseconds (default: 10000)
  • authType: Authentication type (none, basic, bearer, api_key, oauth2_client_credentials)
  • username: Username for basic authentication
  • selectedKeyName: Name of the stored API key to use for authentication
  • oauth2TokenUrl: Token endpoint URL for OAuth2 client credentials flow
  • oauth2ClientId: Client ID for OAuth2 authentication
  • oauth2Scope: OAuth2 scope parameter (optional)
  • rateLimitPerMinute: Maximum requests per minute (default: 60)
  • maxRetries: Maximum retry attempts for failed requests (default: 2, max: 5)

3. Input/Output Handles

  • body: Input handle - accepts request body data for POST/PUT/PATCH requests
  • endpointUrlInput: Input handle - accepts runtime endpoint URL (overrides parameter)
  • tool: Input handle - accepts tool configuration for LLM integration
  • response: Output handle - returns successful API response data
  • error: Output handle - returns error messages when requests fail

4. Usage Examples with Code

// Basic GET request configuration
{
  endpoint: "https://api.example.com/users",
  method: "GET",
  headers: '{"Accept": "application/json"}',
  authType: "bearer",
  selectedKeyName: "my_api_token"
}

// POST request with dynamic body
{
  endpoint: "https://api.example.com/users",
  method: "POST",
  headers: '{"Content-Type": "application/json"}',
  // Body data comes from the 'body' input handle
}

// LLM tool with parameter schema
{
  toolName: "get_weather",
  toolDescription: "Get current weather for a location",
  endpoint: "https://api.weather.com/v1/current/{location}",
  paramsSchema: '[{"name": "location", "type": "string", "required": true, "description": "City name"}]'
}

5. Integration Examples

The API Connector integrates seamlessly with LLM workers by providing tool definitions that allow AI agents to make API calls autonomously. It can also be used in data processing pipelines where external API data needs to be fetched and transformed by subsequent workers.

6. Best Practices

  • Use rate limiting to avoid overwhelming external APIs and respect their usage policies
  • Configure appropriate timeouts based on the expected response time of your target APIs
  • Store sensitive credentials in environment variables and reference them via selectedKeyName
  • Use parameter schemas when creating LLM tools to ensure proper argument validation

7. Troubleshooting Tips

  • Check the error output handle for detailed HTTP status codes and response messages
  • Verify authentication credentials are properly configured in your environment variables
  • Ensure JSON formatting is valid in params, headers, and paramsSchema configuration
  • Monitor rate limiting if you encounter 429 status codes from external APIs