Node.js

Full reference for @gatectr/sdk.

Install

npm install @gatectr/sdk

Initialize

import { GateCtr } from '@gatectr/sdk';

const client = new GateCtr({
  apiKey: process.env.GATECTR_API_KEY,
});

client.complete()

const response = await client.complete({
  model: string,           // model name or "auto"
  messages: Message[],     // OpenAI-compatible messages array
  gatectr?: {
    optimize?: boolean,    // default: true (Pro+)
    route?: boolean,       // default: false (Pro+)
    budget_id?: string,    // override project budget
  }
});

client.stream()

client.usage()

Drop-in for OpenAI SDK

Full reference

github.com/GateCtr/sdk-nodearrow-up-right

Last updated

Was this helpful?