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

# Quickstart

> Get Cognisafe running in under 5 minutes.

<Steps>
  <Step title="Create an account">
    Sign up at [cognisafe.uk](https://cognisafe.uk). The free tier includes 10,000 requests per month — no credit card required.
  </Step>

  <Step title="Install the SDK">
    <CodeGroup>
      ```bash Python theme={null}
      pip install cognisafe
      ```

      ```bash Node.js theme={null}
      npm install cognisafe
      ```
    </CodeGroup>

    For Anthropic or other providers, install the extras:

    ```bash theme={null}
    pip install "cognisafe[anthropic]"   # + Anthropic
    pip install "cognisafe[all]"         # all providers
    ```
  </Step>

  <Step title="Get your API key">
    In the dashboard: **API Keys** → **Create key**. Keys look like:

    ```
    csk_prod_a1b2c3d4e5f6...
    ```

    Store it as an environment variable — never hard-code it in source:

    ```bash theme={null}
    export COGNISAFE_API_KEY="csk_prod_a1b2c3d4e5f6..."
    export COGNISAFE_PROJECT_ID="my-app"
    ```
  </Step>

  <Step title="Configure and patch">
    Call `cognisafe.configure()` once at startup, then patch your provider:

    ```python theme={null}
    import cognisafe

    cognisafe.configure(
        api_key="csk_your_key_here",   # or reads COGNISAFE_API_KEY
        project_id="my-app",           # or reads COGNISAFE_PROJECT_ID
    )

    cognisafe.patch_openai()  # rewrites openai.base_url to the Cognisafe proxy
    ```

    For TypeScript / Node.js:

    ```typescript theme={null}
    import cognisafe from 'cognisafe';

    cognisafe.configure({ apiKey: 'csk_your_key_here', projectId: 'my-app' });
    cognisafe.patchOpenAI();
    ```
  </Step>

  <Step title="Make an LLM call">
    Your existing code is unchanged — Cognisafe captures everything automatically:

    ```python theme={null}
    from openai import OpenAI

    client = OpenAI()  # base_url is already pointing to Cognisafe proxy

    response = client.chat.completions.create(
        model="gpt-4o",
        messages=[{"role": "user", "content": "Hello, world!"}],
    )
    print(response.choices[0].message.content)
    ```

    Every call is logged, priced, and queued for safety scoring.
  </Step>

  <Step title="View in the dashboard">
    Open [cognisafe.uk/dashboard](https://cognisafe.uk/dashboard) → **Overview**. Your request appears within a second, including model, token counts, cost, and latency. Safety scores appear within a few seconds once the async worker processes the job.
  </Step>
</Steps>

<Note>
  Proxy mode (OpenAI, Mistral) adds zero latency overhead — the proxy forwards the response to your app at the same time as it logs the payload. Direct mode (Anthropic, Cohere) wraps the provider client's `create` method, which adds one lightweight HTTP call to the Cognisafe API in the background after the response is returned to you.
</Note>
