Skip to content

From OpenAI or Anthropic

If you call OpenAI or Anthropic directly today, keep the official SDK. Change two settings and the same code reaches Cloakray, with Gemini, DeepSeek, Kimi, GLM and every other model in the catalogue on the same key.

From OpenAI

 const client = new OpenAI({
-  apiKey: process.env.OPENAI_API_KEY,
+  baseURL: "https://api.cloakray.com/v1",
+  apiKey: process.env.CLOAKRAY_API_KEY,
 });

Or without touching code:

export OPENAI_BASE_URL="https://api.cloakray.com/v1"
export OPENAI_API_KEY="ckr_..."

From Anthropic

 const client = new Anthropic({
-  apiKey: process.env.ANTHROPIC_API_KEY,
+  baseURL: "https://api.cloakray.com",
+  apiKey: process.env.CLOAKRAY_API_KEY,
 });

Or set ANTHROPIC_BASE_URL=https://api.cloakray.com and ANTHROPIC_API_KEY to your Cloakray key.

Model IDs

Most model IDs are the same: gpt-5.5, gpt-5.4-mini, claude-opus-4-8, claude-sonnet-4-6. Dated snapshot IDs (with a date suffix) are not listed; use the model's catalogue ID. Check each ID you use on the models page, or with GET /v1/models.

Anthropic models also answer on Chat Completions and Responses, and OpenAI models on Messages, so you can standardise on one SDK if you want.

What changes

BeforeWith Cloakray
BillingA separate account and invoice per providerOne account for every model
PriceProvider list priceList price minus your discounts, no gateway fees
UsageEach provider's consoleOne set of logs and analytics
KeysPer providerPer project, for every model

What isn't offered

The core inference endpoints are covered — chat, Responses, Messages, embeddings, images, audio, video, moderation. Account-level OpenAI and Anthropic APIs are not: files, batches, fine-tuning, assistants, vector stores, token counting, admin and usage APIs, and realtime sessions. If your app relies on one of them, keep that part on the original provider.

The key decides which project a request belongs to; there is no organization or project header to set.