@sdkrouter/api
v0.1.6
Published
SDKRouter API Client — all REST endpoints, typed, lazy-loaded
Readme
@sdkrouter/api
TypeScript client for SDKRouter REST API. All endpoints, typed, lazy-loaded.
Install
npm install @sdkrouter/apiQuick Start
import { SDKRouterAPI } from '@sdkrouter/api';
const api = new SDKRouterAPI({ apiKey: 'sk_live_...' });
// Tools
await api.research.search_create({ query: 'AI news' });
await api.vision.image_analyze({ url: '...' });
await api.cdn.files_list();
// Business
await api.newsletter.newsletters_list();
await api.leads.submit_create('my-project', { name: 'John', email: '[email protected]' });
await api.support.tickets_create({ subject: 'Help', message: 'Question' });
// Dev mode (localhost:8000)
const dev = new SDKRouterAPI({ apiKey: 'sk_live_...', dev: true });Config
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| apiKey | string | required | SDK API key (sk_live_...) |
| dev | boolean | false | Use localhost:8000 instead of api.sdkrouter.com |
| apiUrl | string | auto | Override API URL (rare) |
Endpoints
All lazy-loaded — only initialized when first accessed.
Tools
| Property | Description |
|----------|-------------|
| api.vision | Image analysis, OCR |
| api.cdn | File upload and storage |
| api.research | Web search + research pipeline |
| api.shortlinks | URL shortening |
| api.llmModels | LLM model listing |
| api.keys | SDK API key management |
| api.cleaner | HTML cleaner |
| api.imageGen | AI image generation |
| api.crawler | Web page crawling |
Business
| Property | Description |
|----------|-------------|
| api.newsletter | Newsletters, campaigns, subscriptions |
| api.leads | Lead management + public form submission |
| api.support | Support tickets + messages |
| api.payments | Crypto payment processing |
| api.emailGateway | Email sending via SMTP |
| api.exchanges | Exchange account management |
Knowledge
| Property | Description |
|----------|-------------|
| api.knowbase | Knowledge base projects, documents, search |
| api.knowbaseChat | KB chat sessions and messages |
Integrations
| Property | Description |
|----------|-------------|
| api.telegram | Telegram bot proxy + MTProto accounts |
| api.proxies | Proxy management and rotation |
Types
All generated types are re-exported:
import { NewsletterTypes, LeadsTypes, ResearchTypes } from '@sdkrouter/api';
const newsletter: NewsletterTypes.NewsletterDetail = ...;
const lead: LeadsTypes.LeadDetail = ...;