Documentation

Everything you need to integrate ApexApi into your application.

Quickstart

Get up and running in under 2 minutes. ApexApi is fully compatible with the OpenAI SDK.

1. Create an account and get your API key

Sign up at apexapi.dev/login, then navigate to API Keys to create a new key. Your key will start with ak-.

2. Install the OpenAI SDK

ApexApi is compatible with the official OpenAI SDK. No custom SDK needed.

Terminal
npm install openai

3. Make your first API call

Point the OpenAI client to ApexApi and specify any supported model using the provider/model format.

example.ts
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "ak-your-api-key",
  baseURL: "https://api.apexapi.dev/v1",
});

const completion = await client.chat.completions.create({
  model: "openai/gpt-4o",
  messages: [{ role: "user", content: "Hello, world!" }],
});

console.log(completion.choices[0].message.content);

4. Stream responses

Enable streaming by setting stream: true. Works with all chat completion models.

streaming.ts
const stream = await client.chat.completions.create({
  model: "anthropic/claude-sonnet-4-20250514",
  messages: [{ role: "user", content: "Write a haiku about APIs." }],
  stream: true,
});

for await (const chunk of stream) {
  const content = chunk.choices[0]?.delta?.content;
  if (content) process.stdout.write(content);
}

Browse Documentation