Quickstart
There are two supported integration paths: the server-side @qoniai/qoni Node SDK, or direct REST calls from any language. There is no standalone Python SDK.
1. Credentials
Raw HTTP uses a project API key:
bash
export WEBAGENT_API_KEY=wa_xxxxxxxxxxxxxxxxxxxxxxxx
export WEBAGENT_PROJECT_ID=proj_xxxxxxxxxxxxxxxxxxxxxxxxThe Node SDK uses server-side AK/SK and a real GenAuth user ID for delegation:
bash
export QONI_ACCESS_KEY=...
export QONI_SECRET_KEY=...
export QONI_USER_ID=...2. Node.js / TypeScript
bash
npm install @qoniai/qonits
import { Qoni } from "@qoniai/qoni";
const qoni = new Qoni({
accessKey: process.env.QONI_ACCESS_KEY!,
secretKey: process.env.QONI_SECRET_KEY!,
});
const { token } = (await qoni.delegateToken({
user: { id: process.env.QONI_USER_ID! },
products: ["doAnything"],
})).data;
const run = await qoni.doAnything.run({
token,
prompt: "Open Hacker News and list the first five story titles and links.",
});
for await (const event of run.events()) console.log(event.type, event.data);
console.log((await run.wait()).output);3. Raw HTTP / cURL
bash
curl -X POST "https://webagent.qoni.ai/api/v1/projects/${WEBAGENT_PROJECT_ID}/do_anything/runs" \
-H "Authorization: Bearer ${WEBAGENT_API_KEY}" \
-H "Content-Type: application/json" \
-d '{"instructions":"Open Hacker News and list the first five stories."}'Use the returned run_id with GET .../runs/{run_id} or GET .../runs/{run_id}/events.
4. Choose a product
| Goal | Node SDK | REST create path |
|---|---|---|
| Open-ended browser task | qoni.doAnything.run() | /api/v1/projects/{pid}/do_anything/runs |
| Research report | qoni.deepResearch.run() | /api/v1/projects/{pid}/deep_research/runs |
| Structured search results | qoni.webSearch.run() | /api/v1/projects/{pid}/web_search/runs |
| Long-lived monitoring | qoni.track.create() | /api/v1/projects/{pid}/track/tracks |
All three run creation endpoints are asynchronous; wait() is the SDK convenience that waits for a terminal run. See the OpenAPI spec for the complete contract.
The Track path describes the current backend contract. The legacy Track entry in npm 0.9.0 is incompatible and the SDK repair candidate is unpublished; see Track.