AI
Overview
Unified chat completions against the environment’s configured AI provider, plus usage queries.
API
{pe} = /projects/{projectId}/environments/{environmentId}.
| Method | Path | Notes |
|---|---|---|
| GET | /ai/health | Health |
| POST | /ai{pe}/completions | Owner JWT (RequireAuthorization) |
| GET | /ai{pe}/usage | Owner JWT |
Clients
| Package | Runtime |
|---|---|
@vijihub/ai | server |
VijiHub.AI | .NET |
import { createAiClient } from '@vijihub/ai'
const ai = createAiClient({
baseUrl: 'http://localhost:5600',
projectId: '...',
environmentId: '...',
getAccessToken: () => auth.ensureAccessToken(),
})
const result = await ai.complete({
messages: [
{ role: 'system', content: 'You are helpful.' },
{ role: 'user', content: 'Hello!' },
],
temperature: 0.7,
})
Implementation
- Enable AI and configure a provider (API key, model defaults, optional tunnel base URL).
- Call completions from a trusted backend or Console session with Bearer token.
- Monitor
GET …/usage.
Constraints
- Completions require authorization (owner JWT) — treat as server/BFF capability.
- Provider rate limits and model availability apply upstream.
- Do not expose your provider keys to browsers; VijiHub stores them on the environment.