@@ -53,7 +53,8 @@ import com.braintrustdata.api.client.okhttp.BraintrustOkHttpClient;
5353import com.braintrustdata.api.models.Project ;
5454import com.braintrustdata.api.models.ProjectCreateParams ;
5555
56- // Configures using the `BRAINTRUST_API_KEY` and `BRAINTRUST_BASE_URL` environment variables
56+ // Configures using the `braintrust.apiKey` and `braintrust.baseUrl` system properties
57+ // Or configures using the `BRAINTRUST_API_KEY` and `BRAINTRUST_BASE_URL` environment variables
5758BraintrustClient client = BraintrustOkHttpClient . fromEnv();
5859
5960ProjectCreateParams params = ProjectCreateParams . builder()
@@ -64,13 +65,14 @@ Project project = client.projects().create(params);
6465
6566## Client configuration
6667
67- Configure the client using environment variables:
68+ Configure the client using system properties or environment variables:
6869
6970``` java
7071import com.braintrustdata.api.client.BraintrustClient ;
7172import com.braintrustdata.api.client.okhttp.BraintrustOkHttpClient ;
7273
73- // Configures using the `BRAINTRUST_API_KEY` and `BRAINTRUST_BASE_URL` environment variables
74+ // Configures using the `braintrust.apiKey` and `braintrust.baseUrl` system properties
75+ // Or configures using the `BRAINTRUST_API_KEY` and `BRAINTRUST_BASE_URL` environment variables
7476BraintrustClient client = BraintrustOkHttpClient . fromEnv();
7577```
7678
@@ -92,18 +94,21 @@ import com.braintrustdata.api.client.BraintrustClient;
9294import com.braintrustdata.api.client.okhttp.BraintrustOkHttpClient ;
9395
9496BraintrustClient client = BraintrustOkHttpClient . builder()
95- // Configures using the `BRAINTRUST_API_KEY` and `BRAINTRUST_BASE_URL` environment variables
97+ // Configures using the `braintrust.apiKey` and `braintrust.baseUrl` system properties
98+ Or configures using the `BRAINTRUST_API_KEY ` and `BRAINTRUST_BASE_URL ` environment variables
9699 .fromEnv()
97100 .apiKey(" My API Key" )
98101 .build();
99102```
100103
101104See this table for the available options:
102105
103- | Setter | Environment variable | Required | Default value |
104- | --------- | --------------------- | -------- | ------------------------------ |
105- | ` apiKey ` | ` BRAINTRUST_API_KEY ` | false | - |
106- | ` baseUrl ` | ` BRAINTRUST_BASE_URL ` | true | ` "https://api.braintrust.dev" ` |
106+ | Setter | System property | Environment variable | Required | Default value |
107+ | --------- | -------------------- | --------------------- | -------- | ------------------------------ |
108+ | ` apiKey ` | ` braintrust.apiKey ` | ` BRAINTRUST_API_KEY ` | false | - |
109+ | ` baseUrl ` | ` braintrust.baseUrl ` | ` BRAINTRUST_BASE_URL ` | true | ` "https://api.braintrust.dev" ` |
110+
111+ System properties take precedence over environment variables.
107112
108113> [ !TIP]
109114> Don't create more than one client in the same application. Each client has a connection pool and
@@ -149,7 +154,8 @@ import com.braintrustdata.api.models.Project;
149154import com.braintrustdata.api.models.ProjectCreateParams ;
150155import java.util.concurrent.CompletableFuture ;
151156
152- // Configures using the `BRAINTRUST_API_KEY` and `BRAINTRUST_BASE_URL` environment variables
157+ // Configures using the `braintrust.apiKey` and `braintrust.baseUrl` system properties
158+ // Or configures using the `BRAINTRUST_API_KEY` and `BRAINTRUST_BASE_URL` environment variables
153159BraintrustClient client = BraintrustOkHttpClient . fromEnv();
154160
155161ProjectCreateParams params = ProjectCreateParams . builder()
@@ -167,7 +173,8 @@ import com.braintrustdata.api.models.Project;
167173import com.braintrustdata.api.models.ProjectCreateParams ;
168174import java.util.concurrent.CompletableFuture ;
169175
170- // Configures using the `BRAINTRUST_API_KEY` and `BRAINTRUST_BASE_URL` environment variables
176+ // Configures using the `braintrust.apiKey` and `braintrust.baseUrl` system properties
177+ // Or configures using the `BRAINTRUST_API_KEY` and `BRAINTRUST_BASE_URL` environment variables
171178BraintrustClientAsync client = BraintrustOkHttpClientAsync . fromEnv();
172179
173180ProjectCreateParams params = ProjectCreateParams . builder()
0 commit comments