# Use Product SDK

Product SDK operates workspace-scoped product resources from Go or Python applications. A verified public distribution channel is not currently available. If you obtained the SDK through an official channel, use this page to verify a read-only connection. Do not substitute installation commands or internal module paths from another SDK for an official installation path.

## 1. Prepare connection information

```bash
export PRODUCT_API_BASE_URL='<Product API Base URL ending in /newmoi>'
export PRODUCT_API_KEY='<your-personal-access-token>'
```

The SDK does not append `/newmoi` automatically. Pass the personal access token unchanged; the client sends it through `X-API-Key`.

## 2. List visible workspaces

:::::{tab-set}

::::{tab-item} Python

```python
import os

import moi_product_sdk as sdk

client = sdk.new_with_personal_access_token(
    os.environ["PRODUCT_API_BASE_URL"],
    os.environ["PRODUCT_API_KEY"],
)
result = client.workspaces().list()
for workspace in result.workspaces:
    print(workspace.id, workspace.name)
```

::::

::::{tab-item} Go

```go
package main

import (
	"context"
	"fmt"
	"os"

	sdk "github.com/matrixorigin/matrixflow/sdk/go-sdk"
)

func main() {
	ctx := context.Background()
	client, err := sdk.NewWithPersonalAccessToken(
		os.Getenv("PRODUCT_API_BASE_URL"),
		os.Getenv("PRODUCT_API_KEY"),
	)
	if err != nil {
		panic(err)
	}
	result, err := client.Workspaces().List(ctx)
	if err != nil {
		panic(err)
	}
	for _, workspace := range result.GetWorkspaces() {
		fmt.Printf("%s\t%s\n", workspace.GetId(), workspace.GetName())
	}
}
```

::::

:::::

A successful list response shows that the endpoint and personal access token can be used for workspace discovery. Choose one returned workspace ID, then enter its scope with Python `client.workspace(workspace_id)` or Go `client.Workspace(workspaceID)`. Do not use `ensure_workspace` or `EnsureWorkspace`, which may create a workspace, to verify the connection.

## Next steps

- [Confirm installation limitations](../sdk/product-sdk/getting-started/installation.md)
- [Configure the client and workspace](../sdk/product-sdk/getting-started/authentication-client.md)
- [Choose a Product SDK task guide](../sdk/product-sdk/guides/index.md)
