> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pinecone.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Pinecone Go SDK

> Install and use the Pinecone Go SDK to manage indexes and namespaces, upsert vectors, run semantic search, and call the Admin and Inference APIs from Go.

<Tip>
  For installation instructions and usage examples, see the [Go SDK documentation](https://github.com/pinecone-io/go-pinecone). To report an issue or request a feature, [file an issue on GitHub](https://github.com/pinecone-io/go-pinecone/issues).
</Tip>

## Requirements

The Pinecone Go SDK requires a Go version with [modules](https://go.dev/wiki/Modules) support.

## SDK versions

SDK versions are pinned to specific [API versions](/reference/api/versioning). When a new API version is released, a new version of the SDK is also released.

The mappings between API versions and Go SDK versions are as follows:

| API version | SDK version |
| :- | :- |
| `2026-07` | v7.x |
| `2026-04` | v6.x |
| `2025-10` | v5.x |
| `2025-04` | v4.x |
| `2025-01` | v3.x |
| `2024-10` | v2.x |
| `2024-07` | v1.x |
| `2024-04` | v0.x |

When a new stable API version is released, you should upgrade your SDK to the latest version to ensure compatibility with the latest API changes.

## Install

To install the latest version of the [Go SDK](https://github.com/pinecone-io/go-pinecone), add a dependency to the current module:

```shell theme={null}
go get github.com/pinecone-io/go-pinecone/v7/pinecone
```

To install a specific version of the Go SDK, run the following command:

```shell theme={null}
go get github.com/pinecone-io/go-pinecone/v7/pinecone@<version>
```

To check your SDK version, run the following command:

```shell theme={null}
go list -u -m all | grep go-pinecone
```

## Upgrade

<Warning>
  Before upgrading to `v7.0.0`, update all relevant code to account for the following breaking changes. See the [v7 migration guide](https://github.com/pinecone-io/go-pinecone/blob/main/guides/migration/v7.md) for before-and-after examples.

  * Pod-based index creation is removed. `CreatePodIndex` and `CreatePodIndexRequest` no longer exist, but existing pod-based indexes keep working.
  * Enum constants are prefixed with their type name. For example, `Aws` is now `CloudAWS`, and `Cosine` is now `IndexMetricCosine`.
  * `ListImports` takes a `*ListImportsRequest`, and `QueryByVectorIdRequest.SparseValues` is removed.
  * `SourceCollection` and `Schema` on the legacy create requests now return an error. `ConfigureIndexParams.Embed` is replaced by `ConfigureIndexParams.Schema`.
  * `Backup` field types changed, and some invalid requests now fail client-side.

  If you are upgrading from `v2` or earlier, also account for the `v3.0.0` breaking changes explained [here](/release-notes/2025#2025-02-07-4).
</Warning>

Each major version carries its version number in the module path, so crossing a major requires updating the import path in every file that uses the SDK. For example, moving from `v6` to `v7` means changing:

```go theme={null}
// before
import "github.com/pinecone-io/go-pinecone/v6/pinecone"

// after
import "github.com/pinecone-io/go-pinecone/v7/pinecone"
```

Apart from the module path, `v5.0.0` and `v6.0.0` are backward compatible with the release lines before them. `v7.0.0` targets API version `2026-07` and includes the breaking changes listed above. To stay on API version `2026-04`, keep using `v6`.

If you already have the Go SDK, upgrade to the latest version as follows:

```shell theme={null}
go get -u github.com/pinecone-io/go-pinecone/v7/pinecone@latest
```

## Initialize

Once installed, you can import the SDK and then use an [API key](/guides/production/security-overview#api-keys) to initialize a client instance:

```Go theme={null}
package main

import (
    "context"
    "log"

    "github.com/pinecone-io/go-pinecone/v7/pinecone"
)

func main() {
    ctx := context.Background()

    pc, err := pinecone.NewClient(pinecone.NewClientParams{
        ApiKey: "YOUR_API_KEY",
    })
    if err != nil {
        log.Fatalf("Failed to create Client: %v", err)
    }
} 
```

To manage organizations, projects, API keys, and [role-based access control](/guides/production/manage-rbac), initialize an `AdminClient` with [service account](/guides/organizations/manage-service-accounts) credentials instead:

```Go theme={null}
package main

import (
    "context"
    "log"
    "os"

    "github.com/pinecone-io/go-pinecone/v7/pinecone"
)

func main() {
    ctx := context.Background()

    adminClient, err := pinecone.NewAdminClientWithContext(ctx, pinecone.NewAdminClientParams{
        ClientId:     os.Getenv("PINECONE_CLIENT_ID"),
        ClientSecret: os.Getenv("PINECONE_CLIENT_SECRET"),
    })
    if err != nil {
        log.Fatalf("Failed to create AdminClient: %v", err)
    }
}
```
