# QFOXAI Integration Cookbook

A practical recipe set for teams building with QFOXAI.

## 1. Customer Support Reply

Endpoint: `POST https://qfoxai.com/v1/chat/completions`

Prompt pattern:

```json
{
  "model": "QFOXAI",
  "messages": [
    {"role":"system","content":"Write clear, polite support replies. Ask for missing details when needed."},
    {"role":"user","content":"Customer says their invoice payment is not updated. Draft a reply."}
  ],
  "max_tokens": 350
}
```

## 2. CRM Note Summary

Use this after calls, tickets, or sales meetings. Store the output in your CRM notes.

```json
{
  "model": "QFOXAI",
  "messages": [
    {"role":"user","content":"Summarize this call into: issue, next step, owner, risk. Transcript: ..."}
  ]
}
```

## 3. Invoice And Billing Assistant

Use QFOXAI to draft invoice explanations, payment reminders, ledger descriptions, and refund notes.

## 4. Knowledge Base Search With Embeddings

1. Create embeddings for help articles with `POST https://qfoxai.com/v1/embeddings`.
2. Store vectors in your database or vector store.
3. Retrieve the closest articles before calling chat completions.
4. Add retrieved snippets to the prompt as context.

## 5. Moderation Pre-Check

Use `POST https://qfoxai.com/v1/moderations` before publishing user-generated content or before sending risky prompts into a production flow.

## 6. Batch Content Generation

Use `POST https://qfoxai.com/v1/batches` for non-live tasks such as product descriptions, email drafts, short summaries, and background support tasks.

## 7. Quota-Aware Product UI

Call `GET https://qfoxai.com/v1/key` in your backend to show:

- remaining daily key requests
- remaining daily key tokens
- subscription request usage
- subscription token usage
- renew or upgrade actions

## 8. Webhook Automation

In the QFOXAI dashboard, add a webhook endpoint for subscription and API key events. Use it to update your own billing, CRM, or customer success workflows.

## 9. Image Generation

Use `POST https://qfoxai.com/v1/images/generations` for landing-page graphics, product mockups, campaign concepts, blog thumbnails, and creative drafts when image access is enabled for the account.

```json
{
  "model": "QFOXAI Image",
  "prompt": "A realistic product photo of a premium AI dashboard on a laptop, clean office lighting",
  "size": "1024x1024",
  "n": 1
}
```

## 10. Compatibility Smoke Test

Run health, models, key status, and one short chat request before connecting a customer project. The QFOXAI API Playground can run these checks from the dashboard.