Docs/Documentation

Getting Started

Installation

Last updated May 28, 2026

Install the Cencori SDK in your project.

Install the official Cencori SDK for your preferred language. The SDK is meant to run on the server because it uses your Cencori project secret key.

TypeScript / Node.js

Codetext
npm install cencori
# or: yarn add cencori
# or: pnpm add cencori

Python

Codetext
pip install cencori

Go

Codetext
go get github.com/cencori/cencori-go

Requirements

  • Node.js 18+ for the TypeScript SDK.
  • TypeScript 5+ is optional, but recommended.
  • A Cencori project key from Project > API Keys.
  • Provider access for the model you want to call. Use managed access if enabled, or add your own provider key in Project > Providers.

Environment Variables

Codetext
# .env.local for Next.js, .env for most Node apps
CENCORI_API_KEY=csk_...

Do not expose a csk_... key through NEXT_PUBLIC_* variables or browser-side code.

Configuration

Codetext
import { Cencori } from 'cencori';
 
const cencori = new Cencori({
  apiKey: process.env.CENCORI_API_KEY,
  baseUrl: 'https://cencori.com', // optional; this is the default
  headers: {
    'X-Trace-ID': 'req_123',
  },
});

The SDK automatically reads CENCORI_API_KEY if no apiKey is provided:

Codetext
const cencori = new Cencori();

OpenAI-Compatible Base URL

For tools that already speak the OpenAI API, install nothing from Cencori and set:

Codetext
Base URL: https://api.cencori.com/v1
API key:  your Cencori project key

In most OpenAI-compatible clients, the base URL should stop at /v1; the client appends /chat/completions.

TypeScript Support

The SDK is written in TypeScript and includes full type definitions:

Codetext
import { Cencori, ChatRequest, ChatResponse } from 'cencori';
 
const cencori = new Cencori();
 
const request: ChatRequest = {
  model: 'gpt-4o',
  messages: [{ role: 'user', content: 'Hello' }],
};
 
const response: ChatResponse = await cencori.ai.chat(request);

Next Steps

See Add Cencori to an Existing Product for dashboard-to-code setup, or Making Your First Request to send a request with the SDK.