Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

Make your first request

Read the credential

Load provider credentials in server-side application code. The generated SDK does not read environment variables automatically.
const accessCode = process.env.EGOVAI_ACCESS_CODE; if (!accessCode) throw new Error("EGOVAI_ACCESS_CODE is required");

Create the client

Each provider has its own host. Create a client for the host you intend to call:
import { createClient, egovAi } from "egov.js"; const client = createClient({ baseUrl: "https://egov-ai-core-ws.oueg.info", });

Generate text

const token = await egovAi.generateAccessToken({ client, body: { access_code: accessCode }, throwOnError: true, }); const answer = await egovAi.generateAssistant({ client, auth: token.access_token, body: { category: "general", prompt: "Explain the steps for registering a sole proprietorship.", }, throwOnError: true, }); console.log(answer.data);
The raw token passed through auth is serialized as a bearer credential because the operation declares bearer security in openapi.json.