Skip to content

Quickstart

From a new account to a working API request in under a minute.

From a new account to a working API request in under a minute.

1. Create an account

Sign up at sleepyai.org/signup.

  • Signup accepts email + password. Google OAuth is available when the deployment has it configured (the hosted service does).
  • Only popular email providers (Gmail, Outlook, Proton, Yahoo, etc.) are accepted — disposable domains are rejected.
  • New accounts land on the free plan (see Usage limits for what that includes).

Free-tier extra step. On the free plan you may be asked to join a Telegram group before the API will serve requests. Link your Telegram account in Dashboard → Settings, join the group, and verify. Paid subscriptions are exempt from this gate. Details in Telegram.

2. Get an API key

You have two ways to authenticate; pick whichever fits your client.

Option A — a virtual API key (for scripts and third-party clients)

  1. Open Dashboard → API Keys.
  2. Click Generate key (plans with the API Key Generation feature; free accounts may not have it — the CLI and VS Code extension use OAuth instead).
  3. Copy the key immediately — it is shown once. Keys are stored encrypted; the dashboard only ever shows them masked.

You can create up to 10 keys per account. Each key can be given a display name and revoked individually.

Option B — log in with the CLI (no key to manage)

The sleepy CLI and the VS Code extension authenticate with an OAuth device flow instead of a static key. Install the CLI and run sleepy login — see Sleepy CLI. The session token it obtains works against the same API and the same usage pool as a virtual key.

3. Point your client at the gateway

The API base URL is:

https://www.sleepyai.org/api/v1

OpenAI-compatible clients use that URL as-is (they append /chat/completions themselves).

Anthropic-compatible clients (Claude Code, the anthropic SDK) use https://www.sleepyai.org/api instead, because they append /v1/messages themselves. Getting this wrong is the #1 setup mistake — see Anthropic clients.

4. Make your first request

curl https://www.sleepyai.org/api/v1/chat/completions \
  -H "Authorization: Bearer $SLEEPY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o",
    "messages": [{ "role": "user", "content": "Say hello in one sentence." }]
  }'

Replace $SLEEPY_API_KEY with the key from step 2 and gpt-4o with any model from the catalogue (list them with GET /v1/models, or browse sleepyai.org/models).

A successful response is a standard OpenAI chat.completion object. Set "stream": true for Server-Sent Events.

5. Watch your usage

Every request lands in Dashboard → Usage with prompt/completion/cached token counts, cost, and which surface made it (api, chat, or cli). That page also shows your remaining allowance in every rolling window — the fastest way to understand the limits in action is to make a request and watch the meters move.

Next steps

Quickstart | SleepyAI - Your Coding Agent and Unified AI GateWay