🔀 Spin up your own custom OpenAI API server endpoint for easy AWS Bedrock inference
2.8K
Bedrock Proxy Endpoint is an OpenAI‑compatible API server that proxies chat completions to AWS Bedrock. Keep your app platform‑agnostic and still use the OpenAI client/SDKs while running on Bedrock under the hood. Works with Invoke or the unified Converse API, supports streaming, stop sequences, and vision, and can run over HTTP or HTTPS with simple env‑based config.
Quick start
# Pull and run
docker pull jparkerweb/bedrock-proxy-endpoint:latest
docker run -d \
--name bedrock-proxy-endpoint \
-p 88:88 \
-e HTTP_ENABLED=true \
-e HTTP_PORT=88 \
-e CONSOLE_LOGGING=true \
jparkerweb/bedrock-proxy-endpoint:latest
Docker Compose
version: '3.8'
services:
bedrock-proxy-endpoint:
image: jparkerweb/bedrock-proxy-endpoint:latest
ports:
- "88:88"
environment:
- HTTP_ENABLED=true
- HTTP_PORT=88
- CONSOLE_LOGGING=true
- IP_RATE_LIMIT_ENABLED=true
restart: unless-stopped
healthcheck:
test: ["CMD", "node", "-e", "const http = require('http'); const req = http.request({host: 'localhost', port: process.env.HTTP_PORT || 88, timeout: 2000}, (res) => process.exit(res.statusCode === 200 ? 0 : 1)); req.on('error', () => process.exit(1)); req.end();"]
interval: 30s
timeout: 10s
retries: 3
Then run with: docker-compose up -d
All configuration is done via environment variables. Here are all available options:
| Variable | Type | Default | Description |
|---|---|---|---|
CONSOLE_LOGGING | boolean | false | Show realtime logs in console |
HTTP_ENABLED | boolean | true | Start HTTP server |
HTTP_PORT | integer | 88 | HTTP server port (default 88) |
MAX_REQUEST_BODY_SIZE | string | 50mb | Maximum size for request body |
HTTPS_ENABLED | boolean | false | Start HTTPS server |
HTTPS_PORT | integer | 443 | HTTPS server port |
HTTPS_KEY_PATH | string | - | Path to key file for HTTPS |
HTTPS_CERT_PATH | string | - | Path to cert file for HTTPS |
IP_RATE_LIMIT_ENABLED | boolean | true | Enable rate limiting by IP |
IP_RATE_LIMIT_WINDOW_MS | integer | 60000 | Rate limit window in milliseconds |
IP_RATE_LIMIT_MAX_REQUESTS | integer | 100 | Max requests per IP per window |
Note on Port 88: This project defaults to port 88 instead of the typical 80/3000 to avoid conflicts with other services. You can change this by setting HTTP_PORT to your preferred port and updating the Docker port mapping accordingly.
baseURL, apiKey), no Bedrock SDK refactors.POST /v1/chat/completionsGET /modelsstop or stop_sequencesinclude_thinking_data for thinking models (e.g., Claude 3.7 Sonnet Thinking)use_converse_api=true|falseapiKey formatted as: ${AWS_REGION}.${AWS_ACCESS_KEY_ID}.${AWS_SECRET_ACCESS_KEY}us-west-2.AKIA....XXXXXXXX.YYYYYYYYYYYYYYYYYYYYimport OpenAI from "openai";
const openai = new OpenAI({
baseURL: "http://localhost", // your container endpoint
apiKey: `${AWS_REGION}.${AWS_ACCESS_KEY_ID}.${AWS_SECRET_ACCESS_KEY}`,
});
const stream = await openai.chat.completions.create({
model: "Claude-4-Sonnet",
messages: [
{ role: "system", content: "You are a precise assistant." },
{ role: "user", content: "Explain OpenAI API benefits in five sentences." },
],
stream: true,
include_thinking_data: false, // set true for thinking models
use_converse_api: false, // set true to use Bedrock Converse API
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content || "");
}
/ – info page/models – supported Bedrock models/v1/chat/completions – OpenAI‑compatible chat completions/models endpoint and Bedrock Wrapper docs list supported model IDs.Content type
Image
Digest
sha256:f79a130df…
Size
64.3 MB
Last updated
6 months ago
docker pull jparkerweb/bedrock-proxy-endpoint