# Open a session (buy a bid)

Source: https://nodedocs.mor.org/consumers/buy-bid

## Agent Instructions

- Non-browser fetches of page URLs on this site return clean Markdown (not the JS UI). Prefer `https://nodedocs.mor.org/llms-full.txt` for the full corpus, or `https://nodedocs.mor.org/llms.txt` for the index.
- Per-page Markdown is also at `<page-url>.md` (homepage: `https://nodedocs.mor.org/index.md`).
- Docs search MCP: `https://nodedocs.mor.org/mcp` (discovery: `https://nodedocs.mor.org/.well-known/mcp`).
- Never invent contract addresses, chain IDs, token addresses, or live bid/model counts. Cite Networks and tokens; link active.mor.org for live data.
- Never claim Morpheus runs inference — independent providers do. Opening a session escrows MOR; it does not spend it.

Opening a session = "buying a bid." You stake MOR for a fixed duration; the proxy-router routes prompts to the chosen provider until the session closes (or you close it). The MOR is **escrowed**, not spent up-front — see [Sessions: stake, close, claim](/concepts/sessions-stake-close-recover) before you panic about a dropping wallet balance.

## Via MorpheusUI

  
### Confirm wallet funding

Lower-left of MorpheusUI shows your wallet address; the Wallet tab shows MOR and ETH balances. You need at least `5` MOR for a session and a small ETH balance for gas.

  
### Pick a remote model

Chat tab → **Change Model** → pick from the model list (anything other than "Local Model"). The list is the Diamond marketplace registry, searchable by name or tag and sortable by price per second of compute; the price column comes from one `GET /blockchain/models/prices` call, so it loads in one round trip instead of one per model. Models with no live provider say so rather than showing a price.

  
### Choose a provider and a payment method

MorpheusUI 7.12+ shows the providers bidding on the model with their price and rating score and lets you pick one; the default is the top-scored bid — the same one the node would choose unattended. Choose **Stake** (default; your MOR is escrowed and the provider is paid from emissions) or **Direct Pay** (the provider is paid out of your escrowed amount at close). The amount locked is identical either way.

  
### Confirm the session

The confirmation quotes the bid you actually selected: the MOR that will be **locked** (the stake) alongside the cost of the compute you are buying — the two differ by a few hundred × because stake is proportional to your share of total MOR supply against today's emissions budget, not to the price. Session length is bounded by the values the contract reports (`GET /blockchain/sessions/duration`), not by numbers hardcoded in the app. Both figures come from [`GET /blockchain/models/:id/session/estimate`](/reference/api-endpoints#estimate-a-session-before-opening). See [How much MOR does an open lock?](/concepts/sessions-stake-close-recover#how-much-mor-does-an-open-lock).

  
### Watch for the on-chain confirmation

Approve (if needed) and open are submitted; once mined the session is open and you can prompt. MorpheusUI opens with `rejectExisting`, so a double-click or a retry after a slow confirmation cannot lock stake twice — if the wallet already has a live session for that model the node answers `409` and the app reuses it.

  
### Close when done (or let it expire naturally)

Either path:

    - **Natural expiration** — your consumer node submits `closeSession` ~1 minute after `endsAt` (if online).
    - **Early close** — click the time icon next to the model line; click **X** next to the session.

    In both cases: **unused** stake returns in the close txn; the **used stipend** day-locks in `userStakesOnHold` until the next UTC day. After `releaseAt`, claim with `POST /blockchain/stakes/withdraw` (or `withdrawUserStakes` on the Diamond). There is no `recover` RPC.

## Via the API

```bash
curl -X POST 'http://localhost:8082/blockchain/models/<modelId>/session' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Basic <base64(user:pass)>' \
  -d '{"sessionDuration": 600, "failover": false, "directPayment": false}'
```

Response:

```json
{ "sessionID": "0x8e12df2f764b416c0ea1936a253c2a4be01005651c2d73f22dd0d72520f93ca1" }
```

> For a video model, the session length comes from the job's quote and you open on the quoted bid: `POST /v1/video/quote`, then `POST /blockchain/bids/<bidId>/session` with `sessionDuration` set to `session_seconds`. The **Video** screen in MorpheusUI does this for you. See [Video generation](/consumers/video).

Close it:

```bash
curl -X POST 'http://localhost:8082/blockchain/sessions/<sessionId>/close' \
  -H 'Authorization: Basic <base64(user:pass)>' -d '{}'
```

## What you should expect

- **Wallet balance drops by the staked amount** the instant the open transaction is mined. The MOR is now in the Inference Contract on Base for the duration of the session.
- **On close (early or natural):** unused stake returns in the same txn; the used stipend day-locks with `releaseAt = startOfTheDay(min(closedAt, endsAt)) + 1 day`. After `releaseAt`, claim releasable rows with `POST /blockchain/stakes/withdraw`, or call `withdrawUserStakes(yourAddress, iterations)` directly on the Diamond when bypassing the node.
- **Capital planning:** used stake is **not reusable the same UTC day**. Size your wallet for the gross stake you need that day, not for recycling one pile of MOR many times before midnight UTC. See [Sessions: stake, close, claim](/concepts/sessions-stake-close-recover).
- **The provider is paid from a separate protocol funding account**, not from your stake in real time. If that funding account is empty or under-approved, every `closeSession` fails — yours included. The session sits "active" past `endsAt` until operators top it up. See [Why is my MOR locked?](/ai/why-locked-in-contract).
- For a hosted read-only wallet checker that splits your MOR across the three on-chain buckets (wallet / active session / on-hold), see [tech.mor.org/session.html](https://tech.mor.org/session.html).

## Picking a good bid

There is no single right answer; consider:

- **`pricePerSecond`** — lower is cheaper but providers compete on quality and uptime.
- **Provider reputation / stake** — higher provider stake means more skin in the game.
- **TEE vs non-TEE** — `tee`-tagged models give you cryptographic guarantees about the running software (see [TEE overview](/concepts/tee-overview)).
- **Throughput / capacity** — live files at [active.mor.org](https://active.mor.org). Name the layer ([Marketplace catalog](/ecosystem/active-status)); C-Node apps usually want **ACTIVE**. Explainer: [tech.mor.org/active.html](https://tech.mor.org/active.html).

For a `rating-config.json` that prefers certain providers automatically, see [rating-config](/reference/rating-config).
