API Integration Kit

Connect agents to external APIs with authentication, retries, caching, and health monitoring.

Endpoints

Options

POSThttps://api.openai.com/v1/chat/completionshealthy1200ms

Integration Code

import { createApiClient } from 'agent-tools-kit/tooling'

const api = createApiClient({
  baseUrl: 'https://api.openai.com',
  auth: { type: 'bearer', token: process.env.API_KEY },
  retry: { enabled: true, maxAttempts: 3, backoff: 'exponential' },
  cache: { enabled: false, ttl: 300 },
  timeout: 30000,
  rateLimit: { maxRequests: 60, windowMs: 60000 },
})

const response = await api.post('/v1/endpoint', {
  body: {"model": "gpt-4o", "messages": [{"role": "user", "content":...
})

// Health monitoring
api.on('degraded', (endpoint) => alert.send(endpoint))
api.on('error', (err) => logger.error(err))