KeyoAPI

← Blog

How to use an OpenAI-compatible API in Node.js

Use the official OpenAI Node SDK against KeyoAPI with two config changes.

1. Install

npm install openai

2. Create a client

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.KEYO_API_KEY,
  baseURL: "https://www.keyoapi.xyz/v1",
});

const resp = await client.chat.completions.create({
  model: "deepseek-v4.1-flash",
  messages: [{ role: "user", content: "Hello from KeyoAPI" }],
});
console.log(resp.choices[0].message.content);

3. Environment

export KEYO_API_KEY="sk-..."

Mint the key after sign-up. Top up Wallet before metered traffic.

4. Model IDs

Copy IDs from /pricing-list or /pricing. Permanent $0 fair-use IDs: /free-models.

Also: Python · Cursor · Docs.

← Blog · Home