Skip to main content

Requirements

The Dedalus Go SDK requires Go 1.22 or higher.
Before installing the SDK, ensure you have Go installed on your system:
go version
If you need to install or upgrade Go, visit the official Go downloads page.

Install the SDK

1

Install the package

Add the Dedalus SDK to your Go project using go get:
go get github.com/dedalus-labs/dedalus-sdk-go
Pinning to a specific version is recommended for production applications to ensure consistent behavior.
2

Import the SDK

Import the SDK in your Go code:
import (
    "github.com/dedalus-labs/dedalus-sdk-go"
    "github.com/dedalus-labs/dedalus-sdk-go/option"
    "github.com/dedalus-labs/dedalus-sdk-go/shared"
)
The package is imported as githubcomdedaluslabsdedalussdkgo due to Go’s import naming conventions.
3

Set up authentication

Configure your API key using environment variables or client options:
Set the DEDALUS_API_KEY environment variable:
export DEDALUS_API_KEY="your-api-key-here"
The client will automatically read this value:
client := githubcomdedaluslabsdedalussdkgo.NewClient()

Environment Configuration

The SDK supports multiple environment configurations:
client := githubcomdedaluslabsdedalussdkgo.NewClient(
    option.WithAPIKey("your-api-key"),
    option.WithEnvironmentProduction(), // This is the default
)

Available Environment Variables

The SDK reads configuration from the following environment variables:
VariableDescriptionDefault
DEDALUS_API_KEYYour Dedalus API keyRequired
DEDALUS_X_API_KEYAdditional API key for certain operationsOptional
DEDALUS_PROVIDER_KEYProvider-specific API key for BYOKOptional
DEDALUS_BASE_URLCustom API base URLProduction URL
DEDALUS_AS_URLCustom AS URL for specific operationsOptional
DEDALUS_ORG_IDOrganization ID for multi-org setupsOptional
DEDALUS_PROVIDERDefault provider to useOptional
DEDALUS_PROVIDER_MODELDefault provider modelOptional

Verify Installation

Create a simple test file to verify your installation:
test.go
package main

import (
	"context"
	"fmt"

	"github.com/dedalus-labs/dedalus-sdk-go"
	"github.com/dedalus-labs/dedalus-sdk-go/option"
)

func main() {
	client := githubcomdedaluslabsdedalussdkgo.NewClient(
		option.WithAPIKey("your-api-key"),
	)

	models, err := client.Models.List(context.TODO())
	if err != nil {
		panic(err.Error())
	}

	fmt.Println("Available models:", len(models.Data))
}
Run the test:
go run test.go
If you see output listing available models, your installation is successful!

Next Steps

Quickstart Guide

Learn how to make your first API call with a complete chat completion example

Build docs developers (and LLMs) love