Close Session
Close the session associated with the current API key.
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.
responseRequiredunknowncurl -X POST "https://example.com/api/v1/session/closesession" \
-H "Authorization: Bearer <token>"fetch("https://example.com/api/v1/session/closesession", {
headers: {
"Authorization": "Bearer <token>"
}
})package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/v1/session/closesession"
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/closesession"
response = requests.request("POST", url, headers = {
"Authorization": "Bearer <token>"
})
print(response.text)nullHow is this guide?
Approve Spending POST
Approve the contract to spend MOR tokens on your behalf. Connects to the proxy-router's /blockchain/approve endpoint. For creating sessions, approve enough tokens by calculating: bid_price * session_duration. Uses the DIAMOND_CONTRACT_ADDRESS environment variable as the spender contract address.
Create Bid Session POST
Create a session with a provider using a bid ID and associate it with the API key. This endpoint creates a session and automatically associates it with the API key used for authentication. Each API key can have at most one active session at a time.