Skip to main content
POST
/
api
/
v1
/
session
/
bidsession
Create Bid Session
curl --request POST \
  --url https://api.mor.org/api/v1/session/bidsession \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "sessionDuration": 123,
  "directPayment": true,
  "failover": true
}'
{
  "session_id": "<string>",
  "provider": "<string>",
  "bid_id": "<string>",
  "duration": 123,
  "cost": "<string>"
}
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.

Headers

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

Query Parameters

bid_id
string
required
The blockchain ID (hex) of the bid to create a session for, e.g., 0x1234...

Body

sessionDuration
integer
default:3600
Duration of the session in seconds
directPayment
boolean
default:false
Whether to use direct payment instead of allowance
failover
boolean
default:false
Whether to enable automatic failover to another provider

Response

session_id
string
Unique identifier for the created session
provider
string
Provider address
bid_id
string
Bid identifier used
duration
integer
Session duration in seconds
cost
string
Total cost for the session
Before creating a session, ensure you have approved sufficient MOR tokens using the /api/v1/session/approve endpoint. The required amount is calculated as: bid_price * session_duration.
Each API key can only have one active session at a time. Creating a new session will close any existing session associated with the API key.