Getting started
This guide walks from a VijiHub account to a successful API call against the Gateway.
Prerequisites
- A VijiHub account (register at
/auth/registeron the Gateway) - Gateway reachable (local default
http://localhost:5600) - Optional: Node.js or .NET for SDK samples
1. Sign in to the Console
Open the Console (http://localhost:5500), sign in via OAuth PKCE, and land on your projects list.
2. Create a project and environment
- Create a project in the Console.
- Note the project id and environment id (each project has environments such as Development).
- Most service routes are scoped as:
/{service}/projects/{projectId}/environments/{environmentId}/...
3. Enable the service
Open the project → environment → enable the service you need (for example AI, Storage, or Analytics) and configure any provider credentials required by that service.
4. Create an API key
In project settings, create an API key. Keys are prefixed with vh_.
- Use a full key on backends and CLIs.
- For browser ingest/live SDKs, create a scoped client key when the service supports it (see Authentication and Constraints).
5. First request
Example: health check (no auth):
curl http://localhost:5600/ai/health
Example: AI completion with owner JWT (Console flow) or configure the matching service endpoint with your key according to that service’s auth rules.
Using @vijihub/ai from a trusted backend:
import { createAiClient } from '@vijihub/ai'
const ai = createAiClient({
baseUrl: 'http://localhost:5600',
projectId: '<project-id>',
environmentId: '<environment-id>',
getAccessToken: () => auth.ensureAccessToken(),
})
const result = await ai.complete({
messages: [{ role: 'user', content: 'Hello!' }],
})