Skip to main content
POST
/
api
/
v1
/
session
/
closesession
Close Session
curl --request POST \
  --url https://api.mor.org/api/v1/session/closesession \
  --header 'Authorization: <authorization>'
{
  "success": true,
  "session_id": "<string>",
  "refund": "<string>",
  "total_usage": {}
}
Close the session associated with the current API key. This endpoint terminates the active session and settles any remaining payments with the provider. Any unused session time may be refunded according to the session terms.

Headers

Authorization
string
required
API key in format: Bearer sk-xxxxxx

Response

success
boolean
Whether the session was successfully closed
session_id
string
ID of the closed session
refund
string
Amount refunded for unused session time (if applicable)
total_usage
object
Usage statistics for the session
Sessions automatically close when they expire. You only need to manually close a session if you want to terminate it early or switch to a different provider.
After closing a session, you can immediately create a new session with the same or different provider/model.