Skip to main content

Quickstart

This guide will help you make your first API request to Char AI.

Prerequisites

Before you begin, you’ll need:
  1. A Char AI account with an organization
  2. A valid JWT token from WorkOS authentication

Step 1: Authenticate

All API requests require a Bearer token in the Authorization header:
curl -X GET "https://app.meetchar.ai/api/users/me" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN"

Step 2: Create a Site

Sites define where your AI widgets can be embedded:
curl -X POST "https://app.meetchar.ai/api/sites" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Application",
    "allowed_origins": "[\"https://myapp.com\"]"
  }'

Step 3: Generate an API Key

Create an API key for your site to authenticate widget requests:
curl -X POST "https://app.meetchar.ai/api/sites/{site_id}/api_keys" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production Key"
  }'
Store your API key securely! The plain key is only returned once at creation time.

Next Steps