# Grok (xAI) connector — Kareet CRM

## What Grok needs

Grok / xAI “connectors” and tool-calling apps call **your** HTTPS APIs with auth.
They do **not** require agents to paste an xAI API key into Kareet.

| Piece | Value |
|--------|--------|
| Base URL | `https://crm.kareet.com` |
| Auth | `Authorization: Bearer <KAREET_API_KEY>` |
| Spec | Same OpenAPI as ChatGPT: `ops/connectors/chatgpt-openapi.yaml` |
| Tools | `/kareet/score-goal`, `/kareet/suggest-goal-next`, `/kareet/score-listing-ladder`, `/kareet/upsert-listing`, `/kareet/create-lead` |

## Agent setup (product copy)

1. Open Kareet → **Settings → APIs & Webhooks** → create key (or **Connect Grok** when UI ships).  
2. In Grok / xAI tools: add **OpenAPI** or custom actions pointing at the base URL + bearer token.  
3. Import `chatgpt-openapi.yaml` (compatible OpenAPI 3.1).  
4. Ask Grok: “Score my goal Close 3 deals — target 3 current 1”.

## Ops note

- Optional: set `XAI_API_KEY` on the **server** only if Kareet-hosted in-app chat should use Grok as a model.  
- That is **not** what agents configure. Agents give **Kareet permission**, not xAI keys.

## OpenAPI URL (after you host the file)

When served from the CRM or CDN:

`https://crm.kareet.com/kareet/openapi.yaml`

(Until then, paste/upload `ops/connectors/chatgpt-openapi.yaml`.)
