GET/v1/api_key
List api_keys
List out all api_keys. The api_keys are sorted by creation date, with the most recently-created api_keys coming first
Authorization
Authorization
RequiredBearer <token>
Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key]
to your HTTP request. You can create an API key in the Braintrust organization settings page.
In: header
Query Parameters
limit
integer
Limit the number of objects to return
Minimum:0
starting_after
string
Pagination cursor id.
For example, if the final item in the last page you fetched had an id of foo
, pass starting_after=foo
to fetch the next page. Note: you may only pass one of starting_after
and ending_before
"uuid"
ending_before
string
Pagination cursor id.
For example, if the initial item in the last page you fetched had an id of foo
, pass ending_before=foo
to fetch the previous page. Note: you may only pass one of starting_after
and ending_before
"uuid"
ids
Any properties in string, array<string>
Filter search results to a particular set of object IDs. To specify a list of IDs, include the query param multiple times
api_key_name
string
Name of the api_key to search for
org_name
string
Filter search results to within a particular organization
Status code | Description |
---|---|
200 | Returns a list of api_key objects |
400 | The request was unacceptable, often due to missing a required parameter |
401 | No valid API key provided |
403 | The API key doesn’t have permissions to perform the request |
429 | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests |
500 | Something went wrong on Braintrust's end. (These are rare.) |
POST/v1/api_key
Create api_key
Create a new api_key. It is possible to have multiple API keys with the same name. There is no de-duplication
Authorization
Authorization
RequiredBearer <token>
Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key]
to your HTTP request. You can create an API key in the Braintrust organization settings page.
In: header
Request Body (Optional)
Any desired information about the new api_key object
name
Requiredstring
Name of the api key. Does not have to be unique
org_name
string | null
For nearly all users, this parameter should be unnecessary. But in the rare case that your API key belongs to multiple organizations, you may specify the name of the organization the API key belongs in.
Status code | Description |
---|---|
200 | Returns an object containing the raw API key. This is the only time the raw API key will be exposed |
400 | The request was unacceptable, often due to missing a required parameter |
401 | No valid API key provided |
403 | The API key doesn’t have permissions to perform the request |
429 | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests |
500 | Something went wrong on Braintrust's end. (These are rare.) |
GET/v1/api_key/{api_key_id}
Get api_key
Get an api_key object by its id
Authorization
Authorization
RequiredBearer <token>
Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key]
to your HTTP request. You can create an API key in the Braintrust organization settings page.
In: header
Path Parameters
api_key_id
Requiredstring
ApiKey id
Format:"uuid"
Status code | Description |
---|---|
200 | Returns the api_key object |
400 | The request was unacceptable, often due to missing a required parameter |
401 | No valid API key provided |
403 | The API key doesn’t have permissions to perform the request |
429 | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests |
500 | Something went wrong on Braintrust's end. (These are rare.) |
DELETE/v1/api_key/{api_key_id}
Delete api_key
Delete an api_key object by its id
Authorization
Authorization
RequiredBearer <token>
Most Braintrust endpoints are authenticated by providing your API key as a header Authorization: Bearer [api_key]
to your HTTP request. You can create an API key in the Braintrust organization settings page.
In: header
Path Parameters
api_key_id
Requiredstring
ApiKey id
Format:"uuid"
Status code | Description |
---|---|
200 | Returns the deleted api_key object |
400 | The request was unacceptable, often due to missing a required parameter |
401 | No valid API key provided |
403 | The API key doesn’t have permissions to perform the request |
429 | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests |
500 | Something went wrong on Braintrust's end. (These are rare.) |