OpenAI-compatible Protected keys Streaming ready Measured usage

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.

Base URL
https://qfoxai.com/v1
Default Model
QFOXAI
Auth Header
Bearer qf_...
Legacy Alias
https://qfoxai.com/api/v1

Quick Start

Use these four settings in any OpenAI-compatible app, AI Studio, Laravel package, WordPress plugin, or custom backend.

Base URL

https://qfoxai.com/v1

API Key

Paste the full qf_... secret only. Do not paste the word Bearer into API key fields that add it automatically.

Model

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.

HealthConfirms the QFOXAI API is reachable from your account.
ModelsLists the public model aliases your API key can use.
Key statusShows active key state, quota details, and subscription access.
Chat requestSends one small prompt to confirm the integration is ready.
Open API Playground

Customer Growth Toolkit

QFOXAI is easier to sell when developers can connect quickly and customers can see practical business outcomes immediately.

Launch in one afternoon

Use API keys, Postman, SDK starters, Laravel package notes, and the API playground before writing custom code.

Sell more than chat

Offer chat, image generation, vision, attachments, embeddings, moderation, batches, and website widgets from one subscription.

Build customer trust

Expose stable errors, request IDs, key status, usage headers, quota alerts, and renewal prompts inside customer software.

Grow through partners

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.

Safe placeholders

Integration Paths

Pick the path closest to your product. QFOXAI keeps authentication, model aliases, quota headers, and errors consistent across all of them.

Create keyGenerate a full qf_... secret from your QFOXAI dashboard.
Set base URLUse https://qfoxai.com/v1 in your OpenAI-compatible client or backend.
Select modelOmit model for your configured default, or send an allowed alias from GET /v1/models.
Track usageRead quota headers and GET /v1/key to show renew or upgrade prompts.
Laravel Apps

Use Laravel HTTP Client, store the key in .env, and call /chat/completions from your backend.

Next.js / Node

Use the OpenAI package with baseURL set to QFOXAI, or use the JavaScript starter.

Python Services

Use the OpenAI Python package or the requests starter for background jobs and internal tools.

CRM + Helpdesk

Generate replies, call notes, ticket summaries, customer tags, and next steps.

Finance + Billing

Draft invoice explanations, payment reminders, refund notes, and ledger descriptions.

Automation Tools

Use Postman, n8n starter, or any OpenAI-compatible HTTP action with QFOXAI keys.

AI Coding Agents

Use llms.txt, AGENTS.md, OpenAPI JSON, and the QFOXAI integration prompt to help coding agents connect correctly.

Vision + Attachments

Analyze product images, screenshots, scanned content, and extracted document/code text from the same chat-completion workflow.

Integration Marketplace

Browse Laravel, WordPress, WHMCS, WooCommerce, n8n, Make, Zapier, Open WebUI, Dify, LangChain, and LlamaIndex paths.

Migration Guides

Move from OpenAI-compatible clients, Laravel apps, WordPress sites, and automation tools with simple settings.

Model Benchmarks

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.

Add-on starters
Plugin file
WordPress Chat Starter

Download a single-file shortcode plugin. Add your QFOXAI key in WordPress settings and place [qfoxai_chat] on a page.

Open
Automation
n8n Node Starter

Starter TypeScript node for workflows that summarize, classify, draft, or transform records with QFOXAI.

Open
No-code embed
Website Widget

Create a branded assistant widget in the dashboard and paste one script tag on your website.

Open

Developer Cookbook

These recipes help customers build real features quickly: support tools, CRM actions, billing assistants, search, safety, and batch jobs.

Support reply
POST /v1/chat/completions

Polite, context-aware customer response.

Image understanding
POST /v1/chat/completions

Visual summary, object description, OCR-style notes, or support-ready explanation.

CRM summary
POST /v1/chat/completions

Issue, next step, owner, and risk fields.

Knowledge search
POST /v1/embeddings

Vectors for help center and document retrieval.

Content pre-check
POST /v1/moderations

Safety decision before publishing or processing.

Background drafts
POST /v1/batches

Queued jobs for bulk summaries, drafts, and descriptions.

Cost preview
POST /v1/estimate

Estimated tokens, cost, and quota fit before large requests.

Quota-aware UI
GET /v1/key

Upgrade, renew, and low-quota prompts in your app.

For enterprise customers, combine API keys, per-key limits, webhooks, usage alerts, and support workflows to create a complete provider-style integration experience.

Go-Live Checklist

Use this before a customer project moves from testing to paid production traffic.

Connection test

Run health, models, key status, and a small chat request from the API playground.

Vision and attachments

Test one image_url request and one extracted document/code text request if the customer workflow uses files.

Usage UI

Show remaining requests or tokens using response headers and GET /v1/key.

Upgrade path

Handle 402, 429, and token_quota_exceeded by showing renew, upgrade, or add-credit actions.

Support workflow

Store X-QFOXAI-Request-ID with failed requests so support can trace customer issues.

Safety controls

Use moderation, IP allowlists, per-key limits, and backend-only secret storage.

Revenue add-ons

Promote image, gallery, web context, file/vision, and batch workflows as paid customer value.

OpenAI-Compatible Client Settings

AI Studio / Laravel / OpenAI SDK
ProviderOpenAI-compatible or Custom OpenAI
Base URLhttps://qfoxai.com/v1
API Keyqf_your_full_secret_key
Auth ModeBearer, OpenAI, or API key header
ModelOptional for direct HTTP requests. Omit it to use key, project, smart-routing, or platform defaults, or send an alias returned by GET /v1/models.
Common mistakes
  • Use https://qfoxai.com/v1 as the base URL, not https://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.

Default: QFOXAI
When model is omitted
1. API key defaultThe model saved on that key is used first.
2. Project defaultIf the key belongs to a project, its configured model is next.
3. Smart route or defaultWhen enabled, routing chooses an allowed alias for the workload; otherwise QFOXAI uses QFOXAI.
When model is provided
  • An allowed public alias is honored exactly for that request.
  • Keep public aliases such as QFOXAI in client configuration. QFOXAI can change the private backend route without requiring customer code changes.
  • Use GET /v1/models with 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.
Published aliases
QFOXLITE QFOXAI
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.

HeaderValueUse
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.

MethodEndpointDescription
POST https://qfoxai.com/v1/chat/completions
Chat completions
OpenAI-compatible messages, safety checks, plan quotas, optional streaming.
POST https://qfoxai.com/v1/chat/completions
Vision 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/generations
Image generation
Create photos, product visuals, campaigns, and exact-copy designs with selectable quality and shape.
POST https://qfoxai.com/v1/estimate
Usage estimate
Estimate tokens, cost, and quota fit before sending a larger chat, image, or embedding request.
POST https://qfoxai.com/v1/embeddings
Embeddings
Create deterministic vector embeddings for search, matching, and retrieval workflows.
POST https://qfoxai.com/v1/moderations
Moderations
Check text against QFOXAI safety policy before sending it to chat or user workflows.
GET https://qfoxai.com/v1/models
Models
Returns the public QFOXAI model aliases allowed for the authenticated key.
GET https://qfoxai.com/v1/key
Key status
Current API key status, daily limits, usage, subscription counters, expiry.
POST https://qfoxai.com/v1/batches
Batch jobs
Submit queued chat-completion jobs for background processing when batch API is enabled.
GET https://qfoxai.com/v1/health
Health
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.

Vision request
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
  }'
Practical attachment pattern
  • Use image_url.url with 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/estimate before 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.
Image request
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.

Estimate request
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
  }'
Best for customer apps
  • 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-Cost and request IDs for logs and support.
  • Grant only the usage.estimate scope 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.

Embeddings request
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.

Moderation request
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
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
  }'
JavaScript SDK
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);
Python SDK
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)
Laravel HTTP Client
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].

Streaming request
{
  "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.

Create batch
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
        }
      }
    ]
  }'
Retrieve results
curl "https://qfoxai.com/v1/batches/{batch_id}" \
  -H "Authorization: Bearer qf_your_key"
Batch endpoints
CreatePOST /v1/batches
ListGET /v1/batches
RetrieveGET /v1/batches/{batch_id}
CancelPOST /v1/batches/{batch_id}/cancel
  • Keep each item small enough for your active plan limits.
  • Use custom_id to 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.data with each item matched by custom_id.
  • Enable webhooks for batch.completed and batch.failed when your app needs push notifications.

Limits, Usage, And Headers

Controls

Monthly requestsEnforced from the active subscription.
Monthly tokensRaw input, output, and image usage is recorded. When weighted billing is enabled, the billable amount shown in headers is applied to quota.
Cached inputEligible repeated deterministic requests can receive a lower cached-input weight while still reporting raw input usage.
Output + model weightOutput and enabled QFOXAI model classes can use different quota multipliers. Use billing headers instead of recalculating this in the client.
Image usageImage count, dimensions, workflow, quality steps, refinement, and prompt enhancement affect estimated and billable usage.
Max output tokensmax_tokens is capped by the active plan.
Daily key limitsEach key can have daily request and token limits.
Per-minute speedSystem can control requests-per-minute and tokens-per-minute by plan, subscription, or individual key.
IP allowlistKeys can be restricted to specific IP addresses or CIDR blocks.

Response Headers

X-QFOXAI-ModelPublic model alias returned by QFOXAI.
X-QFOXAI-Request-IDRequest identifier to share with support when troubleshooting.
X-QFOXAI-API-VersionCurrent public API lifecycle version.
X-QFOXAI-CacheShows hit, miss, stored, or bypass when deterministic response caching applies.
X-QFOXAI-Billing-ModeShows whether quota uses simple, shadow, or weighted token accounting.
X-QFOXAI-Input-Tokens / X-QFOXAI-Output-TokensRaw input and output usage measured for the request.
X-QFOXAI-Billable-TokensToken amount applied to quota after cache, output, image, and model weighting.
X-QFOXAI-Estimated-CostEstimated platform cost for the request, when available.
X-QFOXAI-Estimated-TokensEstimated token count returned by the usage estimate endpoint.
X-RateLimit-LimitPer-minute request limit for this key.
X-RateLimit-RemainingRemaining requests in the current minute window.
X-Key-Token-Rate-LimitPer-minute token throughput limit, when configured.
X-Key-Token-Rate-RemainingEstimated token throughput remaining in the current minute.
X-Subscription-Request-LimitMonthly subscription request allowance, when configured.
X-Subscription-Requests-RemainingEstimated monthly requests remaining after the call.
X-Subscription-Token-LimitMonthly subscription token allowance, when configured.
X-Subscription-Tokens-RemainingEstimated monthly tokens remaining after the call.
X-Key-Daily-Request-Limit / X-Key-Daily-Token-LimitPer-key daily controls, when configured.
Deprecation / Sunset / X-QFOXAI-API-NoticeOptional lifecycle warning headers before a future API behavior change.
Raw usage

The JSON usage object and input/output headers describe measured work.

Billable usage

X-QFOXAI-Billable-Tokens is the authoritative quota deduction when weighted billing is active.

Cache-aware

Use X-QFOXAI-Cache for observability. Never assume every repeated request is cacheable.

Key status
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.

Always available
X-QFOXAI-API-VersionCurrent public API version.
X-QFOXAI-Request-IDSupport/debug identifier for the request.
LinkOptional lifecycle and documentation links when configured.
Optional change warning
DeprecationSet when an API behavior is scheduled to change.
SunsetRFC-style date when the old behavior may end.
X-QFOXAI-API-NoticeShort 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 response shape
{
  "error": {
    "message": "Invalid API key.",
    "type": "auth_error",
    "code": "auth_error",
    "param": null,
    "request_id": "req_...",
    "support_url": "https://qfoxai.com/docs/api",
    "details": {}
  }
}
StatusTypeMeaning
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.

Recommended client response
Status502
Error typeservice_unavailable
RetryWait briefly, then resend the request.
Request sizeUse a smaller prompt or lower max_tokens for very large jobs.
Client checklist
  • 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_tokens and context size for large requests.
  • Contact support with the timestamp and endpoint if the error repeats.
Retry example
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
  }'