Reference/API/Proxy

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.

POST /v1/proxy/chat/completions

Authorization

Authorization
Required
Bearer <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

application/jsonRequired

See the OpenAI docs for details.

body
Required
unknown
curl -X POST "https://api.braintrust.dev/v1/proxy/chat/completions" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d 'null'

Proxy response (supports both streaming and non-streaming formats)

null

Proxy completions

Proxy a completions request to the specified model, converting its format as needed. Will cache if temperature=0 or seed is set.

POST /v1/proxy/completions

Authorization

Authorization
Required
Bearer <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

application/jsonRequired

See the OpenAI docs for details.

body
Required
unknown
curl -X POST "https://api.braintrust.dev/v1/proxy/completions" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d 'null'

Proxy response (supports both streaming and non-streaming formats)

null

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.

POST /v1/proxy/auto

Authorization

Authorization
Required
Bearer <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

application/jsonRequired

The chat/completions or completions payload (depending on the model)

body
Required
unknown
curl -X POST "https://api.braintrust.dev/v1/proxy/auto" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d 'null'

Proxy response (supports both streaming and non-streaming formats)

null

Proxy embeddings

Proxy an embeddings request to the specified model, converting its format as needed. Will cache automatically.

POST /v1/proxy/embeddings

Authorization

Authorization
Required
Bearer <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

application/jsonRequired

See the OpenAI docs for details.

body
Required
unknown
curl -X POST "https://api.braintrust.dev/v1/proxy/embeddings" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d 'null'

Proxy response (supports both streaming and non-streaming formats)

null

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.

POST /v1/proxy/credentials

Authorization

Authorization
Required
Bearer <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

application/jsonRequired

The temporary credential will be restricted according to the request body.

modelstring

Granted model name. Null/undefined to grant usage of all models.

ttl_secondsnumber

TTL of the temporary credential. 10 minutes by default.

Default: 600Maximum: 86400
loggingobject

If present, proxy will log requests to the given Braintrust project name.

curl -X POST "https://api.braintrust.dev/v1/proxy/credentials" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "string",
    "ttl_seconds": 600,
    "logging": {
      "project_name": "string",
      "compress_audio": true
    }
  }'

Successfully created temporary credential

{
  "key": "string"
}

Proxy any OpenAI request (fallback)

Any requests which do not match the above paths will be proxied directly to the OpenAI API.

POST /v1/proxy/{path+}

Authorization

Authorization
Required
Bearer <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

application/jsonRequired

The request body

body
Required
unknown

Path Parameters

path+
Required
array<string>

The path to proxy

curl -X POST "https://api.braintrust.dev/v1/proxy/string" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d 'null'

Proxy response (supports both streaming and non-streaming formats)

null

On this page