[{"data":1,"prerenderedAt":894},["ShallowReactive",2],{"doc-\u002Fen\u002Fdocs\u002Freference\u002Fcloud-api":3,"doc-surround-\u002Fen\u002Fdocs\u002Freference\u002Fcloud-api":791,"doc-nav-en":797},{"id":4,"title":5,"body":6,"description":781,"extension":782,"meta":783,"navigation":784,"order":785,"path":786,"section":787,"seo":788,"stem":789,"__hash__":790},"docs_en\u002Fen\u002Fdocs\u002F04.reference\u002F19.cloud-api.md","Cloud REST API",{"type":7,"value":8,"toc":768},"minimark",[9,13,26,43,48,55,91,114,119,212,216,342,346,420,424,510,514,579,583,586,644,655,659,728,732,739,743,764],[10,11,5],"h1",{"id":12},"cloud-rest-api",[14,15,16,17,21,22,25],"p",{},"The LingXizhi cloud services expose a REST API used by the IDE core, the website, and third-party integrations. All endpoints are prefixed with ",[18,19,20],"code",{},"\u002Fapi\u002Fv1",". This guide uses ",[18,23,24],{},"https:\u002F\u002Fwww.lingxizhiai.com"," as an example base URL — use the address of your own deployment.",[27,28,30],"callout",{"type":29},"tip",[14,31,32,36,37,42],{},[33,34,35],"strong",{},"Who this is for",": developers connecting directly to the server (CI integrations, custom tooling). Everyday IDE usage never touches these endpoints — the core handles them for you. For the local core (port 3721), see the ",[38,39,41],"a",{"href":40},"\u002Fen\u002Fdocs\u002Freference\u002Fkernel-api","Kernel API",".",[44,45,47],"h2",{"id":46},"authentication","Authentication",[14,49,50,51,54],{},"All endpoints require a JWT Bearer token unless marked ",[33,52,53],{},"public",":",[56,57,62],"pre",{"className":58,"code":59,"language":60,"meta":61,"style":61},"language-bash shiki shiki-themes tokyo-night","curl -H \"Authorization: Bearer \u003Caccess_token>\" https:\u002F\u002Fwww.lingxizhiai.com\u002Fapi\u002Fv1\u002Fmembership\u002Fcurrent\n","bash","",[18,63,64],{"__ignoreMap":61},[65,66,69,73,77,81,85,88],"span",{"class":67,"line":68},"line",1,[65,70,72],{"class":71},"sE3pS","curl",[65,74,76],{"class":75},"sT800"," -H",[65,78,80],{"class":79},"sAklC"," \"",[65,82,84],{"class":83},"sPY7s","Authorization: Bearer \u003Caccess_token>",[65,86,87],{"class":79},"\"",[65,89,90],{"class":83}," https:\u002F\u002Fwww.lingxizhiai.com\u002Fapi\u002Fv1\u002Fmembership\u002Fcurrent\n",[14,92,93,94,97,98,101,102,105,106,109,110,113],{},"Obtain the token via ",[18,95,96],{},"\u002Fauth\u002Flogin"," and renew it with ",[18,99,100],{},"\u002Fauth\u002Frefresh"," before it expires. Accounts with MFA enabled receive ",[18,103,104],{},"mfa_required"," + ",[18,107,108],{},"mfa_ticket"," from the login endpoint — complete the second factor via ",[18,111,112],{},"\u002Fauth\u002Fmfa\u002Fverify"," to obtain the token.",[115,116,118],"h3",{"id":117},"auth-endpoints","Auth endpoints",[120,121,122,138],"table",{},[123,124,125],"thead",{},[126,127,128,132,135],"tr",{},[129,130,131],"th",{},"Method",[129,133,134],{},"Path",[129,136,137],{},"Description",[139,140,141,155,166,177,189,201],"tbody",{},[126,142,143,147,152],{},[144,145,146],"td",{},"POST",[144,148,149],{},[18,150,151],{},"\u002Fauth\u002Fregister",[144,153,154],{},"Register (email + username + password + code)",[126,156,157,159,163],{},[144,158,146],{},[144,160,161],{},[18,162,96],{},[144,164,165],{},"Sign in; MFA accounts get an intermediate ticket",[126,167,168,170,174],{},[144,169,146],{},[144,171,172],{},[18,173,112],{},[144,175,176],{},"MFA second factor (ticket + TOTP\u002Frecovery code)",[126,178,179,181,186],{},[144,180,146],{},[144,182,183],{},[18,184,185],{},"\u002Fauth\u002Fsend-code",[144,187,188],{},"Send an email verification code",[126,190,191,193,198],{},[144,192,146],{},[144,194,195],{},[18,196,197],{},"\u002Fauth\u002Freset-password",[144,199,200],{},"Reset password",[126,202,203,205,209],{},[144,204,146],{},[144,206,207],{},[18,208,100],{},[144,210,211],{},"Refresh the access token (public, with refresh token)",[44,213,215],{"id":214},"membership-and-subscriptions","Membership and subscriptions",[120,217,218,228],{},[123,219,220],{},[126,221,222,224,226],{},[129,223,131],{},[129,225,134],{},[129,227,137],{},[139,229,230,246,258,270,282,294,306,318,330],{},[126,231,232,235,240],{},[144,233,234],{},"GET",[144,236,237],{},[18,238,239],{},"\u002Fmembership\u002Fplans",[144,241,242,243,245],{},"Plan catalog (",[33,244,53],{}," — powers dynamic pricing on the website)",[126,247,248,250,255],{},[144,249,234],{},[144,251,252],{},[18,253,254],{},"\u002Fmembership\u002Fcurrent",[144,256,257],{},"Current membership status (incl. credit balance)",[126,259,260,262,267],{},[144,261,146],{},[144,263,264],{},[18,265,266],{},"\u002Fmembership\u002Fsubscribe",[144,268,269],{},"Create a subscription order (pending payment)",[126,271,272,274,279],{},[144,273,146],{},[144,275,276],{},[18,277,278],{},"\u002Fmembership\u002Fupgrade",[144,280,281],{},"Upgrade to a higher tier (remaining credits carry over in full)",[126,283,284,286,291],{},[144,285,146],{},[144,287,288],{},[18,289,290],{},"\u002Fmembership\u002Fcancel",[144,292,293],{},"Cancel the subscription (downgrades to Free at period end)",[126,295,296,298,303],{},[144,297,234],{},[144,299,300],{},[18,301,302],{},"\u002Fmembership\u002Fquota",[144,304,305],{},"Quota check",[126,307,308,310,315],{},[144,309,234],{},[144,311,312],{},[18,313,314],{},"\u002Fmembership\u002Fusage?days=30",[144,316,317],{},"Subscription usage by day",[126,319,320,322,327],{},[144,321,234],{},[144,323,324],{},[18,325,326],{},"\u002Fmembership\u002Forders",[144,328,329],{},"Order history",[126,331,332,334,339],{},[144,333,146],{},[144,335,336],{},[18,337,338],{},"\u002Fmembership\u002Forders\u002F:order_no\u002Fcancel",[144,340,341],{},"Cancel one of your pending orders",[44,343,345],{"id":344},"credits","Credits",[120,347,348,358],{},[123,349,350],{},[126,351,352,354,356],{},[129,353,131],{},[129,355,134],{},[129,357,137],{},[139,359,360,372,384,396,408],{},[126,361,362,364,369],{},[144,363,234],{},[144,365,366],{},[18,367,368],{},"\u002Fcredits\u002Fbalance",[144,370,371],{},"Purchased-credit balance and plan credit remaining",[126,373,374,376,381],{},[144,375,234],{},[144,377,378],{},[18,379,380],{},"\u002Fcredits\u002Fledger?limit&offset",[144,382,383],{},"Credit ledger (recharge \u002F consume \u002F carry-over)",[126,385,386,388,393],{},[144,387,146],{},[144,389,390],{},[18,391,392],{},"\u002Fcredits\u002Frecharge",[144,394,395],{},"Create a credit top-up order (WeChat \u002F Alipay)",[126,397,398,400,405],{},[144,399,234],{},[144,401,402],{},[18,403,404],{},"\u002Fcredits\u002Forders\u002F:order_no",[144,406,407],{},"Credit order status",[126,409,410,412,417],{},[144,411,234],{},[144,413,414],{},[18,415,416],{},"\u002Fcredits\u002Forders",[144,418,419],{},"Credit order history",[44,421,423],{"id":422},"usage-statistics","Usage statistics",[120,425,426,436],{},[123,427,428],{},[126,429,430,432,434],{},[129,431,131],{},[129,433,134],{},[129,435,137],{},[139,437,438,450,462,474,486,498],{},[126,439,440,442,447],{},[144,441,234],{},[144,443,444],{},[18,445,446],{},"\u002Fusage\u002Flogs?limit&offset",[144,448,449],{},"Call log details",[126,451,452,454,459],{},[144,453,234],{},[144,455,456],{},[18,457,458],{},"\u002Fusage\u002Fstats?days=7",[144,460,461],{},"Usage summary (requests, tokens, cache savings)",[126,463,464,466,471],{},[144,465,234],{},[144,467,468],{},[18,469,470],{},"\u002Fusage\u002Fdaily?days=30",[144,472,473],{},"Daily usage",[126,475,476,478,483],{},[144,477,234],{},[144,479,480],{},[18,481,482],{},"\u002Fusage\u002Fmodels?days=30",[144,484,485],{},"Per-model statistics",[126,487,488,490,495],{},[144,489,234],{},[144,491,492],{},[18,493,494],{},"\u002Fusage\u002Fcost?days=30",[144,496,497],{},"Cost statistics",[126,499,500,502,507],{},[144,501,234],{},[144,503,504],{},[18,505,506],{},"\u002Fusage\u002Fcompletions",[144,508,509],{},"Completion acceptance rate, last 30 days",[44,511,513],{"id":512},"online-payments","Online payments",[120,515,516,526],{},[123,517,518],{},[126,519,520,522,524],{},[129,521,131],{},[129,523,134],{},[129,525,137],{},[139,527,528,543,555,567],{},[126,529,530,532,537],{},[144,531,234],{},[144,533,534],{},[18,535,536],{},"\u002Fpayment\u002Fconfig",[144,538,539,540,542],{},"Payment channel switches (",[33,541,53],{},")",[126,544,545,547,552],{},[144,546,146],{},[144,548,549],{},[18,550,551],{},"\u002Fpayment\u002Forders",[144,553,554],{},"Create a payment order (subscription or credit top-up)",[126,556,557,559,564],{},[144,558,234],{},[144,560,561],{},[18,562,563],{},"\u002Fpayment\u002Forders\u002F:order_no",[144,565,566],{},"Poll order status",[126,568,569,571,576],{},[144,570,146],{},[144,572,573],{},[18,574,575],{},"\u002Fpayment\u002Fnotify\u002F:channel",[144,577,578],{},"Async channel callback (server-to-server, signature verified)",[44,580,582],{"id":581},"hosted-llm-gateway-openai-compatible","Hosted LLM gateway (OpenAI-compatible)",[14,584,585],{},"The hosted pool exposes an OpenAI-compatible chat endpoint — no BYOK required, billed in credits. Use the user access token as Bearer:",[56,587,589],{"className":58,"code":588,"language":60,"meta":61,"style":61},"curl https:\u002F\u002Fwww.lingxizhiai.com\u002Fapi\u002Fv1\u002Fllm\u002Fgateway\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H \"Authorization: Bearer \u003Caccess_token>\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"model\": \"glm-5.2\", \"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}], \"stream\": true}'\n",[18,590,591,601,615,629],{"__ignoreMap":61},[65,592,593,595,598],{"class":67,"line":68},[65,594,72],{"class":71},[65,596,597],{"class":83}," https:\u002F\u002Fwww.lingxizhiai.com\u002Fapi\u002Fv1\u002Fllm\u002Fgateway\u002Fv1\u002Fchat\u002Fcompletions",[65,599,600],{"class":79}," \\\n",[65,602,604,607,609,611,613],{"class":67,"line":603},2,[65,605,606],{"class":75},"  -H",[65,608,80],{"class":79},[65,610,84],{"class":83},[65,612,87],{"class":79},[65,614,600],{"class":79},[65,616,618,620,622,625,627],{"class":67,"line":617},3,[65,619,606],{"class":75},[65,621,80],{"class":79},[65,623,624],{"class":83},"Content-Type: application\u002Fjson",[65,626,87],{"class":79},[65,628,600],{"class":79},[65,630,632,635,638,641],{"class":67,"line":631},4,[65,633,634],{"class":75},"  -d",[65,636,637],{"class":79}," '",[65,639,640],{"class":83},"{\"model\": \"glm-5.2\", \"messages\": [{\"role\": \"user\", \"content\": \"Hello\"}], \"stream\": true}",[65,642,643],{"class":79},"'\n",[14,645,646,649,650,654],{},[18,647,648],{},"stream"," enables SSE pass-through. Plan credits are consumed first, then purchased credits; insufficient balance returns 402. The model catalog and retail prices are managed server-side, and flagship models require a minimum plan tier (see ",[38,651,653],{"href":652},"\u002Fen\u002Fdocs\u002Fmodels-billing\u002Fplans-quota","Plans & quotas",").",[44,656,658],{"id":657},"cloud-tasks-and-sandboxes","Cloud tasks and sandboxes",[120,660,661,671],{},[123,662,663],{},[126,664,665,667,669],{},[129,666,131],{},[129,668,134],{},[129,670,137],{},[139,672,673,685,701,713],{},[126,674,675,677,682],{},[144,676,146],{},[144,678,679],{},[18,680,681],{},"\u002Ftasks\u002Fsubmit",[144,683,684],{},"Submit a cloud task",[126,686,687,689,698],{},[144,688,234],{},[144,690,691,694,695],{},[18,692,693],{},"\u002Ftasks"," · ",[18,696,697],{},"\u002Ftasks\u002F:id",[144,699,700],{},"Task list \u002F status",[126,702,703,705,710],{},[144,704,146],{},[144,706,707],{},[18,708,709],{},"\u002Ftasks\u002F:id\u002Fcancel",[144,711,712],{},"Cancel a task",[126,714,715,717,725],{},[144,716,234],{},[144,718,719,694,722],{},[18,720,721],{},"\u002Fcloud\u002Fvms",[18,723,724],{},"\u002Fcloud\u002Fquotas",[144,726,727],{},"Cloud sandbox instances and quotas",[44,729,731],{"id":730},"rate-limits","Rate limits",[14,733,734,735,738],{},"Sensitive endpoints (login, verification codes, payment callbacks) are rate limited per hour. Exceeding the limit returns ",[18,736,737],{},"429",", and some endpoints then require a CAPTCHA. Use exponential backoff in integrations and avoid tight polling — poll order status at 3-5 second intervals.",[44,740,742],{"id":741},"next-steps","Next steps",[744,745,746,752,757],"ul",{},[747,748,749,750,42],"li",{},"Local core endpoints (port 3721): ",[38,751,41],{"href":40},[747,753,754,755,42],{},"Plan tiers and model gating: ",[38,756,653],{"href":652},[747,758,759,760,42],{},"Connect your own provider keys: ",[38,761,763],{"href":762},"\u002Fen\u002Fdocs\u002Fmodels-billing\u002Fbyok","Bring your own API key",[765,766,767],"style",{},"html pre.shiki code .sE3pS, html code.shiki .sE3pS{--shiki-default:#C0CAF5}html pre.shiki code .sT800, html code.shiki .sT800{--shiki-default:#E0AF68}html pre.shiki code .sAklC, html code.shiki .sAklC{--shiki-default:#89DDFF}html pre.shiki code .sPY7s, html code.shiki .sPY7s{--shiki-default:#9ECE6A}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":61,"searchDepth":603,"depth":603,"links":769},[770,773,774,775,776,777,778,779,780],{"id":46,"depth":603,"text":47,"children":771},[772],{"id":117,"depth":617,"text":118},{"id":214,"depth":603,"text":215},{"id":344,"depth":603,"text":345},{"id":422,"depth":603,"text":423},{"id":512,"depth":603,"text":513},{"id":581,"depth":603,"text":582},{"id":657,"depth":603,"text":658},{"id":730,"depth":603,"text":731},{"id":741,"depth":603,"text":742},"Overview of the LingXizhi cloud REST API — authentication, membership and credits, usage stats, online payments, the OpenAI-compatible LLM gateway, and cloud tasks","md",{},true,19,"\u002Fen\u002Fdocs\u002Freference\u002Fcloud-api","Reference & FAQ",{"title":5,"description":781},"en\u002Fdocs\u002F04.reference\u002F19.cloud-api","Zen1QIi6eF21LQCpLKk44L119r0cO-ka9_Txy2E08BY",[792,796],{"title":793,"path":794,"stem":795,"children":-1},"FAQ","\u002Fen\u002Fdocs\u002Freference\u002Ffaq","en\u002Fdocs\u002F04.reference\u002F18.faq",null,[798],{"title":799,"path":800,"stem":801,"children":802,"page":829},"En","\u002Fen","en",[803],{"title":804,"path":805,"stem":806,"children":807,"page":829},"Docs","\u002Fen\u002Fdocs","en\u002Fdocs",[808,830,863,878],{"title":809,"path":810,"stem":811,"children":812,"page":829},"Getting Started","\u002Fen\u002Fdocs\u002Fgetting-started","en\u002Fdocs\u002F01.getting-started",[813,817,821,825],{"title":814,"path":815,"stem":816},"Installation & Download","\u002Fen\u002Fdocs\u002Fgetting-started\u002Finstallation","en\u002Fdocs\u002F01.getting-started\u002F01.installation",{"title":818,"path":819,"stem":820},"Register & Sign In","\u002Fen\u002Fdocs\u002Fgetting-started\u002Fregister-login","en\u002Fdocs\u002F01.getting-started\u002F02.register-login",{"title":822,"path":823,"stem":824},"First-Time Setup","\u002Fen\u002Fdocs\u002Fgetting-started\u002Ffirst-setup","en\u002Fdocs\u002F01.getting-started\u002F03.first-setup",{"title":826,"path":827,"stem":828},"Migrate from VS Code","\u002Fen\u002Fdocs\u002Fgetting-started\u002Fmigrate-from-vscode","en\u002Fdocs\u002F01.getting-started\u002F04.migrate-from-vscode",false,{"title":831,"path":832,"stem":833,"children":834,"page":829},"Feature Guides","\u002Fen\u002Fdocs\u002Fguides","en\u002Fdocs\u002F02.guides",[835,839,843,847,851,855,859],{"title":836,"path":837,"stem":838},"AI Chat & Inline Edit","\u002Fen\u002Fdocs\u002Fguides\u002Fai-chat","en\u002Fdocs\u002F02.guides\u002F05.ai-chat",{"title":840,"path":841,"stem":842},"RUSH Deep Task","\u002Fen\u002Fdocs\u002Fguides\u002Frush","en\u002Fdocs\u002F02.guides\u002F06.rush",{"title":844,"path":845,"stem":846},"FIM Code Completion","\u002Fen\u002Fdocs\u002Fguides\u002Ffim-completion","en\u002Fdocs\u002F02.guides\u002F07.fim-completion",{"title":848,"path":849,"stem":850},"Semantic Code Graph","\u002Fen\u002Fdocs\u002Fguides\u002Fcode-graph","en\u002Fdocs\u002F02.guides\u002F08.code-graph",{"title":852,"path":853,"stem":854},"MCP Tools & Marketplace","\u002Fen\u002Fdocs\u002Fguides\u002Fmcp","en\u002Fdocs\u002F02.guides\u002F09.mcp",{"title":856,"path":857,"stem":858},"Debugging & DAP","\u002Fen\u002Fdocs\u002Fguides\u002Fdebugging","en\u002Fdocs\u002F02.guides\u002F10.debugging",{"title":860,"path":861,"stem":862},"Integrated Terminal","\u002Fen\u002Fdocs\u002Fguides\u002Fterminal","en\u002Fdocs\u002F02.guides\u002F11.terminal",{"title":864,"path":865,"stem":866,"children":867,"page":829},"Models & Billing","\u002Fen\u002Fdocs\u002Fmodels-billing","en\u002Fdocs\u002F03.models-billing",[868,872,875],{"title":869,"path":870,"stem":871},"Models","\u002Fen\u002Fdocs\u002Fmodels-billing\u002Fmodels","en\u002Fdocs\u002F03.models-billing\u002F12.models",{"title":873,"path":652,"stem":874},"Plans & Credits","en\u002Fdocs\u002F03.models-billing\u002F13.plans-quota",{"title":876,"path":762,"stem":877},"BYOK (Bring Your Own Key)","en\u002Fdocs\u002F03.models-billing\u002F14.byok",{"title":787,"path":879,"stem":880,"children":881,"page":829},"\u002Fen\u002Fdocs\u002Freference","en\u002Fdocs\u002F04.reference",[882,886,890,892,893],{"title":883,"path":884,"stem":885},"Keyboard Shortcuts","\u002Fen\u002Fdocs\u002Freference\u002Fshortcuts","en\u002Fdocs\u002F04.reference\u002F15.shortcuts",{"title":887,"path":888,"stem":889},"Configuration","\u002Fen\u002Fdocs\u002Freference\u002Fconfiguration","en\u002Fdocs\u002F04.reference\u002F16.configuration",{"title":41,"path":40,"stem":891},"en\u002Fdocs\u002F04.reference\u002F17.kernel-api",{"title":793,"path":794,"stem":795},{"title":5,"path":786,"stem":789},1788543854774]