Organization - Go SDK

Organization method reference

The Go SDK and docs are currently in beta. Report issues on GitHub.

Overview

Organization endpoints

Available Operations

ListMembers

List all members of the organization associated with the authenticated management key. Management key required.

Example Usage

1package main
2
3import(
4 "context"
5 "os"
6 openrouter "github.com/OpenRouterTeam/go-sdk"
7 "log"
8)
9
10func main() {
11 ctx := context.Background()
12
13 s := openrouter.New(
14 openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")),
15 )
16
17 res, err := s.Organization.ListMembers(ctx, nil, nil)
18 if err != nil {
19 log.Fatal(err)
20 }
21 if res != nil {
22 for {
23 // handle items
24
25 res, err = res.Next()
26
27 if err != nil {
28 // handle error
29 }
30
31 if res == nil {
32 break
33 }
34 }
35 }
36}

Parameters

ParameterTypeRequiredDescriptionExample
ctxcontext.Context✔️The context to use for the request.
offset*int64Number of records to skip for pagination0
limit*int64Maximum number of records to return (max 100)50
opts[]operations.OptionThe options for this request.

Response

*operations.ListOrganizationMembersResponse, error

Errors

Error TypeStatus CodeContent Type
sdkerrors.UnauthorizedResponseError401application/json
sdkerrors.NotFoundResponseError404application/json
sdkerrors.InternalServerResponseError500application/json
sdkerrors.APIError4XX, 5XX*/*