OpenAI API

Get vector stores usage details for the organization.

get
https://api.openai.com/v1/organization/usage/vector_stores

Query Parameters

start_timeintegerrequired

Start time (Unix seconds) of the query time range, inclusive.

end_timeinteger

End time (Unix seconds) of the query time range, exclusive.

bucket_widthstring

Width of each time bucket in response. Currently 1m, 1h and 1d are supported, default to 1d.

Allowed values:1m1h1d

Default:1d

project_idsarray[string]

Return only usage for these projects.

group_byarray[string]

Group the usage data by the specified fields. Support fields include project_id.

Allowed values:project_id

limitinteger

Specifies the number of buckets to return.

  • bucket_width=1d: default: 7, max: 31
  • bucket_width=1h: default: 24, max: 168
  • bucket_width=1m: default: 60, max: 1440
pagestring

A cursor for use in pagination. Corresponding to the next_page field from the previous response.

Response

200 application/json

Usage data retrieved successfully.

UsageResponse

objectstringrequired

Allowed values:page

dataarray[object]required
Show Child Parameters
has_morebooleanrequired
next_pagestringrequired
get/organization/usage/vector_stores
 
200 application/json

Returns a list of invites in the organization.

get
https://api.openai.com/v1/organization/invites

Query Parameters

limitinteger

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20.

Default:20

afterstring

A cursor for use in pagination. after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list.

Response

200 application/json

Invites listed successfully.

InviteListResponse

objectstringrequired

The object type, which is always list

Allowed values:list

dataarray[object]required

Represents an individual invite to the organization.

Show Child Parameters
first_idstring

The first invite_id in the retrieved list

last_idstring

The last invite_id in the retrieved list

has_moreboolean

The has_more property is used for pagination to indicate there are additional results.

get/organization/invites
 
200 application/json

Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization.

post
https://api.openai.com/v1/organization/invites

Body

application/json

The invite request payload.

InviteRequest

emailstringrequired

Send an email to this address

rolestringrequired

owner or reader

Allowed values:readerowner

projectsarray[object]

An array of projects to which membership is granted at the same time the org invite is accepted. If omitted, the user will be invited to the default project for compatibility with legacy behavior.

Show Child Parameters

Response

200 application/json

User invited successfully.

Invite

Represents an individual invite to the organization.

objectstringrequired

The object type, which is always organization.invite

Allowed values:organization.invite

idstringrequired

The identifier, which can be referenced in API endpoints

emailstringrequired

The email address of the individual to whom the invite was sent

rolestringrequired

owner or reader

Allowed values:ownerreader

statusstringrequired

accepted,expired, or pending

Allowed values:acceptedexpiredpending

invited_atintegerrequired

The Unix timestamp (in seconds) of when the invite was sent.

expires_atintegerrequired

The Unix timestamp (in seconds) of when the invite expires.

accepted_atinteger

The Unix timestamp (in seconds) of when the invite was accepted.

projectsarray[object]

The projects that were granted membership upon acceptance of the invite.

Show Child Parameters
post/organization/invites

Body

{ "email": "email", "role": "reader" }
 
200 application/json

Retrieves an invite.

get
https://api.openai.com/v1/organization/invites/{invite_id}

Path Parameters

invite_idstringrequired

The ID of the invite to retrieve.

Response

200 application/json

Invite retrieved successfully.

Invite

Represents an individual invite to the organization.

objectstringrequired

The object type, which is always organization.invite

Allowed values:organization.invite

idstringrequired

The identifier, which can be referenced in API endpoints

emailstringrequired

The email address of the individual to whom the invite was sent

rolestringrequired

owner or reader

Allowed values:ownerreader

statusstringrequired

accepted,expired, or pending

Allowed values:acceptedexpiredpending

invited_atintegerrequired

The Unix timestamp (in seconds) of when the invite was sent.

expires_atintegerrequired

The Unix timestamp (in seconds) of when the invite expires.

accepted_atinteger

The Unix timestamp (in seconds) of when the invite was accepted.

projectsarray[object]

The projects that were granted membership upon acceptance of the invite.

Show Child Parameters
get/organization/invites/{invite_id}
 
200 application/json

Delete an invite. If the invite has already been accepted, it cannot be deleted.

delete
https://api.openai.com/v1/organization/invites/{invite_id}

Path Parameters

invite_idstringrequired

The ID of the invite to delete.

Response

200 application/json

Invite deleted successfully.

InviteDeleteResponse

objectstringrequired

The object type, which is always organization.invite.deleted

Allowed values:organization.invite.deleted

idstringrequired
deletedbooleanrequired
delete/organization/invites/{invite_id}
 
200 application/json