OpenAI-kompatibler Proxy mit konfigurierbarem per-Key-Fallback über verschiedene Anbieter.
QNP ist ein OpenAI-kompatibles API-Gateway. Richten Sie jedes OpenAI-SDK auf unsere Basis-URL aus und Ihr bestehender Code wird über Anthropic, OpenAI, Google, Mistral, Groq und mehr geroutet – mit automatischem Fallback.
Produktions-Base-URL: {url}
Für Chat lösen sich Modellnamen qnp oder qnp/auto in das erste Modell Ihrer Fallback-Kette auf. Andernfalls verwendet QNP einen intent-basierten Standard. Ihre Fallback-Reihenfolge bleibt weiterhin gültig.
Registrieren Sie sich unter qnp.ai/login mit Google, Apple, Passkey oder E-Mail-Magic-Link. Sie erhalten eine kostenlose Stufe mit 50 Anfragen pro Tag.
Gehen Sie zu Dashboard → API-Schlüssel und erstellen Sie einen neuen Schlüssel. Konfigurieren Sie Ihre Provider-Kette. Kopieren Sie den Schlüssel – er beginnt mit qnp- und wird nur einmal angezeigt.
Verwenden Sie ein beliebiges OpenAI-kompatibles SDK oder cURL. Ändern Sie einfach die Basis-URL und den API-Schlüssel (siehe unten).
Zeigen Sie Anfragelogs, Kosten und Latenz auf der Seite Dashboard → Logs an. Exportieren Sie Daten als CSV zur Analyse.
curl -X POST "https://qnp.ai/api/v1/chat/completions" \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-4o-mini","messages":[{"role":"user","content":"Hello!"}]}'All API requests require authentication via your QNP key. Two header formats are supported:
Authorization: Bearer YOUR_KEY # or X-API-Key: YOUR_KEY
Pro API-Schlüssel definieren Sie eine Anbieterkette. QNP versucht diese der Reihe nach, bis einer eine erfolgreiche Antwort zurückgibt.
Example: OpenAI (primary) → Anthropic (fallback 1) → Groq (fallback 2). If OpenAI 5xx's, traffic flows to Anthropic.
Configure fallback in the dashboard under Keys → [your key] → Routing.
Ohne konfigurierte Fallback-Option verwendet der Schlüssel Plattform-Guthaben – abgerechnet über Ihr Konto.
OpenAI-compatible chat endpoint. Supports streaming, function calling, and vision inputs.
curl -X POST "https://qnp.ai/api/v1/chat/completions" \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-4o-mini","messages":[{"role":"user","content":"Hello!"}]}'from openai import OpenAI
client = OpenAI(
base_url="https://qnp.ai/api/v1",
api_key="YOUR_KEY"
)
response = client.chat.completions.create(
model="openai/gpt-4o-mini", # routes to your fallback chain
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://qnp.ai/api/v1",
apiKey: "YOUR_KEY",
});
const response = await client.chat.completions.create({
model: "openai/gpt-4o-mini", // routes to your fallback chain
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);Create vector embeddings for text — useful for search, clustering, and RAG.
curl -X POST "https://qnp.ai/api/v1/embeddings" \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"text-embedding-3-small","input":"The quick brown fox"}'response = client.embeddings.create(
model="text-embedding-3-small",
input="The quick brown fox"
)
print(response.data[0].embedding[:5])Generieren Sie Bilder über DALL-E und andere Bildmodelle.
Liste der für Ihren API-Schlüssel verfügbaren Modelle.
curl "https://qnp.ai/api/v1/models" \ -H "Authorization: Bearer YOUR_KEY"
QNP unterstützt Server-Sent Events (SSE) Streaming für Chat-Completions. Setzen Sie "stream": true in Ihren Anfrage-Body. Die Antwort ist ein Stream von data:-Ereignissen im OpenAI-Format.
Jedes SSE-Ereignis enthält einen JSON-Chunk mit Delta-Inhalt. Der Stream endet mit data: [DONE].
curl -X POST "https://qnp.ai/api/v1/chat/completions" \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"openai/gpt-4o-mini","stream":true,"messages":[{"role":"user","content":"Hello!"}]}'stream = client.chat.completions.create(
model="openai/gpt-4o-mini",
messages=[{"role": "user", "content": "Tell me a story"}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")Lade den Live-Modellkatalog…
Ratenbegrenzungen werden pro API-Schlüssel durchgesetzt. Standardobergrenzen variieren je nach Tier:
| Stufe | Anfragen pro Tag | RPM (Standard) | API-Schlüssel |
|---|---|---|---|
| Free | 50 RPD | 10 RPM | 5 |
| Pro | Unbegrenzt | Unbegrenzt | Unbegrenzt |
Benutzerdefinierte Ratenbegrenzungen pro Schlüssel (RPM, TPM) sind im Dashboard konfigurierbar.
Bei Ratenbegrenzung gibt die API 429 Too Many Requests mit einem Retry-After-Header zurück.
Errors follow OpenAI format: { error: { message, type, code } }
| Code | Meaning | What to do |
|---|---|---|
| 400 | Bad Request | Check your request body format and required fields. |
| 401 | Unauthorized | Check your API key is valid and included in the header. |
| 402 | Insufficient Credits | Top up credits in the dashboard or upgrade to Pro. |
| 403 | Forbidden | Key lacks permission for this endpoint, or IP/referrer is blocked. |
| 404 | Not Found | Check the endpoint URL and model name. |
| 429 | Rate Limited | Wait and retry. Check the Retry-After header. Upgrade tier for higher limits. |
| 500 | Internal Server Error | Retry the request. If persistent, contact support. |
| 502 | Bad Gateway | Upstream provider error. Your fallback chain will auto-retry. |
| 503 | Service Unavailable | Provider temporarily unavailable. Fallback routing handles this. |
Verwenden Sie ein beliebiges OpenAI-kompatibles SDK. Ändern Sie einfach die Basis-URL und Ihren QNP-Schlüssel.
from openai import OpenAI
client = OpenAI(
base_url="https://qnp.ai/api/v1",
api_key="YOUR_KEY"
)
response = client.chat.completions.create(
model="openai/gpt-4o-mini", # routes to your fallback chain
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://qnp.ai/api/v1",
apiKey: "YOUR_KEY",
});
const response = await client.chat.completions.create({
model: "openai/gpt-4o-mini", // routes to your fallback chain
messages: [{ role: "user", content: "Hello!" }],
});
console.log(response.choices[0].message.content);from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
base_url="https://qnp.ai/api/v1",
api_key="YOUR_KEY",
model="openai/gpt-4o-mini" # routes to your fallback chain
)
response = llm.invoke("Hello!")
print(response.content)Cline is an AI-powered VS Code coding assistant. QNP works as Cline's API provider.
{url}.qnp-).{model} (or any other supported model). Pass qnp/auto if you want QNP to pick from your fallback chain.Tip: configure your API key provider chain in Dashboard → API Keys. The qnp/auto model uses the first model in that chain; if it fails, the next is tried automatically.
qnp- and is active./v1 (no trailing slash).Das Setup-Skript erkennt und konfiguriert automatisch OpenClaw, Claude Code und Hermes Agent. Verwenden Sie QNP als Modell-Provider für einheitliches Fallback und BYOK.
Das Setup-Skript fragt Sie interaktiv nach Ihrem API-Schlüssel und der Basis-URL.
curl -fsSL https://qnp.ai/setup.sh | bash
input: ["text","image","audio","video"] für alle Modelle.