Morpheus API Gateway LogoMorpheus API Gateway
Session

Ping Session

Ping the session by attempting a simple chat completion. If the chat completion fails, the session is considered dead and will be closed.

POST
/api/v1/session/pingsession

Authorization

AuthorizationRequiredBearer <token>

🚀 OAuth2 authentication via secure identity provider

In: header

Scope: openid, email, profile

AuthorizationRequiredBearer <token>

🎫 JWT Bearer token from OAuth2 login or direct token

In: header

Authorization<token>

🗝️ API key in format: 'Bearer sk-xxxxxx'

In: header

Response Body

Successful Response

TypeScript Definitions

Use the response body type in TypeScript.

responseRequiredunknown
curl -X POST "https://example.com/api/v1/session/pingsession" \
  -H "Authorization: Bearer <token>"
fetch("https://example.com/api/v1/session/pingsession", {
  headers: {
    "Authorization": "Bearer <token>"
  }
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://example.com/api/v1/session/pingsession"

  req, _ := http.NewRequest("POST", url, nil)
  req.Header.Add("Authorization", "Bearer <token>")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://example.com/api/v1/session/pingsession"

response = requests.request("POST", url, headers = {
  "Authorization": "Bearer <token>"
})

print(response.text)
null

How is this guide?