Proxy Gateway (Python, Go, n8n)

Language-Agnostic Observability

If you are building with Python, Go, Rust, or no-code tools like n8n and Zapier, you do not need to install an SDK. Route your requests through the AtlasBurn Proxy Gateway instead — it securely intercepts your AI calls, logs the telemetry, and forwards the response back to you with zero latency overhead.

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

ProviderReplaceWith
OpenAIhttps://api.openai.com/v1https://proxy.atlasburn.com/openai/v1
Anthropichttps://api.anthropic.com/v1https://proxy.atlasburn.com/anthropic/v1
Google Geminihttps://generativelanguage.googleapis.com/v1betahttps://proxy.atlasburn.com/gemini/v1beta
OpenRouterhttps://openrouter.ai/api/v1https://proxy.atlasburn.com/openrouter/v1
Mistralhttps://api.mistral.ai/v1https://proxy.atlasburn.com/mistral/v1
Coherehttps://api.cohere.com/v1https://proxy.atlasburn.com/cohere/v1
Groqhttps://api.groq.com/openai/v1https://proxy.atlasburn.com/groq/openai/v1
Together AIhttps://api.together.xyz/v1https://proxy.atlasburn.com/together/v1
DeepSeekhttps://api.deepseek.com/v1https://proxy.atlasburn.com/deepseek/v1
xAI (Grok)https://api.x.ai/v1https://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.

Provider
Language
OpenAI · cURL
bash
curl https://proxy.atlasburn.com/openai/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "AtlasBurn-API-Key: $ATLASBURN_API_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.

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.

main.go
go
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

The AtlasBurn Proxy is a stateless edge gateway. It never logs, stores, or caches your provider API keys. Keys are securely forwarded in memory to the upstream provider and immediately discarded after the request completes. Only token counts, cost estimates, and metadata are persisted — never prompts, completions, or credentials.

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.fetch is preferred.

Next Steps