Skip to main content

Documentation Index

Fetch the complete documentation index at: https://arize-ax.mintlify.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

Installation

This package is currently pre-release. Add the module to your project:
go get github.com/Arize-ai/client-go-v2

Configuration

Authenticate using API keys obtained from the Arize Platform. The API key is required for all operations and can be provided via Config or the ARIZE_API_KEY environment variable. The API host is also configurable via Config.APIHost or the ARIZE_API_HOST environment variable. Refer to the API Hosts and Regions documentation for base URL configuration, which defaults to the global environment.
package main

import (
    "log"

    "github.com/Arize-ai/client-go-v2"
)

func main() {
    client, err := arize.NewClient(arize.Config{
        APIKey:  "your-api-key",
        APIHost: "api.arize.com",
    })
    if err != nil {
        log.Fatal(err)
    }
    _ = client
}

Regions

Use Config.Region to point the client at a specific Arize deployment region. Setting Region overrides APIHost, OTLPHost, FlightHost, and FlightPort. Region is mutually exclusive with SingleHost/SinglePort and BaseDomain.
client, err := arize.NewClient(arize.Config{
    APIKey: "your-api-key",
    Region: arize.RegionUSCentral,
})
Region ConstantIdentifier
RegionUSCentralus-central-1a
RegionEUWesteu-west-1a
RegionCACentralca-central-1a
RegionUSEastus-east-1b

Error Handling

The SDK returns typed errors for non-2xx HTTP responses. Compare against typed errors with errors.As and against sentinel errors with errors.Is.
import (
    "context"
    "errors"
    "log"

    "github.com/Arize-ai/client-go-v2"
    "github.com/Arize-ai/client-go-v2/resourcerestrictions"
)

func main() {
    client, err := arize.NewClient(arize.Config{APIKey: "your-api-key"})
    if err != nil {
        if errors.Is(err, arize.ErrMissingAPIKey) {
            log.Fatal("API key is required")
        }
        log.Fatal(err)
    }

    _, err = client.ResourceRestrictions.Create(context.Background(), resourcerestrictions.CreateRequest{
        ResourceId: "your-project-id",
    })

    var notFound *arize.NotFoundError
    var unauthorized *arize.UnauthorizedError
    switch {
    case errors.As(err, &notFound):
        log.Printf("resource not found: %v", notFound)
    case errors.As(err, &unauthorized):
        log.Printf("unauthorized: %v", unauthorized)
    case err != nil:
        log.Fatal(err)
    }
}
Available typed errors (re-exported from the public arize package):
  • arize.APIError
  • arize.BadRequestError
  • arize.UnauthorizedError
  • arize.ForbiddenError
  • arize.NotFoundError
  • arize.ConflictError
  • arize.RateLimitError
  • arize.ServerError
  • arize.ResourceNotFoundError
Sentinel errors:
  • arize.ErrMissingAPIKey
  • arize.ErrMultipleEndpointOverrides

Subclients

The Client exposes typed subclients as exported fields. Each subclient lives in its own package and is documented on its own page:

Pre-Release API Warnings

Pre-release APIs (ALPHA and BETA) are actively evolving based on user feedback. The SDK emits a one-time warning via the standard log package the first time you call a pre-release endpoint:
client.ResourceRestrictions.Create(ctx, body)
// [ALPHA] resourcerestrictions.create is an alpha API and may change without notice.
Subsequent calls to the same endpoint do not re-emit the warning.
For detailed information about API version stages, stability guarantees, and recommendations, see API Version Stages in the REST API reference.