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

# Quickstart

> Get started with the Centure API in minutes

Detect prompt injection attacks in your application using the Centure API or SDK.

## Using the Node.js SDK

<Steps>
  <Step title="Install the SDK">
    ```bash theme={null}
    npm install @centure/node-sdk
    ```
  </Step>

  <Step title="Get your API key">
    Create an API key from the [dashboard](https://centure.ai/dashboard) and set it as an environment variable:

    ```bash theme={null}
    export CENTURE_API_KEY="your-api-key"
    ```
  </Step>

  <Step title="Scan text content">
    ```typescript theme={null}
    import { CentureClient } from "@centure/node-sdk";

    const client = new CentureClient();

    // Fetch text from a URL and scan it
    const text = await fetch('https://example.com').then(r => r.text());
    const result = await client.scanText(text);

    if (!result.is_safe) {
      console.log("Prompt injection detected!");
      console.log("Threats:", result.categories);
    } else {
      console.log("Content is safe");
    }
    ```
  </Step>
</Steps>

<Tip>
  The SDK automatically reads the `CENTURE_API_KEY` environment variable if you don't provide an API key explicitly.
</Tip>

## Using the REST API

You can also call the API directly without using the SDK:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.centure.ai/v1/prompt-injection/text \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"content": "Your text content here"}'
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch('https://api.centure.ai/v1/prompt-injection/text', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      content: 'Your text content here'
    })
  });

  const result = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.centure.ai/v1/prompt-injection/text',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={'content': 'Your text content here'}
  )

  result = response.json()
  ```
</CodeGroup>

## Response Format

All scan endpoints return the same response structure:

```json theme={null}
{
  "is_safe": false,
  "categories": [
    {
      "code": "context_injection",
      "confidence": "high"
    }
  ],
  "request_id": "req_abc123",
  "api_key_id": "key_xyz789",
  "request_units": 1,
  "service_tier": "standard"
}
```

* **`is_safe`**: `false` when prompt injection is detected
* **`categories`**: Array of detected threat types with confidence levels
* **`request_id`**: Unique identifier for this request

<Info>
  See the [Risk Classifications](/security/risk-classifications) page for detailed explanations of threat categories.
</Info>

## Next Steps

<CardGroup cols={2}>
  <Card title="Node.js SDK Documentation" icon="node" href="/sdk/nodejs-quickstart">
    Full SDK documentation with advanced features and MCP integration
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/overview">
    Complete REST API documentation and endpoint reference
  </Card>

  <Card title="Security Concepts" icon="shield" href="/security/risk-classifications">
    Learn about threat categories and risk classifications
  </Card>

  <Card title="npm Package" icon="npm" href="https://www.npmjs.com/package/@centure/node-sdk">
    View the SDK on npm
  </Card>
</CardGroup>
