hosting

POST /v1/sites/{siteId}/ide-assist

Ask the AI assistant about one file in the site's web editor.

تمام hosting اینڈ پوائنٹس

توثيقِ شناخت

یہ اینڈ پوائنٹ عوامی ہے۔ یہ کوئی اسناد اور کوئی تنظیم نہیں لیتا — یہ وہ ہے جسے ہماری اپنی مارکیٹنگ سائٹ اور AI کے جواب دینے والے انجن پڑھتے ہیں۔

یہ اینڈ پوائنٹ کوئی آرگنائزیشن آئی ڈی نہیں لیتا۔ آپ کی کلید پہلے ہی اس آرگنائزیشن کی شناخت کرتی ہے جس سے یہ تعلق رکھتی ہے، اور اس کا جواب اسی کے مطابق محدود ہوتا ہے۔

آزمائیں

کوئی بھی چیز جو زاویہ دار قوسین میں ہو اسے اپنی اقدار سے بدلیں، اور کلیدی پلیس ہولڈر کو اپنے ڈیش بورڈ کی کسی کلید سے بدلیں۔

curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/ide-assist \
  -H "Content-Type: application/json" \
  -d '{ "context": <string> }'

لاگ ان ہیں؟ آپ کے ڈیش بورڈ میں موجود API کنسول آپ کی حقیقی تنظیم کی آئی ڈی اور آپ کی اپنی کلید خود بخود پُر کر دیتا ہے، اور لائیو API پر درخواست چلاتا ہے تاکہ آپ اصل ردعمل دیکھ سکیں۔ اس اینڈ پوائنٹ کو API کنسول میں کھولیں

تفصیلات

Answers one request about one file, from inside the site's browser editor, and bills the model call to that site's organisation on the same AI meter as every other surface (their own provider key if they have added one, their Zinn® credit if not). **This is the one site endpoint family with no user session behind it, and that is deliberate.** Its caller is a VS Code extension running inside the customer's own CageFS jail on a hosting box, which cannot hold a Keycloak session. It authenticates with a **signed, site-bound, expiring grant** minted when the editor is opened and presented as `Authorization: Bearer <grant>`. The grant names the site, the organisation and the person who opened the editor; the site in it must match the site in the path, and the organisation is read from the grant and never from the request body, so a grant for one site can neither ask about another nor bill another tenant. The grant never reaches the customer's browser: it is held in a root-owned file on the hosting box and attached by the editor gate, which runs outside every jail. A missing or unreadable grant is a `404`, never a `401`, so this cannot be used to discover that a site exists. An **editing** action (`fix`, `refactor`, `complete`, `generate`) returns a `proposal`: the complete replacement for the region that was sent. It is a suggestion and nothing on this side applies it — the editor shows it as a diff and writes it only after the customer approves. A **read-only** action (`ask`, `explain`) never returns one, however code-shaped its answer. A refusal the customer should read — an exhausted allowance, a revoked provider key, a question that is too long, a file too large to rewrite safely — is a `422` carrying the sentence to show them and a code in `details[].code`, because "you are out of credit" and "we could not reach the model" are different facts and only one of them is theirs to fix.

پیرامیٹرز

نامقسملازمییہ کیا ہے
siteId (path)UuidہاںSite ID (UUIDv7).

درخواست کا باڈی

نامقسملازمییہ کیا ہے
actionstring<ask, explain, fix, refactor, complete, generate>نہیںWhat to do. `ask` and `explain` are read-only and answer in prose. `fix`, `refactor`, `complete` and `generate` return a `proposal` the editor shows as a diff for the customer t…
questionstringنہیںWhat the developer wants. Required for `ask` and `generate`; optional for the rest. Longer than 4,000 characters is a `422` asking them to select the part of the file they mean.
pathstringنہیںThe file's path relative to the site, shown to the model so it can reason about what kind of file it is. Optional — an unsaved buffer has none.
contextstringہاںThe file, or the selected region of it. Truncated to 24,000 characters for a read-only action, and the answer says so rather than silently answering about a fragment. An **editi…
modelstringنہیںA model from `/ide-assist/models`. Omit for the automatic choice, which is the cheapest model that can do the job, computed from our price list.

جواب

نامقسملازمییہ کیا ہے
actionstringہاںThe action this answers, echoed so the editor can render it correctly.
answerstringہاںThe assistant's answer, as markdown. Never blank on a `200` — an empty answer is a `422`, because the call was paid for either way and a blank panel in an editor is indistinguis…
proposalstringہاںThe complete replacement for the region that was sent, or empty. Non-empty only for an editing action, and only when the model returned exactly one well-formed code block with n…
modelstringہاںThe model that answered, so the editor can show what the customer paid for.
fundingstringہاںWhich route paid — the customer's own provider key, their Zinn® credit, or their included allowance. The same decision the AI page renders, never a second one.

وہ خرابیان جو یہ اینڈ پوائنٹ واپس کر سکتا ہے

404 · 422 · 429