TypeScript SDKReference

Client Types

TypeScript types for Skytells client configuration, retry options, and runtime modes.

ClientOptions

interface ClientOptions {
  baseUrl?: string;
  timeout?: number;
  headers?: Record<string, string>;
  retry?: RetryOptions;
  fetch?: typeof fetch;
  runtime?: SkytellsRuntime;
  orchestratorApiKey?: string;
  orchestratorBaseUrl?: string;
}
ParameterTypeDefaultDescription
baseUrlstring'https://api.skytells.ai/v1'Override the Inference API base URL.
timeoutnumber60000Request timeout in ms. Defaults to 25000 in edge mode.
headersRecord<string, string>Custom headers merged into every request.
retryRetryOptionsRetry config for non-streaming requests. See Reliability.
fetchtypeof fetchCustom fetch implementation.
runtimeSkytellsRuntime'default'Runtime mode: 'default' · 'edge' · 'node' · 'browser'.
orchestratorApiKeystringOrchestrator wfb_… key. Required for client.orchestrator. See Orchestrator.
orchestratorBaseUrlstring'https://orchestrator.skytells.ai'Override the Orchestrator base URL.

RetryOptions

interface RetryOptions {
  retries?: number;
  retryDelay?: number;
  retryOn?: number[];
}
ParameterTypeDefaultDescription
retriesnumber0Retry attempts after first failure.
retryDelaynumber1000Base delay (ms). Linear backoff: delay × (attempt + 1).
retryOnnumber[][429, 500, 502, 503, 504]HTTP status codes that trigger retry.

SkytellsRuntime

type SkytellsRuntime = 'default' | 'edge' | 'node' | 'browser'

Determines SDK behavior for timeouts, caching, and environment detection.

ModeDescription
'default'Auto-detects environment.
'edge'Optimized for edge runtimes (Vercel, Cloudflare Workers). Reduces timeout to 25s, smaller model cache.
'node'Forces Node.js-specific optimizations.
'browser'Browser-only mode (no Node.js APIs).

See Reliability for runtime configuration.

How is this guide?

On this page