WebsitePlatform Login

Completions

OpenAI-kompatible API-Endpunkte

Unsere API unterstützt nicht alle Parameter, die OpenAI anbietet. Anfragen werden trotzdem akzeptiert und verarbeitet, jedoch werden nicht alle Parameter beachtet.

Unterstützte Parameter:

  • model
  • messages
  • response_format
  • stream
  • temperature
  • tools
  • tool_choice
POST/openai/v1/chat/completions

Erstellt eine Modellantwort für die gegebene Chat-Konversation. Kompatibel mit OpenAIs Chat Completions API.

Authorization

ApiKeyAuth
Authorization<token>

API-Schlüssel zur Authentifizierung. Verwende das Format 'Bearer <Dein-API-Schlüssel>'.

In: header

Header Parameters

Authorization*string

API-Schlüssel zur Authentifizierung. Verwende das Format 'Bearer <Dein-API-Schlüssel>'.

Request Body

application/json

messages*array<>

Liste der bisherigen Nachrichten der Konversation

model*string

ID des zu verwendenden Modells

response_format?
stream?boolean

Ob Teilergebnisse zurückgestreamt werden sollen

Defaultfalse
temperature?number

Sampling-Temperatur

Range0 <= value <= 2
tools?array<>

Tools (Funktionen), die das Modell aufrufen darf. Nicht jedes Modell unterstützt Tool Calling – eine Anfrage mit Tools an ein nicht unterstütztes Modell (z. B. Perplexity) liefert 400.

tool_choice?|

Steuert, welches Tool aufgerufen wird – 'auto', 'none', 'required' oder eine bestimmte Funktion.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://app.meingpt.com/api/openai/v1/chat/completions" \  -H "Authorization: Bearer sk_meingpt_..." \  -H "Content-Type: application/json" \  -d '{    "messages": [      {        "role": "system",        "content": "string"      }    ],    "model": "string"  }'
{
  "id": "string",
  "object": "chat.completion",
  "created": 0,
  "model": "string",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "string",
        "tool_calls": [
          {
            "id": "string",
            "type": "function",
            "function": {
              "name": "string",
              "arguments": "string"
            }
          }
        ]
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0
  }
}
{
  "status": "error",
  "message": "string"
}
{
  "status": "error",
  "message": "string"
}
{
  "status": "error",
  "message": "string"
}
{
  "status": "error",
  "message": "string"
}