Helix Gateway SDK
@launchverse/helix-gateway is the official TypeScript client for the Helix
OpenAI-compatible gateway. It works with any environment that supports the
global fetch API.
Install
npm install @launchverse/helix-gateway
Quick start
import { HelixGatewayClient } from "@launchverse/helix-gateway";
const helix = new HelixGatewayClient({
apiKey: process.env.HELIX_API_KEY!,
baseURL: "https://api.launchverse.app/api/v1",
projectId: process.env.HELIX_PROJECT_ID,
});
const response = await helix.chat({
model: "helix-operator",
messages: [
{ role: "user", content: "Deploy the Next.js app from my repository and verify /api/health." },
],
});
console.log(response.choices[0].message.content);
Streaming
const stream = await helix.streamChat({
model: "helix-operator",
messages: [
{ role: "user", content: "Fix the Prisma relation and redeploy." },
],
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content || "");
}
List models
const models = await helix.listModels();
console.log(models.data.map((m) => m.id));
// ["helix-advisor", "helix-operator", "helix-autopilot"]
Usage report
const usage = await helix.getUsage({
start: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString(),
end: new Date().toISOString(),
});
Constructor options
| Option | Type | Required | Description |
|---|---|---|---|
apiKey | string | yes | Helix API key |
baseURL | string | no | Defaults to https://api.launchverse.app/api/v1 |
projectId | string | no* | Required for helix-operator / helix-autopilot |
autonomyLevel | 0-4 | no | Override default autonomy |
threadId | string | no | Continue an existing thread |
Errors
All methods throw HelixGatewayError on non-2xx responses:
try {
await helix.chat({ model: "helix-operator", messages: [] });
} catch (error) {
if (error instanceof HelixGatewayError) {
console.error(error.status, error.code, error.message);
}
}