B2BB2B LLM

API-Übersicht

Schnellstart für Anthropic Messages, OpenAI-Chat-Abschlüsse, Antworten und Metadaten-Endpunkte.

API-Übersicht

Model Gate bietet ein authentifiziertes Gateway für Anthropic- und OpenAI-kompatible Clients.

Basis-URLs

Anthropic-compatible: https://api.model-gate.com
OpenAI-compatible:    https://api.model-gate.com/v1

Anfrage zum Abschluss des OpenAI-Chats

curl https://api.model-gate.com/v1/chat/completions \
  -H "Authorization: Bearer mg_live_..." \
  -H "Content-Type: application/json" \
  -d '{"model":"ch-47","messages":[{"role":"user","content":"Hello"}]}'

Antwort auf OpenAI-Chat-Abschlüsse

{
  "id": "chatcmpl_example",
  "object": "chat.completion",
  "model": "claude-opus-4.7",
  "choices": [{"index":0,"message":{"role":"assistant","content":"Hello!"},"finish_reason":"stop"}],
  "usage": {"prompt_tokens":8,"completion_tokens":3,"total_tokens":11}
}

Anthropic Messages-Anfrage

curl https://api.model-gate.com/v1/messages \
  -H "x-api-key: mg_live_..." \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"claude-sonnet-4.6","max_tokens":256,"messages":[{"role":"user","content":"Hello"}]}'

Antwort von Anthropic Messages

{
  "id": "msg_example",
  "type": "message",
  "role": "assistant",
  "model": "claude-sonnet-4.6",
  "content": [{"type":"text","text":"Hello!"}],
  "usage": {"input_tokens":8,"output_tokens":3}
}

Modelle und personalisierte Preise

GET /v1/models gibt kanonische Modell-IDs, aktivierte Aliase, Funktionen, tatsächliche Kontobelastungsraten, offizielle Katalograten und effektive Nutzungskostensätze für den authentifizierten Schlüssel zurück.

Siedlung

Der Kontostand wird von abgebucht cost. Die zurücksetzbaren Grenzwerte für API-Schlüssel und Gruppen werden um erhöht usage_cost. Diese Werte können unterschiedlich sein, da jeder Schlüssel oder jede Gruppe auswählen kann user_price oder official_price und ein Multiplikator.