Installation

Requirements

  • Go 1.21 or later

Install the SDK

go get github.com/agentplexus/go-opik

Install the CLI (Optional)

go install github.com/agentplexus/go-opik/cmd/opik@latest

Verify Installation

package main

import (
    "fmt"

    opik "github.com/agentplexus/go-opik"
)

func main() {
    client, err := opik.NewClient()
    if err != nil {
        fmt.Printf("Error: %v\n", err)
        return
    }
    fmt.Println("Opik client created successfully!")
    _ = client
}

Opik Server Options

Use the hosted Opik Cloud service:

  1. Sign up at comet.com
  2. Get your API key and workspace name
  3. Set environment variables:
export OPIK_API_KEY="your-api-key"
export OPIK_WORKSPACE="your-workspace"

Self-Hosted

Run Opik locally using Docker:

# Clone the Opik repository
git clone https://github.com/comet-ml/opik.git
cd opik

# Start with Docker Compose
docker-compose up -d

The local server runs at http://localhost:5173 by default.

export OPIK_URL_OVERRIDE="http://localhost:5173/api"

Next Steps