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

# Quickstart

> Start using Raptor in under 2 minutes

## 1. Get Your Credentials

<Steps>
  <Step title="Create Account">
    Sign up at [dashboard.raptordata.dev](https://dashboard.raptordata.dev) (free, no credit card)
  </Step>

  <Step title="Copy API Key">
    Go to **Settings → API Keys** → Create new key (starts with `rpt_`)
  </Step>

  <Step title="Copy Workspace ID">
    Your Workspace ID is in the dashboard header (UUID format)
  </Step>
</Steps>

## 2. Update Your Code

Just change the base URL and add two headers. Everything else stays the same.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    from openai import OpenAI

    client = OpenAI(
        api_key="sk-your-openai-key",
        base_url="https://proxy.raptordata.dev/v1",
        default_headers={
            "X-Raptor-Api-Key": "rpt_your-key",
            "X-Raptor-Workspace-Id": "your-workspace-id"
        }
    )

    # That's it! Use normally
    response = client.chat.completions.create(
        model="gpt-4",
        messages=[{"role": "user", "content": "Hello!"}]
    )
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={null}
    import OpenAI from 'openai';

    const client = new OpenAI({
      apiKey: 'sk-your-openai-key',
      baseURL: 'https://proxy.raptordata.dev/v1',
      defaultHeaders: {
        'X-Raptor-Api-Key': 'rpt_your-key',
        'X-Raptor-Workspace-Id': 'your-workspace-id'
      }
    });

    // That's it! Use normally
    const response = await client.chat.completions.create({
      model: 'gpt-4',
      messages: [{ role: 'user', content: 'Hello!' }]
    });
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl https://proxy.raptordata.dev/v1/chat/completions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer sk-your-openai-key" \
      -H "X-Raptor-Api-Key: rpt_your-key" \
      -H "X-Raptor-Workspace-Id: your-workspace-id" \
      -d '{"model": "gpt-4", "messages": [{"role": "user", "content": "Hello!"}]}'
    ```
  </Tab>
</Tabs>

## 3. Verify It Works

Check for Raptor headers in the response:

```
X-Raptor-Cache: miss          # "hit" when cached
X-Raptor-Latency-Ms: 5        # Raptor overhead (~5ms)
X-Raptor-Upstream-Latency-Ms: 450  # AI provider time
```

<Tip>
  Make the same request twice. The second time, you'll see `X-Raptor-Cache: hit` and a much faster response.
</Tip>

## 4. Use Streaming

Streaming works out of the box. Just add `stream: true`:

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    stream = client.chat.completions.create(
        model="gpt-4",
        messages=[{"role": "user", "content": "Tell me a story"}],
        stream=True
    )

    for chunk in stream:
        print(chunk.choices[0].delta.content or "", end="")
    ```
  </Tab>

  <Tab title="TypeScript">
    ```typescript theme={null}
    const stream = await client.chat.completions.create({
      model: 'gpt-4',
      messages: [{ role: 'user', content: 'Tell me a story' }],
      stream: true
    });

    for await (const chunk of stream) {
      process.stdout.write(chunk.choices[0]?.delta?.content || '');
    }
    ```
  </Tab>
</Tabs>

## What's Happening?

Every request now flows through Raptor:

```
Your App → Raptor Proxy → OpenAI/Anthropic
              │
              ├── Firewall check (~2ms)
              ├── Cache lookup (~1ms)
              ├── Evidence logging (async)
              └── Forward to AI
```

Total overhead: **\~5ms**. Built in Rust for speed.

## Next Steps

<CardGroup cols={2}>
  <Card title="How It Works" icon="gears" href="/features/architecture">
    Understand the Rust architecture
  </Card>

  <Card title="Semantic Cache" icon="bolt" href="/features/semantic-cache">
    Learn how caching saves you money
  </Card>

  <Card title="AI Firewall" icon="shield" href="/features/firewall">
    Protect against prompt injection
  </Card>

  <Card title="Anthropic Guide" icon="robot" href="/integrations/anthropic">
    Using Claude instead of GPT?
  </Card>
</CardGroup>
