SECURE-ALL API

Universal AI & Financial Data Gateway

https://secure-all.replit.app

🚀 Quick Start

WICHTIG: Alle /api/* Endpoints benötigen KEINE Authentifizierung. Nur /vault/* Endpoints benötigen den X-Vault-Key Header!
POST /api/chat No Auth

Universal Chat Endpoint - unterstützt OpenAI & Mistral Modelle

fetch("https://secure-all.replit.app/api/chat", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    messages: [
      { role: "system", content: "Du bist ein hilfreicher Assistent." },
      { role: "user", content: "Hallo!" }
    ],
    model: "gpt-4o-mini",
    temperature: 0.7,
    max_tokens: 4000
  })
}).then(res => res.json())

Supported Models:

gpt-4o-mini
gpt-3.5-turbo
gpt-4
mistral-small
mistral-large
codestral-latest
POST /api/speech No Auth

Text-to-Speech - Konvertiert Text zu Audio (OpenAI TTS)

fetch("https://secure-all.replit.app/api/speech", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    input: "Hallo, das ist ein Test!",
    model: "tts-1",
    voice: "alloy"
  })
}).then(res => res.blob())
  .then(blob => {
    const audio = new Audio(URL.createObjectURL(blob));
    audio.play();
  })

Voices:

alloy
echo
fable
onyx
nova
shimmer

🔌 API Endpoints

Alle Endpoints benötigen KEINE Authentifizierung. Rate Limit: 50 requests / 15 min

POST /api/chat No Auth

Universal Chat - OpenAI & Mistral Auto-Detection

Parameter Type Required Description
messages array REQUIRED Array von Message-Objekten [{role, content}]
model string REQUIRED gpt-4o-mini, gpt-4, mistral-small, etc.
temperature float Optional 0.0 - 2.0 (default: 0.7)
max_tokens integer Optional Max tokens (default: 4000)
stream boolean Optional Streaming (default: false)

Response Format:

{
  "choices": [{
    "message": {
      "role": "assistant",
      "content": "Response text..."
    }
  }],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 50,
    "total_tokens": 60
  }
}
POST /api/vision No Auth

Vision Analysis - Bild-Analyse mit GPT-4o-mini/GPT-4o

fetch("https://secure-all.replit.app/api/vision", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    messages: [{
      role: "user",
      content: [
        { type: "text", text: "Was ist auf dem Bild?" },
        { 
          type: "image_url", 
          image_url: { url: "https://example.com/bild.jpg" }
        }
      ]
    }],
    model: "gpt-4o-mini",
    max_tokens: 1000,
    detail: "high"
  })
})
Parameter Type Description
messages array Messages mit text + image_url content
model string gpt-4o-mini, gpt-4o, gpt-4-turbo, gpt-4-vision-preview
detail string "low", "high", "auto" (default: "high")
max_tokens integer Max tokens (default: 1000)
POST /api/speech No Auth

Text-to-Speech - OpenAI TTS (max 4096 Zeichen)

Parameter Type Description
input string Text (max 4096 Zeichen)
model string "tts-1" oder "tts-1-hd"
voice string alloy, echo, fable, onyx, nova, shimmer
response_format string mp3, opus, aac, flac (default: mp3)
speed float 0.25 - 4.0 (default: 1.0)
Response ist ein AUDIO-STREAM (kein JSON!) - direkt als Blob verarbeiten
POST /api/image No Auth

Image Generation - DALL-E 3

fetch("https://secure-all.replit.app/api/image", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    prompt: "Ein futuristischer Roboter in einer Cyberpunk-Stadt",
    size: "1024x1024",
    quality: "standard",
    style: "vivid"
  })
}).then(res => res.json())
Parameter Options
size 1024x1024, 1792x1024, 1024x1792
quality "standard" oder "hd"
style "vivid" oder "natural"
POST /api/perplexity No Auth

Perplexity Search - Web-Search mit KI

fetch("https://secure-all.replit.app/api/perplexity", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    messages: [
      { role: "user", content: "Neueste Entwicklungen bei KI?" }
    ],
    model: "sonar",
    temperature: 0.2,
    max_tokens: 1000
  })
})

Models:

sonar
sonar-small
sonar-medium
sonar-large
llama-3.1-sonar-small-128k-online
llama-3.1-sonar-large-128k-online
GET /api/eod No Auth

EOD Financial Data - Börsendaten (Real-time, Historical, Intraday)

// Real-time Daten
fetch("https://secure-all.replit.app/api/eod?symbol=AAPL.US&endpoint=real-time")

// Historical Daten
fetch("https://secure-all.replit.app/api/eod?symbol=AAPL.US&endpoint=historical&from=2024-01-01&to=2024-12-31")

// Intraday Daten
fetch("https://secure-all.replit.app/api/eod?symbol=AAPL.US&endpoint=intraday")
Parameter Options
symbol AAPL.US, BTC-USD, etc. (REQUIRED)
endpoint real-time, historical, intraday, fundamentals
period d, w, m (für historical)
from / to YYYY-MM-DD (optional für historical/intraday)
fmt json, csv (default: json)
POST /api/gemini No Auth

Gemini AI - Google Gemini Chat

fetch("https://secure-all.replit.app/api/gemini", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    messages: [
      { role: "user", content: "Hallo Gemini!" }
    ],
    model: "gemini-2.0-flash-exp",
    temperature: 0.7,
    maxTokens: 1000
  })
})
Parameter Description
messages OpenAI-Style Messages (wird automatisch konvertiert)
model gemini-2.0-flash-exp (default)
temperature 0.0 - 2.0 (default: 0.7)
maxTokens Max tokens (default: 1000)
GET /api/models No Auth

List Models - Alle verfügbaren Models auflisten

fetch("https://secure-all.replit.app/api/models")
  .then(res => res.json())
  .then(data => console.log(data.available_models))

🔐 Vault Endpoints

Alle Vault-Endpoints benötigen Authentifizierung! Rate Limit: 200 requests / 15 min

Auth: Header: X-Vault-Key: your_vault_key oder Query: ?key=your_vault_key
fetch("https://secure-all.replit.app/vault/mistral", {
  headers: { "X-Vault-Key": "your_vault_api_key" }
}).then(res => res.json())
GET /vault/status Auth Required

Vault Status - Zeigt welche API-Keys konfiguriert sind

GET /vault/mistral Auth Required

Mistral API Key

GET /vault/anthropic Auth Required

Anthropic (Claude) API Key

GET /vault/perplexity Auth Required

Perplexity API Key

GET /vault/eod Auth Required

EOD Financial API Key

GET /vault/stripe Auth Required

Stripe API Keys (secret + publishable)

GET /vault/gemini Auth Required

Gemini API Key

GET /vault/all Auth Required

Alle Keys - Gibt ALLE konfigurierten API-Keys zurück

🧠 Verfügbare Models

OpenAI Models

Chat Models

gpt-4o-mini
gpt-3.5-turbo
gpt-4
gpt-4-turbo

Vision Models

gpt-4o-mini
gpt-4o
gpt-4-turbo
gpt-4-vision-preview

Mistral Models

mistral-small
mistral-large
mistral-medium
mistral-7b-instruct
codestral-latest

Perplexity Models

sonar
sonar-small
sonar-medium
sonar-large
llama-3.1-sonar-small-128k-online
llama-3.1-sonar-large-128k-online
llama-3.1-sonar-huge-128k-online

Gemini Models

gemini-2.0-flash-exp

⚠️ Error Handling

Standard Error Response

{
  "error": "Fehlerbeschreibung",
  "timestamp": "2025-10-11T12:34:56.789Z"
}
WICHTIG: Server gibt { error: "..." } zurück - NICHT .error.message!

HTTP Status Codes

Code Bedeutung Lösung
400 Bad Request Fehlende/falsche Parameter prüfen
401 Unauthorized Vault: X-Vault-Key Header fehlt oder falsch
404 Not Found Service nicht konfiguriert (API-Key fehlt)
429 Too Many Requests Rate Limit erreicht - warten
500 Internal Server Error Server-Fehler - später probieren
503 Service Unavailable API-Key nicht konfiguriert

Rate Limits

Endpoint Type Limit Zeitfenster
/api/* 50 requests 15 Minuten
/vault/* 200 requests 15 Minuten

🤖 Regeln für KI-Bots

MUST DO

  • IMMER https://secure-all.replit.app verwenden - NIE andere URLs!
  • Keine Auth für /api/* Endpoints - nur für /vault/*
  • Model Auto-Detect: gpt-* = OpenAI, mistral-* = Mistral
  • Error Format: Server gibt { error: "..." } zurück (NICHT .error.message!)
  • TTS Response: Ist ein STREAM (kein JSON) - direkt als Blob verarbeiten
  • Vision Images: Base64 oder URL - beide funktionieren
  • Rate Limits beachten: 50 req/15min für API, 200 req/15min für Vault

DON'T DO

  • NIEMALS andere Server-URLs verwenden (theserver-open-ai, etc.)
  • KEINE Auth-Header bei /api/* senden
  • NICHT .error.message verwenden (nur .error)
  • KEINE TTS-Response als JSON parsen (ist ein Stream!)

Copy-Paste Ready Examples

Chat mit Function Calling:

const response = await fetch("https://secure-all.replit.app/api/chat", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    messages: [{ role: "user", content: "Hallo!" }],
    model: "gpt-4o-mini",
    tools: [{ type: "function", function: { name: "get_weather", ... } }],
    tool_choice: "auto"
  })
});
const data = await response.json();
const text = data.choices[0].message.content;

TTS Audio abspielen:

const response = await fetch("https://secure-all.replit.app/api/speech", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    input: "Hallo Welt!",
    voice: "alloy",
    model: "tts-1"
  })
});
const blob = await response.blob();
const audio = new Audio(URL.createObjectURL(blob));
audio.play();

Vision: Bild analysieren:

const response = await fetch("https://secure-all.replit.app/api/vision", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    messages: [{
      role: "user",
      content: [
        { type: "text", text: "Was ist auf dem Bild?" },
        { type: "image_url", image_url: { url: "https://example.com/bild.jpg" } }
      ]
    }],
    model: "gpt-4o-mini"
  })
});
const data = await response.json();
const analysis = data.response;