Claude Platform Docs

Obtenir l'organisation actuelle

client.Organization.Get(ctx) (*OrganizationInfo, error)
GET/v1/organizations/me

Récupérez les informations sur l'organisation associée à la clé API authentifiée.

Returns
type OrganizationInfo struct { Type: "organization"; ID; Name }
Type Organization

Object type.

For Organizations, this is always "organization".

defaultorganization
ID string

ID of the Organization.

formatuuid
Name string

Name of the Organization.

Obtenir l'organisation actuelle
package main

import (
	"context"
	"fmt"

	"github.com/anthropics/anthropic-sdk-go"
	"github.com/anthropics/anthropic-sdk-go/option"
)

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	organizationInfo, err := client.Organization.Get(context.TODO())
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", organizationInfo.ID)
}
Returns Examples
Response 200
{
  "id": "12345678-1234-5678-1234-567812345678",
  "name": "Organization Name",
  "type": "organization"
}