Use the OpenDunes API from Go via any OpenAI-compatible client library.
OpenDunes is OpenAI-compatible, so any Go client that supports a custom base URL works out of the box. The examples below use openai-go, the official Go library from OpenAI. Its request parameter helpers change between releases, so treat the per-resource pages' wire surface (curl + JSON) as the source of truth and check your installed SDK version's own documentation for the exact call shape.
go get github.com/openai/openai-goPoint the client at https://opendunes.com/v1 and pass your key from the environment:
package main
import (
"context"
"fmt"
"os"
"github.com/openai/openai-go"
"github.com/openai/openai-go/option"
)
func main() {
client := openai.NewClient(
option.WithBaseURL("https://opendunes.com/v1"),
option.WithAPIKey(os.Getenv("OPENDUNES_API_KEY")),
)
// The base URL + key config above is stable across openai-go versions.
// Drive requests through client.Chat.Completions, client.Embeddings, etc.;
// the exact parameter shape depends on your installed SDK version, so follow
// the per-resource pages (e.g. Chat) and your SDK's own docs.
_ = client
fmt.Println("OpenDunes client ready")
}See Chat for a first request (with the exact wire surface it maps to).
Set your key before running:
export OPENDUNES_API_KEY=sk-0a1b2c3d4e5f...
go run main.go| Resource | Status | Page |
|---|---|---|
| Chat | Live | Send messages, stream responses |
| Models | Live | Browse and inspect the model catalog |
| Credits | Live | Check balance and usage in DA |
| API Keys | Live | Create and manage API keys |
| Analytics | Live | Request and token usage history |
| Embeddings | Live | Vector embeddings |
| Generations | Live | One request's receipt, in DA, and feedback |
| Endpoints | Live | The providers serving one model, each with its price |
| Providers | Live | Every provider, with its policies |
| Benchmarks | Live | Benchmark and arena scores per model |
| Guardrails | Live | Budgets, model and provider lists, content filters on your keys |
| Observability | Live | Traces to your own monitoring tool |
| Presets | Live | Saved request settings, used as @preset/<slug> |
| OAuth | Live | Sign in with OpenDunes — PKCE |
| Files | Live | File uploads |
| Images | Live | Image inputs and outputs |
| Responses | Live | Responses API |
| Rerank | Live | Result reranking |
| Speech-to-Text | Live | Audio transcription |
| Text-to-Speech | Live | Speech synthesis |
| Video Generation | Live | Video generation |