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

# Quickstart

> Create your first partner-managed OpenCX org via the Partner API in under 5 minutes — provision a key, create an org, and send a test message.

<Steps>
  <Step title="Get your API key">
    Partner API keys are provisioned by the OpenCX team during onboarding. You'll receive a JWT token that authenticates all Partner API requests.

    <Note>
      Partner API keys are separate from org-level API keys. They manage orgs (create, list, generate API keys, generate login links) — they cannot access chat sessions, contacts, or other org data.
    </Note>
  </Step>

  <Step title="Create an org">
    Call the Partner API to create an org for one of your customers:

    <CodeGroup>
      ```bash cURL theme={"dark"}
      curl -X POST https://api.open.cx/partner/v1/orgs \
        -H "Authorization: Bearer YOUR_PARTNER_API_KEY" \
        -H "Content-Type: application/json" \
        -d '{
          "name": "Sunset Kayak Tours",
          "external_id": "customer-12345",
          "website": "https://sunsetkayak.com",
          "language": "en",
          "ai_instructions": "You are the support agent for Sunset Kayak Tours. Help customers with booking questions, availability, and tour information. Be friendly and concise."
        }'
      ```

      ```javascript Node.js theme={"dark"}
      const response = await fetch('https://api.open.cx/partner/v1/orgs', {
        method: 'POST',
        headers: {
          'Authorization': 'Bearer YOUR_PARTNER_API_KEY',
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({
          name: 'Sunset Kayak Tours',
          external_id: 'customer-12345',
          website: 'https://sunsetkayak.com',
          language: 'en',
          ai_instructions: 'You are the support agent for Sunset Kayak Tours. Help customers with booking questions, availability, and tour information. Be friendly and concise.',
        }),
      });

      const org = await response.json();
      console.log(org.id);           // org UUID
      console.log(org.widget_token); // widget embed token
      ```

      ```python Python theme={"dark"}
      import requests

      response = requests.post(
          'https://api.open.cx/partner/v1/orgs',
          headers={'Authorization': 'Bearer YOUR_PARTNER_API_KEY'},
          json={
              'name': 'Sunset Kayak Tours',
              'external_id': 'customer-12345',
              'website': 'https://sunsetkayak.com',
              'language': 'en',
              'ai_instructions': 'You are the support agent for Sunset Kayak Tours. Help customers with booking questions, availability, and tour information. Be friendly and concise.',
          },
      )

      org = response.json()
      print(org['widget_token'])  # widget embed token
      ```
    </CodeGroup>

    The response contains everything you need:

    ```json theme={"dark"}
    {
      "id": "a1b2c3d4-...",
      "name": "Sunset Kayak Tours",
      "widget_token": "f8e7d6c5b4a3...",
      "external_id": "customer-12345"
    }
    ```
  </Step>

  <Step title="Embed the widget">
    Use the `widget_token` from the response to embed the chat widget on the customer's site:

    ```html theme={"dark"}
    <script
      src="https://cloud.opencopilot.so/widget.js"
      data-token="f8e7d6c5b4a3..."
    ></script>
    ```

    Or with React:

    ```tsx theme={"dark"}
    import { Widget } from '@opencx/widget-react';

    function App() {
      return <Widget token="f8e7d6c5b4a3..." />;
    }
    ```
  </Step>

  <Step title="Verify">
    Open the customer's site. The chat widget should appear and the AI agent will respond using the instructions you provided.

    For a production-ready setup, follow the [Integration Guide](/partners/integration-guide) to train the AI with real content.
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Integration Guide" icon="map" href="/partners/integration-guide">
    Full end-to-end setup: crawl websites, train the AI, authenticate users.
  </Card>

  <Card title="API Reference" icon="code" href="/partners/api-reference">
    Full endpoint documentation and error codes.
  </Card>
</CardGroup>
