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

Use eGov AI

eGov AI provides prompt-based content generation, translation, document extraction, and credit tracking through one provider API.
The documented provider host is a partner environment. Confirm the correct environment with the service owner before sending credentials or documents.

Authenticate

Exchange an access code with egovAi.generateAccessToken, then pass the returned bearer token through auth for the remaining operations.

Initialize the client

Create a dedicated client for the documented eGov AI provider host:
import { createClient } from "egov.js"; const client = createClient({ baseUrl: "https://egov-ai-core-ws.oueg.info", });

Methods

The examples below use this eGov AI client. See the quickstart for a complete token-and-request flow.
The API Reference tab remains the source of truth for complete parameters, schemas, responses, and cURL examples.

egovAi.generateAccessToken

POST /api/v1/egov/integration/token exchanges an access code for a bearer token and returns the initial credit balance.
import { egovAi } from "egov.js"; const token = await egovAi.generateAccessToken({ client, body: { access_code: process.env.EGOVAI_ACCESS_CODE! }, throwOnError: true, });

egovAi.generateAssistant

POST /api/v1/egov/integration/ai_assistant/generate generates assistant content from a prompt and category using bearer authentication.
import { egovAi } from "egov.js"; const assistant = await egovAi.generateAssistant({ client, auth: token.access_token, body: { category: "general", prompt: "How do I register a business?", }, throwOnError: true, });

egovAi.generateSpeech

POST /api/v1/egov/integration/speech_maker/generate generates speech-oriented content from an authenticated prompt request.
import { egovAi } from "egov.js"; const speech = await egovAi.generateSpeech({ client, auth: token.access_token, body: { category: "public-service-announcement", prompt: "Announce the municipal office schedule.", }, throwOnError: true, });

egovAi.generateTourism

POST /api/v1/egov/integration/tourism/generate generates tourism content from an authenticated prompt request.
import { egovAi } from "egov.js"; const tourism = await egovAi.generateTourism({ client, auth: token.access_token, body: { category: "destination-guide", prompt: "Create a two-day heritage itinerary for Vigan.", }, throwOnError: true, });

egovAi.generateLawsAndRegulations

POST /api/v1/egov/integration/laws_and_regulations/generate generates laws-and-regulations content from an authenticated prompt request.
import { egovAi } from "egov.js"; const legalGuide = await egovAi.generateLawsAndRegulations({ client, auth: token.access_token, body: { category: "business-registration", prompt: "Summarize the permits required for a sole proprietorship.", }, throwOnError: true, });

egovAi.translate

POST /api/v1/egov/integration/translator/generate translates and transliterates text between the requested source and target languages.
import { egovAi } from "egov.js"; const translation = await egovAi.translate({ client, auth: token.access_token, body: { prompt: "Your application is ready for review.", source_lang: "en", target_lang: "fil", }, throwOnError: true, });

egovAi.extractDocument

POST /api/v1/egov/integration/document_extractor/generate uploads an authenticated multipart document for content extraction.
import { egovAi } from "egov.js"; const extracted = await egovAi.extractDocument({ client, auth: token.access_token, body: { file: documentFile }, throwOnError: true, });

egovAi.getTokenCredits

GET /api/v1/egov/integration/credits returns credit usage, totals, remaining credits, and expiration for the bearer token.
import { egovAi } from "egov.js"; const credits = await egovAi.getTokenCredits({ client, auth: token.access_token, throwOnError: true, });