celedog

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2026 License: MIT Imports: 2 Imported by: 0

README

celedog (Go)

OpenAI-compatible Go client for Celedog.io — one API, 400+ AI models, pay as you go.

go get github.com/AIRES-Technology/celedog-go

Quick start

package main

import (
    "context"
    "fmt"

    "github.com/AIRES-Technology/celedog-go"
    openai "github.com/sashabaranov/go-openai"
)

func main() {
    // Reads CELEDOG_API_KEY from the env; or pass it directly:
    //   celedog.NewClient("sk-celedog-...")
    client := celedog.NewClient("")

    resp, err := client.CreateChatCompletion(
        context.Background(),
        openai.ChatCompletionRequest{
            Model: "gpt-4o",
            Messages: []openai.ChatCompletionMessage{
                {Role: openai.ChatMessageRoleUser, Content: "Hello, Celedog!"},
            },
        },
    )
    if err != nil {
        panic(err)
    }
    fmt.Println(resp.Choices[0].Message.Content)
}

Streaming, tool calls, vision, embeddings — every feature of the official github.com/sashabaranov/go-openai SDK works unchanged. Celedog is wire-compatible with the OpenAI API; this package is a thin factory that pins the base URL.

Configuration

Source Variable Default
NewClient(apiKey) first arg empty
Env CELEDOG_API_KEY
Env (fallback) OPENAI_API_KEY
Env CELEDOG_BASE_URL https://celedog.io/v1

Other languages

Celedog ships parity SDKs for every major language — pick the one you use:

Language Install
Python pip install celedog
Node.js / TypeScript npm install celedog
Go go get github.com/AIRES-Technology/celedog-go
Java Maven coordinate io.celedog:celedog:0.1.0 (GitHub Packages — see celedog-java)

All four expose the same env vars and the same fall-back chain.

License

MIT — free to use and integrate. The Celedog gateway server itself is AGPL-3.0 (see celedog.io); SDK code is permissive so you can ship it inside your closed-source app.

Documentation

Overview

Package celedog is a thin wrapper around go-openai with the base URL pinned to https://celedog.io/v1 and the API key sourced from CELEDOG_API_KEY.

Index

Constants

View Source
const (
	DefaultBaseURL = "https://celedog.io/v1"
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(apiKey string) *openai.Client

NewClient returns a *openai.Client pointed at Celedog. If apiKey is empty it reads CELEDOG_API_KEY then OPENAI_API_KEY. CELEDOG_BASE_URL overrides the default base URL when set (useful for staging or self-hosted forks).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL