Getting Started

Quick Start

First steps using Exnest AI SDK.
import { ExnestAI } from '@exnest-dev/ai';

const exnest = new ExnestAI({
  apiKey: 'your-api-key',
  baseUrl: 'https://api.exnest.app/v1', // Optional, uses default if not provided
  timeout: 30000, // Optional
  retries: 3, // Optional
  retryDelay: 1000, // Optional
  debug: true // Optional
});

// Simple chat completion
const response = await exnest.chat('gpt-4.1-mini', [
  { role: 'user', content: 'Hello, how are you?' }
]);

console.log(response.data.choices[0].message.content);

Using the Simple Wrapper

import { ExnestWrapper } from '@exnest-dev/ai';

const exnest = new ExnestWrapper('your-api-key');

// Simple response
const response = await exnest.response('claude-3-haiku', 'What is TypeScript?');
console.log(response.data.choices[0].message.content);