Use AWS Bedrock & AI Services (Claude, Nova, Polly, Transcribe) with Your Existing OpenAI Code
Jenkins
Source: Dev.to | Dec 19, 2025 (UTC)
TL;DR
Use your existing OpenAI-compatible tools (OpenWebUI, n8n, Cline, Cursor) with AWS Bedrock’s 80+ models and AWS AI services (Polly, Transcribe). Just change the endpoint – no code changes needed. Deploy to your AWS account in 15 minutes with Terraform. Data stays in your AWS environment for HIPAA/GDPR compliance.
The Solution in 30 Seconds
from openai import OpenAI # Just change this line ↓ client = OpenAI(base_url="https://your-aws-api/v1", api_key="your-key") # Everything else stays the same ↓ response = client.chat.completions.create( model="anthropic.claude-sonnet-4-5-20250929-v1:0", # Claude 4.5 on Bedrock messages=[{"role": "user", "content": "Hello from AWS!"}] )
Enter fullscreen mode
Exit fullscreen mode
What this enables:
Use OpenWebUI, n8n, Cline, Cursor with AWS Bedrock and AWS AI services
Access Claude 4.5, Nova, Qwen, DeepSeek, Mistral, Cohere, and 75+ more models
Keep all data in your AWS account (HIPAA, GDPR, FedRAMP ready)
Multi-region model access from a single endpoint
The Problem We Solved
Most modern AI tools are built for OpenAI’s API, but AWS Bedrock uses a completely different SDK. This forces you to choose between using familiar tools or switching to AWS for compliance/cost reasons and rewriting everything.
We ran into this while working with a customer who needed:
Compliance: All data in their AWS account (GDPR requirements)
Multi-region access: Different Bedrock models available in different AWS regions
Standard tooling: OpenWebUI, n8n, IDE coding agents (Cline, Cursor)
Full AWS AI stack: Bedrock models plus Polly (TTS) and Transcribe (STT)
Our Approach: An OpenAI-Compatible Translation Layer
stdapi.ai is an API gateway that sits in your AWS account and translates OpenAI API calls to AWS services.
Key Features
OpenAI API Compatibility
Your existing code works without modifications:
from openai import OpenAI client = OpenAI( base_url="https://your-deployment.example.com/v1", api_key="your-api-key" ) # Chat completions response = client.chat.completions.create( model="amazon.nova-pro-v1:0", messages=[{"role": "user", "content": "Explain AWS Lambda"}] ) # Text-to-speech with Polly response = client.audio.speech.create( model="amazon.polly-neural", input="Welcome to the future of voice technology!" ) # Speech-to-text with Transcribe with open("meeting-recording.mp3", "rb") as audio_file: transcription = client.audio.transcriptions.create( model="amazon.transcribe", file=audio_file, response_format="json" ) # Image generation with Bedrock response = client.images.generate( model="stability.stable-image-ultra-v1:0", prompt="A serene mountain landscape at sunset" ) # Embeddings with Bedrock response = client.embeddings.create( model="cohere.embed-v4", input="Semantic search transforms how we find information" )
Enter fullscreen mode
Exit fullscreen mode
Multi-Region Access
Access models across multiple AWS Bedrock regions from a single endpoint. Different models are available in different regions. You can configure which regions to include based on your requirements. AWS Bedrock inference profiles handle automatic routing when needed.
Multi-Modal Capabilities
Process text, images, videos, and documents together in a single request. Supports HTTP URLs, S3 URLs (for direct access to your data), and base64 data URIs. Perfect for vision tasks, document analysis, and RAG applications.
Deployment
Deploy to your AWS account in 5-15 minutes using Terraform.
Залишити відповідь