Proxy Gateway (Python, Go, n8n)
Language-Agnostic Observability
Overview
The AtlasBurn Proxy Gateway is a stateless edge service that sits transparently between your application and the upstream AI provider. You swap one base URL and add one header — every request is then captured by the Forensic Ledger, costed by the Cost Engine, and guarded by the Auto Kill Protocol, in any language or runtime.
Base URLs
| Provider | Replace | With |
|---|---|---|
| OpenAI | https://api.openai.com/v1 | https://proxy.atlasburn.com/openai/v1 |
| Anthropic | https://api.anthropic.com/v1 | https://proxy.atlasburn.com/anthropic/v1 |
| Google Gemini | https://generativelanguage.googleapis.com/v1beta | https://proxy.atlasburn.com/gemini/v1beta |
| OpenRouter | https://openrouter.ai/api/v1 | https://proxy.atlasburn.com/openrouter/v1 |
| Mistral | https://api.mistral.ai/v1 | https://proxy.atlasburn.com/mistral/v1 |
| Cohere | https://api.cohere.com/v1 | https://proxy.atlasburn.com/cohere/v1 |
| Groq | https://api.groq.com/openai/v1 | https://proxy.atlasburn.com/groq/openai/v1 |
| Together AI | https://api.together.xyz/v1 | https://proxy.atlasburn.com/together/v1 |
| DeepSeek | https://api.deepseek.com/v1 | https://proxy.atlasburn.com/deepseek/v1 |
| xAI (Grok) | https://api.x.ai/v1 | https://proxy.atlasburn.com/xai/v1 |
Generate your snippet
Pick your setup for a ready-to-run request through the proxy: a raw HTTP call in any language, the provider's SDK, a framework (LangChain / LlamaIndex / Vercel AI SDK), or a no-code tool (n8n / Make / Zapier). The complete Go streaming example below goes deeper for that specific stack.
curl https://proxy.atlasburn.com/openai/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "AtlasBurn-API-Key: $ATLASBURN_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{
"role": "user",
"content": "Hello from AtlasBurn"
}
]
}'Only two things change from a direct call: the base URL points at proxy.atlasburn.com/… and you add the AtlasBurn-API-Key header. Your provider key is forwarded untouched. Streaming works too — set stream: true and SSE frames pass through.
Proxy base URL for every provider
Keep your provider SDK or HTTP client. Change only the base URL to the value below and add the header AtlasBurn-API-Key: $ATLASBURN_KEY. Your provider key is sent as usual.
| Provider | Base URL | Provider key env var | Example model |
|---|---|---|---|
| OpenAI | https://proxy.atlasburn.com/openai/v1 | OPENAI_API_KEY | gpt-4o-mini |
| Anthropic | https://proxy.atlasburn.com/anthropic | ANTHROPIC_API_KEY | claude-3-5-sonnet-latest |
| Google Gemini | https://proxy.atlasburn.com/gemini/v1beta | GEMINI_API_KEY | gemini-2.5-flash |
| OpenRouter | https://proxy.atlasburn.com/openrouter/v1 | OPENROUTER_API_KEY | openai/gpt-4o-mini |
| Cohere | https://proxy.atlasburn.com/cohere/v1 | COHERE_API_KEY | command-r-plus |
| Mistral | https://proxy.atlasburn.com/mistral/v1 | MISTRAL_API_KEY | mistral-large-latest |
| Groq | https://proxy.atlasburn.com/groq/openai/v1 | GROQ_API_KEY | llama-3.3-70b-versatile |
| Together AI | https://proxy.atlasburn.com/together/v1 | TOGETHER_API_KEY | meta-llama/Llama-3.3-70B-Instruct-Turbo |
| DeepSeek | https://proxy.atlasburn.com/deepseek/v1 | DEEPSEEK_API_KEY | deepseek-chat |
| xAI (Grok) | https://proxy.atlasburn.com/xai/v1 | XAI_API_KEY | grok-2-latest |
For the Anthropic SDK use the base URL without /v1 (the SDK adds it). Raw HTTP calls to Anthropic use https://proxy.atlasburn.com/anthropic/v1/messages.
curl https://proxy.atlasburn.com/openai/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "AtlasBurn-API-Key: $ATLASBURN_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [
{
"role": "user",
"content": "Hello from AtlasBurn"
}
]
}'import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["OPENAI_API_KEY"],
base_url="https://proxy.atlasburn.com/openai/v1",
default_headers={"AtlasBurn-API-Key": os.environ["ATLASBURN_KEY"]},
)
res = client.chat.completions.create(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hello from AtlasBurn"}],
)
print(res.choices[0].message.content)Go Example (streaming)
A complete example that sends a real JSON body, supports streaming Server-Sent Events when stream: true, and otherwise parses the JSON response safely.
package main
import (
"bufio"
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"os"
"strings"
)
const (
proxyURL = "https://proxy.atlasburn.com/openai/v1/chat/completions"
openaiKey = "sk-your-real-openai-key"
atlasKey = "abn_your_atlasburn_key"
useStream = true
)
type ChatRequest struct {
Model string `json:"model"`
Messages []ChatMessage `json:"messages"`
Stream bool `json:"stream"`
}
type ChatMessage struct {
Role string `json:"role"`
Content string `json:"content"`
}
type ChatResponse struct {
Choices []struct {
Message ChatMessage `json:"message"`
} `json:"choices"`
}
func main() {
body, _ := json.Marshal(ChatRequest{
Model: "gpt-4o",
Messages: []ChatMessage{{Role: "user", Content: "Hello from Go"}},
Stream: useStream,
})
req, err := http.NewRequest("POST", proxyURL, bytes.NewBuffer(body))
if err != nil {
fmt.Fprintln(os.Stderr, "request build:", err)
return
}
req.Header.Set("Authorization", "Bearer "+openaiKey)
req.Header.Set("AtlasBurn-API-Key", atlasKey)
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
fmt.Fprintln(os.Stderr, "request:", err)
return
}
defer resp.Body.Close()
if resp.StatusCode >= 400 {
msg, _ := io.ReadAll(resp.Body)
fmt.Fprintf(os.Stderr, "proxy error %d: %s\n", resp.StatusCode, msg)
return
}
// Streaming (SSE) path — provider responds with text/event-stream.
if strings.HasPrefix(resp.Header.Get("Content-Type"), "text/event-stream") {
scanner := bufio.NewScanner(resp.Body)
for scanner.Scan() {
line := scanner.Text()
if !strings.HasPrefix(line, "data: ") {
continue
}
payload := strings.TrimPrefix(line, "data: ")
if payload == "[DONE]" {
break
}
var chunk struct {
Choices []struct {
Delta struct {
Content string `json:"content"`
} `json:"delta"`
} `json:"choices"`
}
if err := json.Unmarshal([]byte(payload), &chunk); err != nil {
continue // skip malformed frame
}
if len(chunk.Choices) > 0 {
fmt.Print(chunk.Choices[0].Delta.Content)
}
}
fmt.Println()
return
}
// Non-streaming JSON path.
var parsed ChatResponse
if err := json.NewDecoder(resp.Body).Decode(&parsed); err != nil {
fmt.Fprintln(os.Stderr, "decode:", err)
return
}
if len(parsed.Choices) == 0 {
fmt.Println("(empty response)")
return
}
fmt.Println(parsed.Choices[0].Message.Content)
}Security Guarantee
When to Use Proxy vs SDK
- Use the Proxy Gateway for Python, Go, Rust, Ruby, .NET, n8n, Make, Zapier, LangChain (Python), or any non-JS runtime.
- Use the JavaScript SDK for Node.js, Next.js, Vercel Edge, or browser apps where auto-detection of
globalThis.fetchis preferred.
Next Steps
- Proxy Gateway Troubleshooting — 401/403, unsupported endpoints, model routing
- Cost Engine — how spend is calculated
- Security — full security architecture
- Troubleshooting — common issues