REST / cURL

REST / cURL

If you don’t want to use a library, you can make direct HTTP requests using cURL or any HTTP client (Axios, Fetch, etc.).

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 an assistant." },
      { "role": "user", "content": "Explain relativity in simple terms." }
    ]
  }'

Last updated