QwQ AI / API v1

API documentation

Connect QwQ AI web answers, deep research and financial research to your application. Pay from your wallet at the same prices as the website.

Quick start

Sign in, create an API key from your profile, and recharge your balance. Send Authorization: Bearer QWQ_API_KEY. Store the key in a server environment variable.

export QWQ_API_KEY='qwq_your_key_here'

curl https://qwq32.com/api/v1/answer \
  -H "Authorization: Bearer $QWQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "What causes the aurora borealis?"
}'

Base URL: https://qwq32.com/api/v1

Available endpoints

EndpointPurpose
POST /api/v1/answerFast web answers with citations and search results.
POST /api/v1/researchFive research depths, with source controls and structured JSON.
POST /api/v1/finance_researchFinancial research at Deep and Exhaustive levels.
GET /api/v1/research/{task_id}Retrieve a background task; polling is free and restricted to your own tasks.

Parameters and examples

Answer

query is required, nonblank and limited to 400 characters. Optional fields: freshness (day/week/month/year or YYYY-MM-DDtoYYYY-MM-DD), country, language, safesearch and include_domains / exclude_domains / boost_domains. Each domain list supports up to 500 items. include_domains cannot be combined with either other list. Use country and language codes supported by You.com.

curl https://qwq32.com/api/v1/answer \
  -H "Authorization: Bearer $QWQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "Recent advances in renewable energy",
  "freshness": "month",
  "language": "EN",
  "safesearch": "moderate",
  "include_domains": [
    "energy.gov"
  ]
}'

Research

input is required, nonblank and limited to 40,000 characters. research_effort: lite, standard (default), deep, exhaustive, frontier. source_control supports domain lists, freshness and country with the same domain combination rules as Answer. background is optional. Request the answer language in input.

curl https://qwq32.com/api/v1/research \
  -H "Authorization: Bearer $QWQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": "Compare three battery technologies. Respond in Chinese.",
  "research_effort": "deep",
  "background": true,
  "source_control": {
    "freshness": "year",
    "exclude_domains": [
      "example.com"
    ]
  }
}'

Optional output_schema uses the You.com JSON Schema subset to return an object in output.content; lite is unsupported. The root must be an object, all objects require additionalProperties:false, and all properties must be required. Upstream validates schema structure, depth and property limits. Failed requests are refunded.

Finance Research

input is required, nonblank and limited to 40,000 characters. research_effort supports only deep (default) and exhaustive. Finance is synchronous and may take up to about six minutes.

curl https://qwq32.com/api/v1/finance_research \
  -H "Authorization: Bearer $QWQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": "Analyze the latest NVIDIA earnings and cite sources.",
  "research_effort": "deep"
}'

Unknown fields are rejected. The request body limit is 180,000 bytes. You cannot specify the account, price or upstream API key.

Synchronous responses

HTTP 200 preserves Answer fields answer, citations and results and adds billing with the cost, request ID and balance after the debit. Amounts are USD; one wallet unit equals $0.0000001.

{
  "answer": "A cited answer [[1]]",
  "citations": [
    {
      "source": "https://example.com",
      "excerpts": [
        "Supporting evidence"
      ]
    }
  ],
  "results": {
    "web": []
  },
  "billing": {
    "request_id": "uuid",
    "cost_usd": 0.02,
    "cost_units": 200000,
    "balance_usd": 9.98
  }
}

Research and Finance return output.content, output.content_type, output.sources and billing. Citation [[1]] refers to the first source. Structured Research returns a JSON object in output.content.

Background research and retrieval

Research deep, exhaustive and frontier automatically use background mode and return HTTP 202. Enable it for lite or standard with background:true. Save the QwQ task_id and retrieve the result within 24 hours. The submission is charged once; polling adds no charge.

{
  "task_id": "qwq-task-uuid",
  "status": "queued",
  "expires_at": "2026-10-04T00:00:00.000Z",
  "billing": {
    "request_id": "qwq-task-uuid",
    "cost_usd": 0.3,
    "cost_units": 3000000,
    "balance_usd": 9.7
  }
}
curl https://qwq32.com/api/v1/research/QWQ_TASK_ID \
  -H "Authorization: Bearer $QWQ_API_KEY"

Poll every 5–15 seconds. States are submitting, queued, running, completed or failed. Read result.output on completed; failed includes QUERY_FAILED_REFUNDED. Any active key on the owning account can retrieve the task. Transient polling failures can be retried and do not refund running tasks.

{
  "task_id": "qwq-task-uuid",
  "status": "completed",
  "expires_at": "2026-10-04T00:00:00.000Z",
  "result": {
    "output": {
      "content": "A researched report [[1]]",
      "content_type": "text",
      "sources": [
        {
          "url": "https://example.com",
          "title": "Source"
        }
      ]
    }
  }
}

Server integration examples

JavaScript / Node.js

const response = await fetch("https://qwq32.com/api/v1/answer", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.QWQ_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ query: "What causes the aurora borealis?" }),
});
const data = await response.json();
if (!response.ok) throw new Error(data.code);
console.log(data.answer, data.billing.cost_usd);

Python / requests

import os
import requests

response = requests.post(
    "https://qwq32.com/api/v1/finance_research",
    headers={"Authorization": f"Bearer {os.environ['QWQ_API_KEY']}"},
    json={"input": "Analyze NVIDIA earnings", "research_effort": "deep"},
    timeout=370,
)
response.raise_for_status()
print(response.json()["output"]["content"])

Per-call pricing

Prices come from the same configuration as the website. API and website calls share your wallet. We debit before execution and refund failures exactly once. Expired unfinished research tasks are also automatically refunded. Minimum recharge: $10. No subscriptions.

Tool / effortPer call (USD)
answer$0.02
research / lite$0.04
research / standard$0.15
research / deep$0.30
research / exhaustive$1.35
research / frontier$3.60
finance / deep$0.35
finance / exhaustive$1.50
Recharge balance →

Error handling

Errors return JSON with a code field describing the failure.

400 / 413
INVALID_REQUEST / QUERY_TOO_LONG: Invalid parameters or oversized body. No charge.
401
INVALID_API_KEY: Missing, incorrect or revoked key.
402
INSUFFICIENT_BALANCE: Not enough balance; the upstream service is not called.
404 / 410
JOB_NOT_FOUND / JOB_EXPIRED: Unknown task, another account’s task or an expired task.
502 / 503
QUERY_FAILED_REFUNDED: The request failed and was refunded. JOB_POLL_FAILED: Temporary polling failure; retry. SERVICE_UNAVAILABLE / BILLING_UNAVAILABLE: Service unavailable; billing may still need reconciliation, so check usage history first.

Each new POST is a new paid query; query idempotency replay is unsupported. Check usage after a timeout or billing error. If you know the task ID, retry only GET polling.

Privacy and records

Only a SHA-256 hash of each key is stored. Keys are shown once and can be revoked. Usage history shows the latest 100 charged calls with tool, effort, cost, state and key name. This site stores no questions, answers or reports. The upstream temporarily retains background results; retrieve them promptly and save them in your own system.