Getting Started

Authentication

How to authenticate with Exnest AI SDK.

Authentication & Universal Connector

Exnest supports both Exnest API keys (prefixed with ex-sk) and official provider API keys through the Universal Connector feature. This allows you to:

  1. Use your existing API keys from providers like OpenAI, Anthropic, etc.
  2. Still benefit from Exnest's unified API interface
  3. Optionally use Exnest's billing and management features when using Exnest API keys

Using Exnest API Keys (with billing)

const exnest = new ExnestAI({
  apiKey: 'ex-sk-your-exnest-api-key'
});

const response = await exnest.chat('gpt-4.1-mini', [
  { role: 'user', content: 'Hello!' }
]);

Using Official Provider API Keys (without billing)

const exnest = new ExnestAI({
  apiKey: 'sk-your-openai-api-key'
});

const response = await exnest.chat('gpt-4.1-mini', [
  { role: 'user', content: 'Hello!' }
]);