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
AuthorizationMost 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/jsonRequiredSee the OpenAI docs for details.
bodyProxy 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
AuthorizationMost 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/jsonRequiredSee the OpenAI docs for details.
bodyProxy 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
AuthorizationMost 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/jsonRequiredThe chat/completions or completions payload (depending on the model)
bodyProxy 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
AuthorizationMost 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/jsonRequiredSee the OpenAI docs for details.
bodyProxy 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
AuthorizationMost 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/jsonRequiredThe temporary credential will be restricted according to the request body.
modelstringGranted model name. Null/undefined to grant usage of all models.
ttl_secondsnumberTTL of the temporary credential. 10 minutes by default.
600Maximum: 86400loggingobjectIf 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
AuthorizationMost 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/jsonRequiredThe request body
bodyPath Parameters
path+The path to proxy
Proxy response (supports both streaming and non-streaming formats)