Create a session with a provider using a model 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. The system will automatically select the best available bid for the specified model.
API key in format: Bearer sk-xxxxxx
Query Parameters
The blockchain ID (hex) of the model to create a session for, e.g., 0x1234...
Body
Duration of the session in seconds
Whether to use direct payment instead of allowance
Whether to enable automatic failover to another provider
Response
Unique identifier for the created session
Bid identifier that was selected
Session duration in seconds
Total cost for the session
Automatic Bid Selection: When creating a session by model ID, the gateway automatically selects the best available bid based on price, provider rating, and availability. Use /api/v1/models/ratedbids?model_id=... to see all available bids first.
Before creating a session, ensure you have approved sufficient MOR tokens using the /api/v1/session/approve endpoint.
Enable failover: true for production applications to automatically switch to another provider if the primary provider becomes unavailable.