io.enterpriseai.EnterpriseAIClient
Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/EnterpriseAIClient.java. Back to the Java SDK reference index.
This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.
Class EnterpriseAIClient
Entry point of the Enterprise AI Java SDK.
Resources
Constructor EnterpriseAIClient
EnterpriseAIClient(Transport transport)
Private constructor: the client is created with EnterpriseAIClient.builder().
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
transport | Transport | yes | Transport shared by the sub-clients of one client. |
EnterpriseAIClient.locale
Locale locale()
Message language of the client.
This element takes no parameter.
Returns: Locale. The configured Locale, Locale.ENGLISH by default.
EnterpriseAIClient.transport
Transport transport()
Low level transport, for endpoints called with a raw template.
This element takes no parameter.
Returns: Transport. A Transport: HTTP layer shared by every resource client: authentication and tenancy headers, Accept-Language, W3C traceparent, Idempotency-Key, retries with exponential backoff honoring Retry-After, error envelope mapping and pagination.
Class EnterpriseAIClient.Builder
Client configuration builder.
Builder.apiKey
Builder apiKey(String v)
Tenant API key sent as X-API-Key.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | String | yes | Tenant API key. |
Returns: Builder. A Builder: Fluent builder.
Builder.baseUrl
Builder baseUrl(String v)
Control Plane URL, for example <control-plane-url> (without /v1).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | String | yes | Control Plane URL, https except for localhost; a trailing slash is removed. |
Returns: Builder. A Builder: Fluent builder.
Builder.build
EnterpriseAIClient build()
Builds the client; raises IllegalArgumentException without baseUrl, for a non https URL outside localhost or an httpClient that follows redirects.
This element takes no parameter.
Returns: EnterpriseAIClient. A EnterpriseAIClient: Entry point of the Enterprise AI Java SDK.
Builder.caBundle
Builder caBundle(java.nio.file.Path pem)
PEM file of extra trusted CA certificates; certificate verification stays on.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
pem | java.nio.file.Path | yes | Path of the PEM file added to the default trust store. |
Returns: Builder. A Builder: Fluent builder.
Builder.connectTimeout
Builder connectTimeout(Duration v)
Connection timeout (default 10 s), ignored with a custom httpClient.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | Duration | yes | Maximum duration to open the connection. |
Returns: Builder. A Builder: Fluent builder.
Builder.dangerouslyDisableTlsVerificationForLocalhost
Builder dangerouslyDisableTlsVerificationForLocalhost()
Disables TLS certificate verification. #build() refuses it unless the base URL host is localhost, 127.0.0.1 or ::1.
This element takes no parameter.
Returns: Builder. A Builder: Fluent builder.
Builder.environment
Builder environment(String v)
Environment sent as X-Environment (dev, test, staging, prod).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | String | yes | Environment name, such as prod. |
Returns: Builder. A Builder: Fluent builder.
Builder.header
Builder header(String name, String value)
Extra header sent on every request.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
name | String | yes | Name of the HTTP header. | |
value | String | yes | Value of the header. |
Returns: Builder. A Builder: Fluent builder.
Builder.headerSupplier
Builder headerSupplier(Supplier<Map<String, String>> v)
Headers computed for every request (for example X-Project or X-Environment of the current inbound request); they override the static project and environment.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | Supplier<Map<String, String>> | yes | Supplier called before each request, returning the headers to add. |
Returns: Builder. A Builder: Fluent builder.
Builder.httpClient
Builder httpClient(HttpClient v)
Custom java.net.http.HttpClient (proxy, executor); it must not follow redirects.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | HttpClient | yes | HttpClient built with Redirect.NEVER. |
Returns: Builder. A Builder: Fluent builder.
Builder.locale
Builder locale(Locale v)
Message language: Locale.ENGLISH (default) or Locale.FRENCH; sent as Accept-Language.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | Locale | yes | Message language; null falls back to Locale.ENGLISH. |
Returns: Builder. A Builder: Fluent builder.
Builder.project
Builder project(String v)
Project slug sent as X-Project.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | String | yes | Project slug. |
Returns: Builder. A Builder: Fluent builder.
Builder.retries
Builder retries(int v)
Retries on network errors and HTTP 408/429/502/503/504 (default 2).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | int | yes | Number of retries; a negative value counts as 0. |
Returns: Builder. A Builder: Fluent builder.
Builder.retryBaseDelay
Builder retryBaseDelay(Duration v)
First backoff delay, doubled at each attempt; Retry-After wins when present.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | Duration | yes | First backoff delay (default 250 ms). |
Returns: Builder. A Builder: Fluent builder.
Builder.tenant
Builder tenant(String v)
Tenant slug. The server resolves the tenant from the credential; without credential the slug is sent as X-Dev-Tenant (development mode, EAI_AUTH_DEV=1).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | String | yes | Tenant slug. |
Returns: Builder. A Builder: Fluent builder.
Builder.timeout
Builder timeout(Duration v)
Per request timeout (default 60 s).
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | Duration | yes | Maximum duration of one request. |
Returns: Builder. A Builder: Fluent builder.
Builder.toString
String toString()
Never prints the API key or the token.
This element takes no parameter.
Returns: String. A summary of the configuration with the API key and the token masked.
Builder.token
Builder token(String v)
OIDC access token sent as Authorization: Bearer.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | String | yes | OIDC access token. |
Returns: Builder. A Builder: Fluent builder.
Builder.traceparent
Builder traceparent(Supplier<String> v)
Supplies the W3C traceparent of the current span; a random one is generated otherwise.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
v | Supplier<String> | yes | Supplier of the W3C traceparent of the current span. |
Returns: Builder. A Builder: Fluent builder.