# Sell your first model

Register as a provider, quote one model and see your first award.

You set up a provider, run the reference provider and buy one answer from yourself. Plan about an hour, plus the wait for admission.

## Before you start

- A model behind an OpenAI-compatible endpoint that streams token usage. A local server is fine.
- A dispatch address that the exchange can reach over `http` or `https`. It cannot be a loopback or private address.
- Python 3.12 or later, [uv](https://docs.astral.sh/uv/) and a funded buyer workspace key. See [Keys](https://inference.ai.exchange/docs/keys.md).

## Steps

1. Open **Sell on the exchange** in the console and choose **Request to be a provider**. Fill in the form. Set `declared_endpoint` to your dispatch address. Pick a handle that does not start with `byok-`, because the exchange keeps those for buyers' keys.

   The status is `PENDING`. The handle is yours from now on.

2. Wait until the status is `ADMITTED`. An operator reviews each registration, and the exchange sends no email. Check the console.

3. Open the provider in the selling console, choose **Issue** and copy the secret. It starts with `sk-liquid-`. The console shows it once.

4. Register your deployment. Change the values to match your model:

   ```bash
   curl https://router.inference.ai.exchange/v1/provider/models \
     -H "Authorization: Bearer $LIQUID_PROVIDER_API_KEY" \
     -H "Content-Type: application/json" \
     -d '{"deployment_name":"my-model","precision":"fp8","region":"eu-west",
          "max_input_tokens":32000,"max_output_tokens":4096}'
   ```

   The reply is `201`. The deployment is `UNLISTED`. Only your own workspace can buy it, by the name `<your handle>/my-model`.

5. Save the reference provider from Run the reference provider as `provider.py` in a new directory. In the same directory, make `.env.local`:

   ```bash
   LIQUID_EXCHANGE_URL=https://router.inference.ai.exchange
   LIQUID_PROVIDER_SLUG=your-handle
   LIQUID_PROVIDER_API_KEY=sk-liquid-...
   LIQUID_DEPLOYMENT_NAME=my-model
   LIQUID_DISPATCH_BIND=127.0.0.1:9110
   LIQUID_DISPATCH_URL=https://provider.example.com/dispatch
   LIQUID_UPSTREAM_BASE_URL=http://127.0.0.1:9200/v1
   LIQUID_UPSTREAM_API_KEY=your-upstream-key
   LIQUID_RATE_INPUT=0.10
   LIQUID_RATE_CACHE_READ=0.02
   LIQUID_RATE_OUTPUT=0.20
   LIQUID_RETENTION_POLICY=allowed
   LIQUID_AWARD_DB=awards.sqlite3
   ```

   The three rates are USD per million tokens. The scheme, host and port of `LIQUID_DISPATCH_URL` must match `declared_endpoint`. Do not commit this file.

6. Start the provider:

   ```bash
   set -a
   source .env.local
   set +a
   uv run provider.py
   ```

   The log shows that the login worked, then that the exchange accepted your quote.

7. Send one small request from your buyer workspace:

   ```bash
   curl "$LIQUID_EXCHANGE_URL/v1/chat/completions" \
     -H "Authorization: Bearer $LIQUID_API_KEY" \
     -H 'Content-Type: application/json' \
     -d '{"model":"your-handle/my-model","max_tokens":32,
          "messages":[{"role":"user","content":"Say hello."}],
          "exchange":{"rank":{"allow_single_supplier":true},
                      "privacy":{"retention":"allowed"},"cap_usd":0.001}}'
   ```

   You get a short answer. Copy `exchange.job_id` from the response.

## Check it works

Read the receipt of the job:

```bash
curl "$LIQUID_EXCHANGE_URL/v1/exchange/jobs/$LIQUID_JOB_ID" \
  -H "Authorization: Bearer $LIQUID_API_KEY"
```

The receipt shows `settlement_status: settled`. Your agent logs the award for the same job.

Then open the **Earnings** page in the selling console. It shows the amount that the exchange owes you. The exchange opens a payout each hour for a balance of $25 or more, and only when you have set a payout destination. See [Serve and get paid](https://inference.ai.exchange/docs/provider-dispatch.md).

## If something goes wrong

- **No `ADMITTED` status.** A `PENDING` provider has no keys and no sessions. Wait for an operator. A `REJECTED` status has a reason in the console.
- **The login or the quote fails.** Check that the handle and key in `.env.local` are correct. Read the code of the refusal in [Quote over the session](https://inference.ai.exchange/docs/provider-quoting.md).
- **The request finds no offer.** Make sure that the provider still runs and that the model name is `<handle>/<deployment_name>`. Quotes expire, so look at the log for new acknowledgements.

## Next steps

- [Deployments](https://inference.ai.exchange/docs/provider-models.md): ask for a listing in the public book.
- [Run your agent](https://inference.ai.exchange/docs/provider-operate.md): change prices and upgrade with no gap.
- [Serve and get paid](https://inference.ai.exchange/docs/provider-dispatch.md): set your payout destination.
