Quick Start
Quan 3.5 uses the same endpoint as every Quan model: https://stockup.cc/v1/query. Create a key in the StockUp Developer Console, add a prepaid balance, pass the key in the x-api-key header, and send OpenAI-style chat messages in JSON. Only the model field changes from a Quan 3.4 request.
curl -X POST https://stockup.cc/v1/query \
-H "Content-Type: application/json" \
-H "x-api-key: STOCKUP_API_KEY" \
-d '{
"model": "quan-3.5",
"messages": [
{
"role": "user",
"content": "Compare AAPL and MSFT valuation today. Separate confirmed data from interpretation."
}
],
"stream": false,
"webSearch": true,
"temperature": 0.2
}'
The response has the same shape as Quan 3.4: read the answer from candidates[0].content.parts[0].text. The X-Quan-Model-Version response header is 3.5 when Quan 3.5 served the request.
Pricing
| Model ID | Input per 1M tokens | Output per 1M tokens | Notes |
|---|---|---|---|
quan-3.5 |
$5.50 | $28.00 | From November 1, 2026. Prepaid balance required; no free allowance. |
quan-3.4 |
$2.50 until December 14, 2026; $3.00 from December 15, 2026 | $15.00 until December 14, 2026; $18.00 from December 15, 2026 | Behaviour unchanged by this release. |
quan-3.4-l |
$0.75 | $4.50 | Unchanged. 100,000 free tokens for verified developers. |
Billing: output tokens include the thinking tokens the model provider reports, as with every Quan model. Executed web searches cost $0.007 each. Each request is checked against your balance before the model runs, so a request your balance cannot fund returns 402 and is not generated.
Rates only, for comparison: a request that uses 2,000 input tokens and 6,000 output tokens costs $0.179 on quan-3.5, $0.095 on quan-3.4 ($0.114 from December 15) and $0.0285 on quan-3.4-l before any free allowance. The same question does not use the same number of tokens on every model, so measure your own traffic before comparing costs.
Which Model Should You Call?
| Model ID | Use It When |
|---|---|
quan-3.5 |
You want the behaviour described in the next section: context carried across conversation turns, the latest reported results attached from SEC filings, multi-part questions answered section by section, answer styles, and checked short answers to everyday questions. It has the highest per-token price of the three. |
quan-3.4 |
You have an integration built on Quan 3.4’s current behaviour, including streaming by default. Its behaviour is not changing with this release; its price changes on December 15, 2026. |
quan-3.4-l |
Cost matters most. It runs at a fixed low reasoning level, has the lowest price of the three, and includes a free allowance. |
What Changes From Quan 3.4
Quan 3.5 keeps Quan 3.4’s request and response format. The differences below are the ones an integration can observe.
Integration differences
- Streaming is opt-in. Quan 3.5 returns one JSON response unless the request sends
"stream": true. Quan 3.4 streams unless the request sends"stream": false. Sendstreamexplicitly in both cases. - Parameters are validated.
temperaturemust be 0 to 2,topP/top_p0 to 1, andtopK/top_kan integer from 1 to 1000. A value outside its range, or one that is not a number, returns400 INVALID_PARAMETERwithparameterandreceivedin the body, before any model call. - Smaller response body.
thoughtSignatureis removed from response parts andresponseIdfrom the payload.
Reasoning depth by question type
Everyday questions — a price, key figures, news, earnings, dividends, analyst views, what a company does, comparisons, funds, upcoming events, the economy and the Fed, the market, a sector, or explaining a concept — and “why is this stock moving” questions are answered at a lower reasoning level in a short format. Before the answer is returned, it is checked against the data the server retrieved for the request, and it is rewritten if it fails the check. Opinion, forecast, portfolio and multi-part questions keep the full reasoning path. The X-Quan-Thinking-Level header reports the level used.
Grounding and context
- Latest reported results. For analytical questions about a single company, the most recently reported period is read from the company’s SEC filings and given to the model.
X-Quan-Latest-Earnings: attachedshows when this happened. If the lookup fails, the request continues without it. - Conversation history. A ticker named in an earlier user message is used when the current message refers back to it. Limits stated in earlier user messages, such as a maximum position size, are carried forward. They come from user turns only, and a value in the request’s
constraintsfield or in the current message always wins.X-Quan-Carried-Constraintslists any limits carried forward. - Portfolios in the question. Holdings written in the question text, such as “40% NVDA, 30% MSFT, 30% TLT”, are used as the portfolio when the request has no
portfoliofield. Each symbol is still checked against price history. - Technical figures. For tickers in the question, moving averages, the 52-week range and average volume are computed from the verified daily price series.
Calculations and unknowns
With Decision Intelligence enabled for the key:
- A question with several parts is split, and each part is grounded and answered separately.
X-Quan-Multi-Intent-Sectionsgives the number of sections. - Reported allocation weights never sum past 100%.
- Risk figures use the standard Sortino denominator, Wilder’s RSI and compounded portfolio returns. The risk-free rate used is reported and marked when it is an assumption.
- DCF inputs stated plainly in the question are accepted, including the horizon and cash-flow timing, and a single-stage model is allowed.
A balance the user describes as unknown is never treated as cash. A request to treat it as cash is refused before any search or model call, with an X-Quan-Truth-Guard header and a quanTruthGuard object in the response. When cash is unknown, a sale counts in full against a one-day turnover limit.
Answer styles
Quan 3.5 accepts an optional answerStyle field. balanced (the default) and simple lead with the overall view in everyday words and explain finance terms; simple uses shorter sentences. advanced keeps the institutional write-up. Figures and checks are the same in every style. The X-Quan-Answer-Style header reports the style used.
{
"model": "quan-3.5",
"messages": [
{ "role": "user", "content": "Is my portfolio of 40% NVDA, 30% MSFT, 30% TLT too concentrated?" }
],
"stream": false,
"answerStyle": "simple"
}
JavaScript Example
This is the basic pattern for a Node.js backend, serverless function, or agent tool wrapper. Keep the API key on the server side rather than shipping it to a browser client.
const response = await fetch("https://stockup.cc/v1/query", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": process.env.STOCKUP_API_KEY
},
body: JSON.stringify({
model: "quan-3.5",
messages: [
{
role: "user",
content: "Summarize the most recent reported quarter for Microsoft."
}
],
stream: false,
webSearch: true,
temperature: 0.2
})
});
if (!response.ok) {
const error = await response.json().catch(() => null);
throw new Error(`${response.status} ${error?.code || ""} ${error?.error || ""}`);
}
const data = await response.json();
const answer = data?.candidates?.[0]?.content?.parts?.[0]?.text;
console.log(answer);
console.log("charge (USD):", response.headers.get("X-StockUp-Charge"));
Python Example
Python works well for research notebooks, batch checks, Slack bots, and internal analyst tools.
import os
import requests
payload = {
"model": "quan-3.5",
"messages": [
{
"role": "user",
"content": "Explain the difference between P/E and forward P/E."
}
],
"stream": False,
"temperature": 0.2
}
res = requests.post(
"https://stockup.cc/v1/query",
headers={
"Content-Type": "application/json",
"x-api-key": os.environ["STOCKUP_API_KEY"]
},
json=payload,
timeout=120
)
res.raise_for_status()
data = res.json()
print(data["candidates"][0]["content"]["parts"][0]["text"])
print("charge (USD):", res.headers.get("X-StockUp-Charge"))
Streaming Responses
Set stream to true for a chat UI or agent that should show partial output. The API returns server-sent events in the same format as other models: data: lines carrying JSON chunks, then data: [DONE].
curl -N -X POST https://stockup.cc/v1/query \
-H "Content-Type: application/json" \
-H "x-api-key: STOCKUP_API_KEY" \
-d '{
"model": "quan-3.5",
"messages": [
{
"role": "user",
"content": "Build a concise bullish and bearish thesis for AMZN using current market context."
}
],
"stream": true,
"webSearch": true
}'
- Billing on a stream. The
X-StockUp-billing headers are not sent on a stream, because headers go out before the charge is known. Read theevent: billingframe instead. It arrives beforedata: [DONE]and carriescharge,searchCharge,searchQueries,remainingBalance,billingModeandrequestId. If settlement fails, the stream sendsevent: errorwithBILLING_SETTLEMENT_FAILEDand therequestId. - Checked answers. Everyday and “why is this stock moving” answers are held back until the answer check finishes, so their text can arrive in a single chunk near the end of the stream.
The end of a stream looks like this (values are illustrative):
event: billing
data: {"requestId":"...","billingMode":"cash","charge":0.179,"searchCharge":0,"searchQueries":0,"remainingBalance":24.821,...}
data: [DONE]
Response and Billing Headers
| Header | Meaning |
|---|---|
X-Quan-Model-Version |
3.5 when the request was served by Quan 3.5. |
X-StockUp-Model |
The model id as sent, lowercased: quan-3.5 or quan-3-5. |
X-Quan-Thinking-Level |
The reasoning level used: HIGH, MEDIUM or LOW. |
X-StockUp-Charge |
Total charged for the request in USD, tokens plus searches, to six decimal places. |
X-StockUp-Search-Charge, X-StockUp-Search-Queries |
The search part of the charge and the number of executed searches charged. |
X-StockUp-Balance |
Prepaid balance in USD after this request. |
X-StockUp-Billing-Mode |
The billing path used for the request. |
X-Quan-Answer-Style |
The answer style used: balanced, simple or advanced. |
X-Quan-Cache |
hit when the answer came from Quan’s response cache, otherwise miss. |
X-Request-Id |
Quote this when you contact support about a request. |
Errors
| Response | Cause | Fix |
|---|---|---|
400 INVALID_PARAMETER |
temperature, topP or topK is not a number or is outside its range. |
Send a value inside the range, or omit the parameter. |
400 INSUFFICIENT_OUTPUT_BUDGET |
The request needs the model to do a calculation itself and maxOutputTokens is too small. Not billed. |
Resend with maxOutputTokens at or above requiredMaxOutputTokens. |
400 Unknown model... |
Typo in the model field. |
Use exactly quan-3.5 or quan-3-5. |
402 PREPAID_BALANCE_REQUIRED |
The account has no prepaid balance. Quan 3.5 has no free allowance. | Add a prepaid balance in the Developer Console. |
402 INSUFFICIENT_RESPONSE_BUDGET |
The balance cannot cover maxOutputTokens at Quan 3.5 rates, with the safety margin reserved for reasoning tokens. The message says how many tokens the balance covers. |
Lower maxOutputTokens, or add balance. |
402 INSUFFICIENT_BALANCE |
The balance cannot fund the request input at Quan 3.5 rates. | Add balance. |
A verified response-cache hit returns the stored answer without reserving or charging tokens or searches.
Launch Credit
The first 100 developers to redeem code QUAN35 in the developer console receive $5.00 of API credit that can be used only on quan-3.5.
- One redemption per account. The account needs a verified email and must have accepted the current Developer API Terms.
- The credit is spent before your cash balance, and only on
quan-3.5requests. Other models draw from your cash balance as usual. - Requests paid with the credit are charged at the normal Quan 3.5 rates.
- The code stops working after 100 redemptions, or earlier if the offer is withdrawn.
Moving an Integration From Quan 3.4
- Change
modeltoquan-3.5. - Send
streamexplicitly. If your code reads server-sent events, send"stream": true. - Check that
temperature,topPandtopKare inside their ranges, and handle400 INVALID_PARAMETER. - If you read billing on streams, read the
event: billingframe. - Confirm the switch with the
X-Quan-Model-Versionheader. - Compare
X-StockUp-Chargeon your own traffic before moving all of it.
OpenAPI and MCP for AI Agents
The public OpenAPI YAML and OpenAPI JSON list quan-3.5 in the model enum. In the StockUp MCP server, pass "model": "quan-3.5" as a tool argument; the server sends stream: false, so its requests work unchanged.
Production Checklist
- Store
STOCKUP_API_KEYin server-side environment variables or a secret manager. - Fund a prepaid balance before switching production traffic; Quan 3.5 has no free allowance.
- Set
maxOutputTokensto the smallest budget your answers need, so the balance check and your costs stay predictable. - Log
X-Request-Id,X-Quan-Model-VersionandX-StockUp-Charge(or the stream’sevent: billing) for each request. - Treat any response whose
Content-Typeis notapplication/jsonas a server error and retry it with backoff.
StockUp Quan responses are for research and education. They are not personalized financial advice, investment recommendations, or a substitute for professional due diligence.