# Paste This Into Your AI Coding Agent

Integrate QFOXAI into this project as an OpenAI-compatible AI provider.

Use these settings:

- Base URL: `https://qfoxai.com/v1`
- API key env var: `QFOXAI_API_KEY`
- Default model alias: `QFOXAI`
- API docs: `https://qfoxai.com/docs/api`
- OpenAPI schema: `https://qfoxai.com/openapi.json`

Requirements:

1. Keep the API key server-side only. Never expose it in browser JavaScript.
2. Add configuration for `QFOXAI_API_KEY`, `QFOXAI_BASE_URL`, and `QFOXAI_MODEL`.
3. Use the OpenAI-compatible chat completions shape.
4. Add a connection test that sends a small request and reports success/failure.
5. Handle errors by reading `error.type`, `error.message`, and `request_id`.
6. Add retry/backoff for 429, 500, 502, 503, and 504.
7. Use `GET /v1/key` or response headers to show remaining usage and upgrade/renew prompts.
8. Never expose backend model names. Use public QFOXAI aliases only.
9. Include short setup documentation for the project owner.

Example request body:

```json
{
  "model": "QFOXAI",
  "messages": [
    {"role": "user", "content": "Hello QFOXAI"}
  ],
  "max_tokens": 300
}
```