تكامل في سطر واحد مع توقيع SigV4 التلقائي
غيّر رابط baseURL إلى https://gateway.kiyaslabs.tech/v1 لبدء استخدام بوابة الذكاء الاصطناعي متعددة المزودين وجسر AWS Bedrock SigV4 (BYOK). يتولى PromptRelay توجيه طلبات Gemini و Claude و Llama وتوقيع SigV4 التلقائي.
The 1-Line Drop-In Change
Replace your SDK base URL with PromptRelay
baseURL = "https://gateway.kiyaslabs.tech/v1"PromptRelay natively understands all OpenAI, Anthropic, and LangChain endpoints including /chat/completions and /embeddings. No SDK migrations or refactoring necessary.
AWS SigV4 Bridge: Under the Hood
How PromptRelay translates Bearer tokens to AWS Signature Version 4 signatures with sub-millisecond overhead.
HTTP Bearer Interception
Client application issues standard OpenAI or Anthropic SDK call containing Authorization: Bearer kl_beta_... to PromptRelay gateway.
Canonical Request Assembly
ECS Fargate relay parses the HTTP method, URI, headers, and request body hash (SHA256) into a standardized AWS Canonical Request format.
HMAC-SHA256 Volatile Signing
Computes String-to-Sign with AWS Credential Scope (date, region, bedrock service) and generates the AWS SigV4 authorization header in under 0.4ms in volatile RAM.
Amazon Bedrock Ingestion & Teeing
Forwards the cryptographically authenticated SigV4 request to Bedrock; tokens stream back through the stream-teeing engine while vector coordinates are indexed.
Custom Proxy Header Directives
Configure caching sensitivity, fallback targets, and security policies per request via HTTP headers.
| Header Name | Default | Type | Behavior & Description |
|---|---|---|---|
| None (Optional) | String (AIzaSy...) | Google AI Studio API key for direct Google Gemini routing. Enables free-tier upstream inference while using standard OpenAI SDK formats. | |
| 0.85 | Float (0.00 - 1.00) | Cosine similarity threshold for Titan Embeddings v2 vector lookup. Higher values (e.g. 0.92) enforce stricter semantic equivalence; lower values (e.g. 0.75) broaden cache hits. | |
| anthropic.claude-3-haiku | Comma-separated string | Ordered list of Bedrock fallback models. If the primary model returns 429 (Rate Limit) or 503 (Unavailable), PromptRelay instantly retries the fallback model with zero downtime. | |
| true | Boolean | Enables the asynchronous stream-teeing engine. Serves SSE chunks to the caller with sub-millisecond overhead while concurrently assembling and indexing completions in background workers. | |
| true | Boolean | Activates real-time in-memory PII redaction (SSNs, credit card numbers, AWS access keys) before prompts reach upstream Bedrock foundational models. |
أكواد جاهزة للنسخ لجميع الأطر
# Install: pip install openai
from openai import OpenAI
# Simply change the base_url to PromptRelay's gateway
client = OpenAI(
base_url="https://gateway.kiyaslabs.tech/v1",
api_key="kl_live_bedrock_demo" # Your PromptRelay Ephemeral Key
)
# Call Bedrock Claude 3.5 Sonnet using standard OpenAI syntax
completion = client.chat.completions.create(
model="anthropic.claude-3-5-sonnet",
messages=[{"role": "user", "content": "Analyze AWS SigV4 bridge benefits"}],
stream=True,
extra_headers={
"x-promptrelay-cache-threshold": "0.85",
"x-promptrelay-fallback-models": "anthropic.claude-3-haiku,meta.llama3-70b"
}
)
for chunk in completion:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)https://gateway.kiyaslabs.tech/v1Compatible with Python 3.9+, Node.js 18+, Bun, Denoهل تواجه أي استفسار في التكامل؟
Direct Technical Lead Inquiry
Dedicated Routing Channels
Enterprise Sandbox
enterprise@kiyaslabs.techProvisioning for enterprise subscriptions, dedicated VPC relays, and HIPAA BAAs.
Developer Support
support@kiyaslabs.techInquiries regarding the AWS SigV4 translation bridge, OpenAI SDK drop-in, or stream-teeing.
Security Disclosures
security@kiyaslabs.techEncrypted PGP channel for vulnerability reporting, pen-test reports, and compliance reviews.
Operating Entity for PromptRelay™ • Response SLA: Within 1 Business Day