Skip to main content

Install the package

You can install the Dedalus SDK using your preferred package manager:
npm install dedalus-labs

Get your API key

Before using the SDK, you need an API key from Dedalus Labs.
1

Sign up for Dedalus

Visit dedaluslabs.ai and create an account if you haven’t already.
2

Generate an API key

Navigate to your dashboard and generate a new API key for your project.
3

Store your API key securely

Add your API key to your environment variables. Never commit API keys to version control.
.env
DEDALUS_API_KEY=your_api_key_here
Keep your API keys secure and never expose them in client-side code or public repositories.

Set up your environment

The SDK automatically reads your API key from the DEDALUS_API_KEY environment variable. You can also pass it explicitly when initializing the client:
import Dedalus from 'dedalus-labs';

// API key is automatically loaded from process.env.DEDALUS_API_KEY
const client = new Dedalus();

Choose your environment

The SDK supports two environments: production and development.
import Dedalus from 'dedalus-labs';

const client = new Dedalus({
  environment: 'production', // https://api.dedaluslabs.ai
});
You cannot specify both baseURL and environment options. If you need to use a custom URL, set baseURL and omit the environment option.

TypeScript configuration

The SDK requires TypeScript 4.9 or higher. Make sure your tsconfig.json includes:
tsconfig.json
{
  "compilerOptions": {
    "target": "ES2020",
    "module": "commonjs",
    "lib": ["ES2020"],
    "moduleResolution": "node",
    "esModuleInterop": true,
    "strict": true
  }
}

Verify installation

Test that everything is working correctly:
test.ts
import Dedalus from 'dedalus-labs';

const client = new Dedalus();

console.log('Dedalus SDK installed successfully!');
Run the file:
node test.js

Next steps

Quickstart guide

Create your first chat completion with a working code example

Build docs developers (and LLMs) love