QFOXAI API Docs
Connect applications, automations, customer software, and developer tools through one documented API. Start with a compatible client, then add vision, images, embeddings, moderation, batches, and quota-aware product experiences.
Quick Start
Use these four settings in any OpenAI-compatible app, AI Studio, Laravel package, WordPress plugin, or custom backend.
https://qfoxai.com/v1
Paste the full qf_... secret only. Do not paste the word Bearer into API key fields that add it automatically.
QFOXAI is the current platform default. Direct HTTP requests may omit model; QFOXAI then applies the key, project, and smart-routing preferences available to that request.
Compatibility Tester
Before connecting a customer project, run a short backend check from your dashboard. It verifies health, model access, key status, and one small chat request without exposing your API secret.
Customer Growth Toolkit
QFOXAI is easier to sell when developers can connect quickly and customers can see practical business outcomes immediately.
Use API keys, Postman, SDK starters, Laravel package notes, and the API playground before writing custom code.
Offer chat, image generation, vision, attachments, embeddings, moderation, batches, and website widgets from one subscription.
Expose stable errors, request IDs, key status, usage headers, quota alerts, and renewal prompts inside customer software.
Agencies can use integrations, referral credit, and future marketplace packs to bring QFOXAI into client projects.
Ready-Made Downloads
Start faster with public-safe starter assets. Each file uses placeholder keys and QFOXAI public model aliases only.
Integration Paths
Pick the path closest to your product. QFOXAI keeps authentication, model aliases, quota headers, and errors consistent across all of them.
qf_... secret from your QFOXAI dashboard.https://qfoxai.com/v1 in your OpenAI-compatible client or backend.model for your configured default, or send an allowed alias from GET /v1/models.GET /v1/key to show renew or upgrade prompts.Use Laravel HTTP Client, store the key in .env, and call /chat/completions from your backend.
Use the OpenAI package with baseURL set to QFOXAI, or use the JavaScript starter.
Use the OpenAI Python package or the requests starter for background jobs and internal tools.
Generate replies, call notes, ticket summaries, customer tags, and next steps.
Draft invoice explanations, payment reminders, refund notes, and ledger descriptions.
Use Postman, n8n starter, or any OpenAI-compatible HTTP action with QFOXAI keys.
Use llms.txt, AGENTS.md, OpenAPI JSON, and the QFOXAI integration prompt to help coding agents connect correctly.
Analyze product images, screenshots, scanned content, and extracted document/code text from the same chat-completion workflow.
Browse Laravel, WordPress, WHMCS, WooCommerce, n8n, Make, Zapier, Open WebUI, Dify, LangChain, and LlamaIndex paths.
Move from OpenAI-compatible clients, Laravel apps, WordPress sites, and automation tools with simple settings.
Compare branded QFOXAI models by latency, cost settings, routing mode, and best use case.
Plugins And Add-Ons
Use these starter assets to make QFOXAI easier for non-technical customers and automation teams.
Download a single-file shortcode plugin. Add your QFOXAI key in WordPress settings and place [qfoxai_chat] on a page.
OpenStarter TypeScript node for workflows that summarize, classify, draft, or transform records with QFOXAI.
OpenCreate a branded assistant widget in the dashboard and paste one script tag on your website.
OpenDeveloper Cookbook
These recipes help customers build real features quickly: support tools, CRM actions, billing assistants, search, safety, and batch jobs.
POST /v1/chat/completions
Polite, context-aware customer response.
POST /v1/chat/completions
Visual summary, object description, OCR-style notes, or support-ready explanation.
POST /v1/chat/completions
Issue, next step, owner, and risk fields.
POST /v1/embeddings
Vectors for help center and document retrieval.
POST /v1/moderations
Safety decision before publishing or processing.
POST /v1/batches
Queued jobs for bulk summaries, drafts, and descriptions.
POST /v1/estimate
Estimated tokens, cost, and quota fit before large requests.
GET /v1/key
Upgrade, renew, and low-quota prompts in your app.
Go-Live Checklist
Use this before a customer project moves from testing to paid production traffic.
Run health, models, key status, and a small chat request from the API playground.
Test one image_url request and one extracted document/code text request if the customer workflow uses files.
Show remaining requests or tokens using response headers and GET /v1/key.
Handle 402, 429, and token_quota_exceeded by showing renew, upgrade, or add-credit actions.
Store X-QFOXAI-Request-ID with failed requests so support can trace customer issues.
Use moderation, IP allowlists, per-key limits, and backend-only secret storage.
Promote image, gallery, web context, file/vision, and batch workflows as paid customer value.
OpenAI-Compatible Client Settings
| Provider | OpenAI-compatible or Custom OpenAI |
| Base URL | https://qfoxai.com/v1 |
| API Key | qf_your_full_secret_key |
| Auth Mode | Bearer, OpenAI, or API key header |
| Model | Optional for direct HTTP requests. Omit it to use key, project, smart-routing, or platform defaults, or send an alias returned by GET /v1/models. |
- Use
https://qfoxai.com/v1as the base URL, nothttps://qfoxai.com/v1/chat/completions, when the client asks for a base URL. - Use the full API secret shown once after creating the key, not the key prefix or display name.
- Remove IP allowlist restrictions if the consuming app runs from a different server IP.
- Keep an active subscription on the user account that owns the API key.
Model Selection
Use stable QFOXAI public aliases only. The model catalog is filtered for the authenticated key, package, and account.
model is omitted
QFOXAI.model is provided
- An allowed public alias is honored exactly for that request.
- Keep public aliases such as
QFOXAIin client configuration. QFOXAI can change the private backend route without requiring customer code changes. - Use
GET /v1/modelswith the same key before showing a model picker. - A disabled or package-restricted alias returns
403 model_not_allowed. - Backend provider and machine model identifiers remain private.
curl "https://qfoxai.com/v1/models" \
-H "Authorization: Bearer qf_your_key"
Authentication
QFOXAI accepts Bearer auth and the common OpenAI-compatible API key header modes used by third-party tools.
| Header | Value | Use |
|---|---|---|
Authorization |
Bearer qf_your_key |
Recommended OpenAI-compatible mode. |
X-API-Key |
qf_your_key |
Supported for tools that use API key headers. |
api-key |
qf_your_key |
Supported for Azure/OpenAI-compatible clients. |
OpenAI-Api-Key |
qf_your_key |
Supported for apps that expose OpenAI header naming. |
Endpoints
Use /v1 for new integrations. /api/v1 remains available for older clients.
| Method | Endpoint | Description |
|---|---|---|
POST |
https://qfoxai.com/v1/chat/completionsChat completions |
OpenAI-compatible messages, safety checks, plan quotas, optional streaming. |
POST |
https://qfoxai.com/v1/chat/completionsVision and file workflows |
Analyze images with OpenAI-style image_url content parts, or send extracted document/code text as normal messages. |
POST |
https://qfoxai.com/v1/images/generationsImage generation |
Create photos, product visuals, campaigns, and exact-copy designs with selectable quality and shape. |
POST |
https://qfoxai.com/v1/estimateUsage estimate |
Estimate tokens, cost, and quota fit before sending a larger chat, image, or embedding request. |
POST |
https://qfoxai.com/v1/embeddingsEmbeddings |
Create deterministic vector embeddings for search, matching, and retrieval workflows. |
POST |
https://qfoxai.com/v1/moderationsModerations |
Check text against QFOXAI safety policy before sending it to chat or user workflows. |
GET |
https://qfoxai.com/v1/modelsModels |
Returns the public QFOXAI model aliases allowed for the authenticated key. |
GET |
https://qfoxai.com/v1/keyKey status |
Current API key status, daily limits, usage, subscription counters, expiry. |
POST |
https://qfoxai.com/v1/batchesBatch jobs |
Submit queued chat-completion jobs for background processing when batch API is enabled. |
GET |
https://qfoxai.com/v1/healthHealth |
Public service health check. No API key required. |
Chat Completions
The request body follows the OpenAI chat-completions shape. An allowed public alias is honored exactly. When model is omitted, QFOXAI applies the API-key default, project default, smart routing, and finally the platform default. Private service identifiers are never accepted as public model names.
modelOptional. Omit it for the configured default, or use an allowed public alias from GET /v1/models. An unavailable alias returns 403 model_not_allowed; QFOXAI never substitutes it silently.messagesArray of chat messages with role and content. Roles include system, user, and assistant.temperatureOptional number from 0 to 2.max_tokensOptional output cap. QFOXAI enforces the active plan maximum.streamOptional boolean. When true, QFOXAI returns Server-Sent Events.top_p, stop, presence_penalty, frequency_penaltyOptional OpenAI-compatible generation controls.Vision And File Workflows
Use chat completions for image understanding, screenshots, product photos, scanned documents, and document/code text workflows. For images, send OpenAI-compatible image_url content parts. For PDFs, DOC files, spreadsheets, logs, or source code, extract the useful text in your app and send it as normal message content or chunks.
curl -X POST "https://qfoxai.com/v1/chat/completions" \
-H "Authorization: Bearer qf_your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "QFOXAI",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "Explain this image for a product listing."},
{"type": "image_url", "image_url": {"url": "data:image/png;base64,BASE64_IMAGE_HERE"}}
]
}
],
"max_tokens": 700
}'
- Use
image_url.urlwith a data URL, raw base64 image, or a reachable HTTPS image URL. - For PDF, DOC, CSV, logs, or code files, extract text on your backend and send the relevant sections in
messages. - Chunk large documents and ask for one structured result per section to stay inside token limits.
- Use
POST /v1/estimatebefore large file-analysis requests so customers see quota impact before sending.
Image Generation
Create images from your application using the same QFOXAI API key and subscription limits. QFOXAI keeps private image infrastructure and routing details hidden; clients only use the public QFOXAI image label.
promptRequired text prompt describing the image to create.modelOptional. Use QFOXAI Image or omit it. QFOXAI routes the request internally.nOptional image count. QFOXAI caps this by platform settings and active plan controls.sizeOptional explicit dimensions. Package and quality limits cap the final output safely.modeOptional creative workflow: generate, banner, or product when enabled for API use.enhance_promptOptional boolean. QFOXAI can turn a short idea into a production-ready visual brief; the additional work is included in usage.qualityOptional: standard, hd, or ultra. The requested tier must be available on the active package; higher tiers return a higher token estimate.aspectOptional: square, portrait, landscape, story, or banner. Use auto to let QFOXAI choose.designOptional exact-copy object with brand, headline, subtitle, badge, cta, layout, and accent_color. Use this for readable campaign and product text.style, font_styleOptional creative direction and typography style. Availability follows the enabled QFOXAI image workflow.response_formatUse b64_json for direct image bytes or url for a data URL response.curl -X POST "https://qfoxai.com/v1/images/generations" \
-H "Authorization: Bearer qf_your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "QFOXAI Image",
"prompt": "Premium launch campaign for a blue smart speaker",
"n": 1,
"quality": "hd",
"aspect": "landscape",
"mode": "product",
"enhance_prompt": true,
"design": {
"brand": "NOVA AUDIO",
"headline": "Sound, Reimagined",
"subtitle": "Room-filling clarity in a compact design",
"badge": "NEW",
"cta": "Discover now",
"layout": "split",
"accent_color": "#2563EB"
},
"response_format": "b64_json"
}'
Cost And Quota Estimate
Use the estimate endpoint before large requests, customer previews, background jobs, or image workflows. It returns estimated tokens, estimated cost, current quota context, and whether the request fits the active plan.
curl -X POST "https://qfoxai.com/v1/estimate" \
-H "Authorization: Bearer qf_your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "QFOXAI",
"endpoint": "chat",
"messages": [
{"role": "user", "content": "Write a short support reply"}
],
"max_tokens": 300
}'
- Show estimated usage before a user starts a large generation.
- Warn users before a request exceeds their current plan or key limits.
- Use
X-QFOXAI-Estimated-Costand request IDs for logs and support. - Grant only the
usage.estimatescope when an integration only needs previews.
Embeddings
Use embeddings for search, matching, lightweight RAG, and document indexing. Requests use the same API key, subscription quota, and token accounting as other QFOXAI API calls.
curl -X POST "https://qfoxai.com/v1/embeddings" \
-H "Authorization: Bearer qf_your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "QFOXAI-Embeddings",
"input": "QFOXAI provides AI chat and API access.",
"dimensions": 384
}'
Moderation
Use the moderation endpoint to pre-check prompts, form submissions, support messages, or user-generated content before sending it into a production workflow.
curl -X POST "https://qfoxai.com/v1/moderations" \
-H "Authorization: Bearer qf_your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "QFOXAI-Moderation",
"input": "Text to review before publishing"
}'
Examples
curl -X POST "https://qfoxai.com/v1/chat/completions" \
-H "Authorization: Bearer qf_your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "QFOXAI",
"messages": [
{"role": "user", "content": "Write a short support reply"}
],
"temperature": 0.7,
"max_tokens": 800
}'
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.QFOXAI_API_KEY,
baseURL: "https://qfoxai.com/v1"
});
const response = await client.chat.completions.create({
model: "QFOXAI",
messages: [{ role: "user", content: "Hello QFOXAI" }]
});
console.log(response.choices[0].message.content);
from openai import OpenAI
client = OpenAI(
api_key="qf_your_key",
base_url="https://qfoxai.com/v1"
)
response = client.chat.completions.create(
model="QFOXAI",
messages=[{"role": "user", "content": "Hello QFOXAI"}],
)
print(response.choices[0].message.content)
use Illuminate\Support\Facades\Http;
$response = Http::withToken(config('services.qfoxai.key'))
->acceptJson()
->post('https://qfoxai.com/v1/chat/completions', [
'model' => 'QFOXAI',
'messages' => [
['role' => 'user', 'content' => 'Hello QFOXAI'],
],
]);
$answer = $response->json('choices.0.message.content');
Streaming
Set stream to true. QFOXAI returns chat.completion.chunk events and ends with [DONE].
{
"model": "QFOXAI",
"stream": true,
"messages": [
{"role": "user", "content": "Stream a short answer"}
]
}
Batch API
Use batch jobs for non-live work such as summaries, product descriptions, drafts, and background customer tasks. Batch requests use the same authentication, public model aliases, quotas, and safety controls as chat completions.
curl -X POST "https://qfoxai.com/v1/batches" \
-H "Authorization: Bearer qf_your_key" \
-H "Content-Type: application/json" \
-d '{
"endpoint": "/v1/chat/completions",
"completion_window": "24h",
"requests": [
{
"custom_id": "job-1",
"method": "POST",
"url": "/v1/chat/completions",
"body": {
"model": "QFOXAI",
"messages": [
{"role": "user", "content": "Write a short welcome email"}
],
"max_tokens": 300
}
}
]
}'
curl "https://qfoxai.com/v1/batches/{batch_id}" \
-H "Authorization: Bearer qf_your_key"
| Create | POST /v1/batches |
| List | GET /v1/batches |
| Retrieve | GET /v1/batches/{batch_id} |
| Cancel | POST /v1/batches/{batch_id}/cancel |
- Keep each item small enough for your active plan limits.
- Use
custom_idto match results back to your own records. - Use chat completions for live UI responses; use batches for background jobs.
- Retrieve a completed batch to read
results.datawith each item matched bycustom_id. - Enable webhooks for
batch.completedandbatch.failedwhen your app needs push notifications.
Limits, Usage, And Headers
Controls
| Monthly requests | Enforced from the active subscription. |
| Monthly tokens | Raw input, output, and image usage is recorded. When weighted billing is enabled, the billable amount shown in headers is applied to quota. |
| Cached input | Eligible repeated deterministic requests can receive a lower cached-input weight while still reporting raw input usage. |
| Output + model weight | Output and enabled QFOXAI model classes can use different quota multipliers. Use billing headers instead of recalculating this in the client. |
| Image usage | Image count, dimensions, workflow, quality steps, refinement, and prompt enhancement affect estimated and billable usage. |
| Max output tokens | max_tokens is capped by the active plan. |
| Daily key limits | Each key can have daily request and token limits. |
| Per-minute speed | System can control requests-per-minute and tokens-per-minute by plan, subscription, or individual key. |
| IP allowlist | Keys can be restricted to specific IP addresses or CIDR blocks. |
Response Headers
X-QFOXAI-Model | Public model alias returned by QFOXAI. |
X-QFOXAI-Request-ID | Request identifier to share with support when troubleshooting. |
X-QFOXAI-API-Version | Current public API lifecycle version. |
X-QFOXAI-Cache | Shows hit, miss, stored, or bypass when deterministic response caching applies. |
X-QFOXAI-Billing-Mode | Shows whether quota uses simple, shadow, or weighted token accounting. |
X-QFOXAI-Input-Tokens / X-QFOXAI-Output-Tokens | Raw input and output usage measured for the request. |
X-QFOXAI-Billable-Tokens | Token amount applied to quota after cache, output, image, and model weighting. |
X-QFOXAI-Estimated-Cost | Estimated platform cost for the request, when available. |
X-QFOXAI-Estimated-Tokens | Estimated token count returned by the usage estimate endpoint. |
X-RateLimit-Limit | Per-minute request limit for this key. |
X-RateLimit-Remaining | Remaining requests in the current minute window. |
X-Key-Token-Rate-Limit | Per-minute token throughput limit, when configured. |
X-Key-Token-Rate-Remaining | Estimated token throughput remaining in the current minute. |
X-Subscription-Request-Limit | Monthly subscription request allowance, when configured. |
X-Subscription-Requests-Remaining | Estimated monthly requests remaining after the call. |
X-Subscription-Token-Limit | Monthly subscription token allowance, when configured. |
X-Subscription-Tokens-Remaining | Estimated monthly tokens remaining after the call. |
X-Key-Daily-Request-Limit / X-Key-Daily-Token-Limit | Per-key daily controls, when configured. |
Deprecation / Sunset / X-QFOXAI-API-Notice | Optional lifecycle warning headers before a future API behavior change. |
The JSON usage object and input/output headers describe measured work.
X-QFOXAI-Billable-Tokens is the authoritative quota deduction when weighted billing is active.
Use X-QFOXAI-Cache for observability. Never assume every repeated request is cacheable.
curl "https://qfoxai.com/v1/key" \
-H "Authorization: Bearer qf_your_key"
API Lifecycle Notices
QFOXAI keeps the public API version branded and stable. When a future behavior change needs client action, system can enable lifecycle notices without changing integration code.
X-QFOXAI-API-Version | Current public API version. |
X-QFOXAI-Request-ID | Support/debug identifier for the request. |
Link | Optional lifecycle and documentation links when configured. |
Deprecation | Set when an API behavior is scheduled to change. |
Sunset | RFC-style date when the old behavior may end. |
X-QFOXAI-API-Notice | Short human-readable migration note. |
Error Format
Errors return JSON with a stable error.type field so clients can show renew, upgrade, retry, or support actions.
{
"error": {
"message": "Invalid API key.",
"type": "auth_error",
"code": "auth_error",
"param": null,
"request_id": "req_...",
"support_url": "https://qfoxai.com/docs/api",
"details": {}
}
}
| Status | Type | Meaning |
|---|---|---|
401 |
auth_error |
Missing, malformed, revoked, or incorrect API key. |
402 |
subscription_error / subscription_expired |
No active subscription, or the subscription has expired. |
403 |
model_not_allowed / ip_not_allowed / key_expired / account_suspended |
The requested model is unavailable to this key, or account, IP, and expiry controls block access. |
422 |
max_tokens_exceeded |
Requested max_tokens is higher than the active plan allows. |
429 |
rate_limit_exceeded / daily_*_limit_exceeded / token_quota_exceeded |
Plan, key, or per-minute usage limit reached. |
502 |
service_unavailable |
QFOXAI could not complete the request due to a temporary AI service issue. |
Service Availability
If QFOXAI returns a temporary service error, the request was accepted but could not be completed at that moment. Retry shortly, reduce the request size, or contact support if it continues.
| Status | 502 |
| Error type | service_unavailable |
| Retry | Wait briefly, then resend the request. |
| Request size | Use a smaller prompt or lower max_tokens for very large jobs. |
- Confirm your API key and subscription are active before retrying.
- Use a public model alias returned by
GET /v1/models. - Retry after a short delay if the request is valid.
- Reduce
max_tokensand context size for large requests. - Contact support with the timestamp and endpoint if the error repeats.
curl "https://qfoxai.com/v1/chat/completions" \
-H "Authorization: Bearer qf_your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "QFOXAI",
"messages": [{"role": "user", "content": "Say hello"}],
"max_tokens": 120
}'