Reference/API/Proxy
POST
/v1/proxy/chat/completions

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.

/v1/proxy/chat/completions

The Authorization access token

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
null

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

POST
/v1/proxy/completions

Proxy completions

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

/v1/proxy/completions

The Authorization access token

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
null

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

POST
/v1/proxy/auto

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.

/v1/proxy/auto

The Authorization access token

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
null

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

POST
/v1/proxy/embeddings

Proxy embeddings

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

/v1/proxy/embeddings

The Authorization access token

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
null

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

POST
/v1/proxy/credentials

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.

/v1/proxy/credentials

The Authorization access token

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 | null

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 | null

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"
}

POST
/v1/proxy/{path+}

Proxy any OpenAI request (fallback)

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

/v1/proxy/{path+}

The Authorization access token

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
null

Path Parameters

path+
Required
array<string>

The path to proxy

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

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

null

On this page