> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onyxiq.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Authenticate API requests to OnyxIQ

> OnyxIQ API requests are authenticated with a session cookie. Sign in at onyxiq.in/login, then pass your cookie on every direct API call.

OnyxIQ uses session-based authentication. There is no separate API key system — every request is authenticated using the session cookie set when you sign in at [onyxiq.in/login](https://onyxiq.in/login).

## How it works

When you sign in at [onyxiq.in/login](https://onyxiq.in/login), a session cookie named `sb-[project-ref]-auth-token` is set in your browser. The API reads this cookie on every request to verify your identity and check your credit balance.

**In the browser**, the cookie is attached automatically to same-origin requests — no extra steps required.

**In cURL or scripts**, you must copy the cookie value from your browser and pass it with each request.

## Getting the cookie for cURL

<Steps>
  <Step title="Sign in">
    Go to [onyxiq.in/login](https://onyxiq.in/login) and complete sign-in.
  </Step>

  <Step title="Open DevTools">
    Open your browser's DevTools (F12), go to **Application → Cookies**, and select `https://onyxiq.in`.
  </Step>

  <Step title="Copy the cookie value">
    Find the cookie named `sb-[ref]-auth-token` and copy its value.
  </Step>

  <Step title="Pass it in your request">
    Add the cookie to your request using the `-H "Cookie: ..."` header (see example below).
  </Step>
</Steps>

## Example request

```bash theme={null}
curl -X POST https://onyxiq.in/api/openclaw/scrape \
  -H "Content-Type: application/json" \
  -H "Cookie: sb-[ref]-auth-token=[token]" \
  -d '{"url":"https://example.com"}'
```

Replace `[ref]` with the project ref in the cookie name you copied (e.g. `sb-abcdefgh-auth-token`) and `[token]` with the full cookie value.

## Error responses

| Status | Body                                                            | Meaning                                                                                                          |
| ------ | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `401`  | `{"error":"Authentication required"}`                           | The session cookie is missing, expired, or invalid. Sign in again at [onyxiq.in/login](https://onyxiq.in/login). |
| `402`  | `{"error":"Insufficient credits...","balance":N,"required":10}` | Your account does not have enough credits. Top up at [onyxiq.in/credits](https://onyxiq.in/credits).             |

<Tip>
  If you only need to scrape pages or use other OnyxIQ products interactively, the web UI at [onyxiq.in/products](https://onyxiq.in/products) is simpler than making raw API calls — no cookie handling required.
</Tip>
