Getting started

Quick start

Three steps: give the pool an account, mint a key, and point a client at the base URL. You will have a streamed reply in a couple of minutes.

  1. Add a session

    The pool needs at least one live ChatGPT session. Capture one on your own machine and it uploads straight into the gateway:

    python get_session.py --name main

    Or open the dashboard, expand Add a session, and paste a captured JSON file. See Capturing sessions for the full walkthrough and the browser extension.

  2. Create an API key

    In the dashboard, open API keys and click Generate. Copy the msk-… value once — it is shown in full only at creation. Hand that key to whatever will call the gateway, and keep your admin key to yourself.

  3. Point a client at the base URL

    Any OpenAI-compatible client works. Set the base URL and the key you just made:

    SettingValue
    Base URL__BASE__/v1
    API keymsk-… (the one you generated)
    Modelauto

Your first request

A plain curl against the gateway — swap in your key:

curl __BASE__/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"Hello!"}]}'

Add "stream": true to receive the answer incrementally as Server-Sent Events:

curl __BASE__/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"stream":true,"messages":[{"role":"user","content":"Write a haiku about the sea."}]}'

The model field defaults to auto — the upstream account decides. To force a specific model, pin it to the key from the dashboard; see Models & keys.

Using the OpenAI SDK

from openai import OpenAI

client = OpenAI(
    base_url="__BASE__/v1",
    api_key="YOUR_API_KEY",
)

resp = client.chat.completions.create(
    model="auto",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "__BASE__/v1",
  apiKey: "YOUR_API_KEY",
});

const r = await client.chat.completions.create({
  model: "auto",
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(r.choices[0].message.content);