Installation
Install the dexcost Go SDK with go get, including module details and a verification snippet.
go get github.com/DexwoxBusiness/dexcost-sdk/goModule 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:
| Package | Import path | When to import directly |
|---|---|---|
| Top-level SDK | github.com/DexwoxBusiness/dexcost-sdk/go | Always — Init, StartTask, Wrap*, etc. |
| HTTP middleware (net/http, Gin, Echo) | github.com/DexwoxBusiness/dexcost-sdk/go/middleware | When using GinMiddleware, EchoMiddleware, or HTTPMiddleware. |
| HTTP & browser adapters | github.com/DexwoxBusiness/dexcost-sdk/go/adapters | When using TrackHTTP, StartBrowserSession, LambdaCost, etc. |
| LLM clients | github.com/DexwoxBusiness/dexcost-sdk/go/clients | When using RecordMCPResponse or streaming recorders directly. |
| Integrations | github.com/DexwoxBusiness/dexcost-sdk/go/integrations | When using NewDexcostCallbackHandler for langchaingo. |
| Pricing engine | github.com/DexwoxBusiness/dexcost-sdk/go/pricing | When 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.