Build on ApiSoul
Create a workspace key in the console, then point existing OpenAI SDK code at https://apisoul.store/api/v1. Public shortcut routes are also available under https://apisoul.store/v1 when the front proxy forwards them.
https://apisoul.store/v1Compatible with OpenAI SDKs and direct HTTP clients.Quickstart
npm install openai
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.APISOUL_API_KEY,
baseURL: "https://apisoul.store/api/v1",
});Authentication
Send your workspace API key as a bearer token. Raw keys are shown once and stored only as hashes.
Authorization: Bearer sk_live_rg_...
API keys
Open the dashboard, verify your email, then create a key with a route group, rate limit, optional monthly credit limit, and optional expiry date.
Chat completions
const result = await client.chat.completions.create({
model: "gpt-5.5",
messages: [{ role: "user", content: "Write a deployment checklist." }],
max_tokens: 500
});
console.log(result.choices[0].message.content);Streaming
const stream = await client.chat.completions.create({
model: "gpt-5.5",
messages,
stream: true,
stream_options: { include_usage: true }
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices[0]?.delta?.content || "");
}For accurate streamed billing, request an upstream usage chunk with stream_options.include_usage. If upstream omits usage, ApiSoul conservatively charges the reserved estimate.
Models
const models = await client.models.list(); console.log(models.data.map(model => model.id));
Errors
{
"error": {
"type": "billing_error",
"code": "insufficient_balance",
"message": "Insufficient credit balance.",
"request_id": "req_..."
}
}Metering
Each request creates a reservation, then reconciles actual prompt and completion tokens after the provider response. Failed requests release the reservation when no provider usage is recorded.