commentChat completions

Chat-Based Text Generation

Use this endpoint to interact with chat models like GPT-4, Claude, Mistral, etc., using OpenAI-style messages.

Parameters:

  • model (string) — required

  • messages (array) — required

  • temperature, top_p, max_tokens, stream — optional

Example:

curl https://api.uniportai.site/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4",
    "messages": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "What are the benefits of meditation?"}
    ]
  }'

Last updated