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.

The projects client methods are currently in ALPHA. The API may change without notice. A one-time warning is emitted on first use.
A project groups traces and spans for a single application within a space. The Get and Delete methods accept either a project name or an ID; when a name is passed, the parent space (name or ID) is also required so the SDK can resolve the name to a unique ID.

List Projects

List returns a paginated list of projects. Signature:
func (c *Client) List(ctx context.Context, params ListParams) (*ProjectList, error)
Usage Example:
package main

import (
    "context"
    "errors"
    "fmt"
    "log"

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

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

    resp, err := client.Projects.List(context.Background(), projects.ListParams{})
    if err != nil {
        var unauthorized *arize.UnauthorizedError
        if errors.As(err, &unauthorized) {
            log.Fatalf("unauthorized: %v", unauthorized)
        }
        log.Fatal(err)
    }

    for _, project := range resp.Projects {
        fmt.Printf("%s: %s (space=%s)\n", project.Id, project.Name, project.SpaceId)
    }
}

Get a Project

Get returns a single project, resolving by name or ID. space (name or ID) is required when project is a name rather than an ID. Signature:
func (c *Client) Get(ctx context.Context, project, space string) (*Project, error)
Usage Example:
package main

import (
    "context"
    "errors"
    "fmt"
    "log"

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

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

    project, err := client.Projects.Get(
        context.Background(),
        "your-project-name-or-id",
        "your-space-name-or-id",
    )
    if err != nil {
        var notFound *arize.NotFoundError
        if errors.As(err, &notFound) {
            log.Fatalf("project not found: %v", notFound)
        }
        log.Fatal(err)
    }

    fmt.Printf("project %s: %s (space=%s)\n", project.Id, project.Name, project.SpaceId)
}

Create a Project

Create issues a POST to create a new project in the given space, resolving the parent space by name or ID, and returns the created project. Signature:
func (c *Client) Create(ctx context.Context, space, name string) (*Project, error)
Usage Example:
package main

import (
    "context"
    "errors"
    "fmt"
    "log"

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

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

    project, err := client.Projects.Create(
        context.Background(),
        "your-space-name-or-id",
        "your-new-project",
    )
    if err != nil {
        var conflict *arize.ConflictError
        if errors.As(err, &conflict) {
            log.Fatalf("project already exists: %v", conflict)
        }
        log.Fatal(err)
    }

    fmt.Printf("created project %s\n", project.Id)
}

Delete a Project

Delete removes a project, resolving by name or ID. space is required when project is a name rather than an ID. It returns only an error. Signature:
func (c *Client) Delete(ctx context.Context, project, space string) error
Usage Example:
package main

import (
    "context"
    "errors"
    "log"

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

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

    err = client.Projects.Delete(
        context.Background(),
        "your-project-name-or-id",
        "your-space-name-or-id",
    )
    if err != nil {
        var notFound *arize.NotFoundError
        if errors.As(err, &notFound) {
            log.Printf("no project to remove: %v", notFound)
            return
        }
        log.Fatal(err)
    }
}