Skip to content

Chat + stream ​

POST https://api.gommo.net/api/v2/chat — upstream yêu cầu messages không rỗng.

Chat (JSON response) ​

powershell
$h = @{ Authorization = "Bearer $env:TOKEN" }
$body = "action=chat&domain=%REGISTRATION_DOMAIN%&query=Say hello in one short sentence.&messages=[{\"role\":\"user\",\"text\":\"Say hello in one short sentence.\"}]"
Invoke-RestMethod -Method POST `
  -Uri "https://api.gommo.net/api/v2/chat" `
  -Headers $h `
  -ContentType "application/x-www-form-urlencoded" `
  -Body $body

Tùy chọn: truyền sessionId từ response trước cho multi-turn.

Stream (SSE) ​

Dùng curl -N đọc stream trên terminal:

powershell
curl.exe -N -X POST "https://api.gommo.net/api/v2/chat" ^
  -H "Authorization: Bearer %TOKEN%" ^
  -H "Content-Type: application/x-www-form-urlencoded" ^
  -d "action=stream&domain=%REGISTRATION_DOMAIN%&query=Tell a very short story.&messages=[{\"role\":\"user\",\"text\":\"Tell a very short story.\"}]"

Self-host (chỉ operator) ​

Khi deploy local — Deploy → Self-host nâng cao.

Playground ​

Playground — worker Nền tảng → Chat (tìm chat) hoặc ?embed=1&worker=chat → stream → Gửi request. Xem Chat reference.

Tiếp theo ​