Go SDK preview
This page previews the Go module hlix will publish. It is generated from the public OpenAPI contract, and the shapes below are the ones the published module will expose.
Prerequisites
Section titled “Prerequisites”- Go 1.23 or later
- An hlix API key and workspace ID
Generate a client meanwhile
Section titled “Generate a client meanwhile”The OpenAPI contract is public and unauthenticated, so a working Go client is one command away:
curl --fail --silent --show-error \ https://server.hlix.ai/v1/api/openapi.json \ --output hlix-openapi.json
npx @openapitools/openapi-generator-cli generate \ -i hlix-openapi.json \ -g go \ -o ./hlix-clientExpected result: a module whose operations match the API reference one for one. hlix pins OpenAPI Generator 7.22.0 for its own previews; pin yours so regeneration is reproducible.
Identifiers in your generated client will differ from the sample below — that is the cost of generating rather than waiting. The requests and responses are identical, because both come from the one contract.
List projects
Section titled “List projects”Create main.go:
package main
import ( "context" "fmt" "log" "os"
// The module path your generated client uses — hlix has not published one. hlix "example.com/hlix-client")
func main() { workspaceID := os.Getenv("HLIX_WORKSPACE_ID") apiKey := os.Getenv("HLIX_API_KEY") if workspaceID == "" || apiKey == "" { log.Fatal("HLIX_WORKSPACE_ID and HLIX_API_KEY are required") }
ctx := context.WithValue( context.Background(), hlix.ContextAPIKeys, map[string]hlix.APIKey{"apiKey": {Key: apiKey}}, )
configuration := hlix.NewConfiguration() client := hlix.NewAPIClient(configuration) projects, _, err := client.ProjectsAPI. ListProjects(ctx). XOrganizationId(workspaceID). Execute() if err != nil { log.Fatal(err) }
fmt.Printf("%v\n", projects)}Run it:
HLIX_API_KEY='…' \HLIX_WORKSPACE_ID='<workspace-id>' \go run .Expected result: the selected workspace’s project collection is printed.
Use another API origin
Section titled “Use another API origin”The generated configuration defaults to production. For a self-hosted or staging deployment, replace its server list before creating the client. Keep production credentials out of non-production hosts.
Preview limitations
Section titled “Preview limitations”- Method names, generic response types, and module packaging may change before a stable tag.
- The preview does not add the TypeScript SDK’s opinionated errors, bounded retry, local import scanner, or sync workflow.
- Streaming and bundle upload protocols require application-specific lifecycle handling.
- The generated auth context key must be
apiKey, and tenant selection remains an explicitXOrganizationIdcall option.
If the preview client fails
Section titled “If the preview client fails”no required module provides package …: you are fetching a module path hlix has not published. Generate a client from the contract instead, and check Current versions.missing go.sum entry: rungo mod tidywith network access for the generated client’s dependencies.401: confirm the API key is present inContextAPIKeysunderapiKey.403: confirm the user can access the explicit workspace ID.404: the resource is absent or not visible to this caller.- Regeneration drift: pin your generator version, and re-download the contract — its
info.versiontells you whether the contract itself moved.