Proxy chat/completions
Proxy a chat/completions request to the specified model, converting its format as needed. Will cache if temperature=0 or seed is set.
Authorization
Authorization
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
application/json
RequiredSee the OpenAI docs for details.
body
Proxy response (supports both streaming and non-streaming formats)
Proxy completions
Proxy a completions request to the specified model, converting its format as needed. Will cache if temperature=0 or seed is set.
Authorization
Authorization
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
application/json
RequiredSee the OpenAI docs for details.
body
Proxy response (supports both streaming and non-streaming formats)
Proxy a model to chat/completions or completions automatically
Proxy a request to either chat/completions or completions automatically based on the model. Will cache if temperature=0 or seed is set.
Authorization
Authorization
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
application/json
RequiredThe chat/completions or completions payload (depending on the model)
body
Proxy response (supports both streaming and non-streaming formats)
Proxy embeddings
Proxy an embeddings request to the specified model, converting its format as needed. Will cache automatically.
Authorization
Authorization
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
application/json
RequiredSee the OpenAI docs for details.
body
Proxy response (supports both streaming and non-streaming formats)
Create temporary credential
Create a temporary credential which can access the proxy for a limited time. The temporary credential will be allowed to make requests on behalf of the Braintrust API key (or model provider API key) provided in the Authorization
header. See docs for code examples.
Authorization
Authorization
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
application/json
RequiredThe temporary credential will be restricted according to the request body.
model
stringGranted model name. Null/undefined to grant usage of all models.
ttl_seconds
numberTTL of the temporary credential. 10 minutes by default.
600
Maximum: 86400
logging
objectIf present, proxy will log requests to the given Braintrust project name.
Successfully created temporary credential
Proxy any OpenAI request (fallback)
Any requests which do not match the above paths will be proxied directly to the OpenAI API.
Authorization
Authorization
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
application/json
RequiredThe request body
body
Path Parameters
path+
The path to proxy
Proxy response (supports both streaming and non-streaming formats)