# Go SDK

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

A client for every API operation, with OAuth2 and iterators.

[github.com/ovh/sdk-go](https://github.com/ovh/sdk-go)

## Install

Go 1.25 or later (tested on 1.25, 1.26 and 1.27). You also need OAuth2 credentials: the client ID and secret of a service account.

```bash
go get github.com/ovh/sdk-go
```

## First program

This prints the details of your account: `GET /v1/me`. Copy it, set your credentials, run it.

```go
package main

import (
	"context"
	"fmt"
	"log"

	"github.com/ovh/sdk-go/ovh"
	"github.com/ovh/sdk-go/pkg/me"
)

func main() {
	client, err := ovh.NewClient() // reads OVH_CLIENT_ID, OVH_CLIENT_SECRET, OVH_REGION
	if err != nil {
		log.Fatal(err)
	}

	account, err := me.New(client).GetAccountDetails(context.Background()) // GET /v1/me
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println("account:", ovh.Value(account.Nichandle))
	fmt.Println("email:  ", ovh.Value(account.Email))
	fmt.Println("country:", ovh.Value(account.Country))
}
```

## Run it

```bash
export OVH_CLIENT_ID=...  OVH_CLIENT_SECRET=...
export OVH_REGION=eu    # eu (default), ca or us
go run .
```

[Next TypeScript SDK →](https://developers.eu.ovhcloud.com/sdks/typescript.md)
