dexcost
Go

Installation

Install the dexcost Go SDK with go get, including module details and a verification snippet.

go get github.com/DexwoxBusiness/dexcost-sdk/go

Module structure

The SDK is a single Go module at github.com/DexwoxBusiness/dexcost-sdk/go. There are no optional install-time extras: all wrapper clients (OpenAI, Anthropic, Gemini, Bedrock, Cohere, Groq), the middleware package, and the pricing engine are included in the one module. Dependencies such as github.com/shopspring/decimal (exact-precision money arithmetic) and modernc.org/sqlite (pure-Go SQLite, no CGO required) are pulled in automatically by go get.

Subpackages you may import directly in your code:

PackageImport pathWhen to import directly
Top-level SDKgithub.com/DexwoxBusiness/dexcost-sdk/goAlways — Init, StartTask, Wrap*, etc.
HTTP middleware (net/http, Gin, Echo)github.com/DexwoxBusiness/dexcost-sdk/go/middlewareWhen using GinMiddleware, EchoMiddleware, or HTTPMiddleware.
HTTP & browser adaptersgithub.com/DexwoxBusiness/dexcost-sdk/go/adaptersWhen using TrackHTTP, StartBrowserSession, LambdaCost, etc.
LLM clientsgithub.com/DexwoxBusiness/dexcost-sdk/go/clientsWhen using RecordMCPResponse or streaming recorders directly.
Integrationsgithub.com/DexwoxBusiness/dexcost-sdk/go/integrationsWhen using NewDexcostCallbackHandler for langchaingo.
Pricing enginegithub.com/DexwoxBusiness/dexcost-sdk/go/pricingWhen calling pricing or rate-registry APIs directly.

Requirements

Go 1.21 or later. No CGO is required — the SQLite buffer uses modernc.org/sqlite, a pure-Go implementation.

Verify your install

After running go get, confirm the package resolves and the SDK version constant is accessible:

package main

import (
    "fmt"

    dexcost "github.com/DexwoxBusiness/dexcost-sdk/go"
)

func main() {
    fmt.Println(dexcost.Version)
}

This prints the installed SDK version (for example, 0.1.0). If the import fails, run go mod tidy and verify that github.com/DexwoxBusiness/dexcost-sdk/go appears in your go.sum.

On this page