SpyBara
Go Premium

Reference 2026-07-20 20:00 UTC to 2026-07-22 20:02 UTC

3 files changed +63 −2. View all changes and history on the product overview
2026
Sat 25 05:59 Thu 23 18:00 Wed 22 20:02 Mon 20 20:00 Fri 17 17:00 Thu 16 20:57 Wed 15 02:58 Tue 14 06:58 Mon 13 15:59 Sun 12 06:58 Fri 10 23:02 Thu 9 20:58 Tue 7 08:02

go/index.md +7 −2

Details

25 25 

26<!-- x-release-please-end -->26<!-- x-release-please-end -->

27 27 

28Or to pin the version:28Or to pin an SDK version (see the Go compatibility note below):

29 29 

30<!-- x-release-please-start-version -->30<!-- x-release-please-start-version -->

31 31 


37 37 

38## Requirements38## Requirements

39 39 

40This library requires Go 1.22+.40SDK v3.45.0 and later require Go 1.25 or later. If your application must

41remain on Go 1.22–1.24, pin SDK v3.44.0, the final compatible release. Older

42SDK releases receive no guaranteed fixes or security backports.

43 

44See the [Go version support policy](GO_VERSION_POLICY.md) for the supported

45release window and upgrade guidance.

41 46 

42## Usage47## Usage

43 48 

java/index.md +29 −0

Details

87ChatCompletion chatCompletion = client.chat().completions().create(params);87ChatCompletion chatCompletion = client.chat().completions().create(params);

88```88```

89 89 

90## Amazon Bedrock

91 

92Use the optional `openai-java-bedrock` artifact to call OpenAI-compatible APIs on Amazon Bedrock

93with normal AWS credentials:

94 

95<!-- x-release-please-start-version -->

96 

97```kotlin

98implementation("com.openai:openai-java-bedrock:4.41.0")

99```

100 

101<!-- x-release-please-end -->

102 

103```java

104import com.openai.client.OpenAIClient;

105import com.openai.client.okhttp.BedrockOpenAIOkHttpClient;

106 

107// Uses the standard AWS credential chain, including environment credentials,

108// ~/.aws/credentials, AWS_PROFILE, workload roles, and instance metadata.

109OpenAIClient client = BedrockOpenAIOkHttpClient.builder()

110 .awsRegion("us-east-1")

111 .build();

112```

113 

114Requests are signed with fresh AWS credentials on every attempt. Existing

115`AWS_BEARER_TOKEN_BEDROCK` bearer credentials remain supported as a compatibility fallback. See

116the [Amazon Bedrock guide](bedrock.md) for named profiles, temporary credentials, custom credential

117providers, async streaming, precedence rules, and security guidance.

118 

90## Client configuration119## Client configuration

91 120 

92Configure the client using system properties or environment variables:121Configure the client using system properties or environment variables:

python/index.md +27 −0

Details

283asyncio.run(main())283asyncio.run(main())

284```284```

285 285 

286### Experimental HTTPX2 support

287 

288To opt in to experimental HTTPX2 support, install the optional extra on Python 3.10 or later:

289 

290```sh

291pip install 'openai[httpx2]'

292```

293 

294```python

295from openai import OpenAI, AsyncOpenAI, DefaultHttpx2Client, DefaultAsyncHttpx2Client

296 

297client = OpenAI(http_client=DefaultHttpx2Client())

298async_client = AsyncOpenAI(http_client=DefaultAsyncHttpx2Client())

299```

300 

301See [`examples/httpx2_client.py`](examples/httpx2_client.py) for a minimal runnable example.

302 

303The module-level client can be configured in the same way:

304 

305```python

306import openai

307 

308openai.http_client = openai.DefaultHttpx2Client()

309```

310 

311Parsed API models are unchanged, but requests, raw and streaming responses, and transport-level exceptions may be HTTPX2 objects at runtime. Code that catches HTTPX exceptions or relies on HTTPX-specific mocks, transports, authentication, hooks, or instrumentation may need to be updated. Transport-facing type annotations may still describe HTTPX.

312 

286## Streaming responses313## Streaming responses

287 314 

288We provide support for streaming responses using Server Side Events (SSE).315We provide support for streaming responses using Server Side Events (SSE).