Skip to main content

io.enterpriseai.EnterpriseAIClient

Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/EnterpriseAIClient.java. Back to the Java SDK reference index.

note

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().

NameTypeDefaultRequiredDescription
transportTransportyesTransport 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.

NameTypeDefaultRequiredDescription
vStringyesTenant API key.

Returns: Builder. A Builder: Fluent builder.

Builder.baseUrl​

Builder baseUrl(String v)

Control Plane URL, for example <control-plane-url> (without /v1).

NameTypeDefaultRequiredDescription
vStringyesControl 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.

NameTypeDefaultRequiredDescription
pemjava.nio.file.PathyesPath 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.

NameTypeDefaultRequiredDescription
vDurationyesMaximum 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).

NameTypeDefaultRequiredDescription
vStringyesEnvironment name, such as prod.

Returns: Builder. A Builder: Fluent builder.

Builder.header​

Builder header(String name, String value)

Extra header sent on every request.

NameTypeDefaultRequiredDescription
nameStringyesName of the HTTP header.
valueStringyesValue 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.

NameTypeDefaultRequiredDescription
vSupplier<Map<String, String>>yesSupplier 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.

NameTypeDefaultRequiredDescription
vHttpClientyesHttpClient 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.

NameTypeDefaultRequiredDescription
vLocaleyesMessage 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.

NameTypeDefaultRequiredDescription
vStringyesProject 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).

NameTypeDefaultRequiredDescription
vintyesNumber 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.

NameTypeDefaultRequiredDescription
vDurationyesFirst 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).

NameTypeDefaultRequiredDescription
vStringyesTenant slug.

Returns: Builder. A Builder: Fluent builder.

Builder.timeout​

Builder timeout(Duration v)

Per request timeout (default 60 s).

NameTypeDefaultRequiredDescription
vDurationyesMaximum 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.

NameTypeDefaultRequiredDescription
vStringyesOIDC 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.

NameTypeDefaultRequiredDescription
vSupplier<String>yesSupplier of the W3C traceparent of the current span.

Returns: Builder. A Builder: Fluent builder.