API Reference
Chat Completions API
The /v1/chat/completions endpoint — built for flexibility, optimized for cost, speed, or token rate.
Endpoint
Method
POST
Base URL
https://api.clod.io
Endpoint
/v1/chat/completions
Request Body
modelstringModel name, e.g. "GPT 4o", or with strategy "GPT 4o@price"messagesarrayArray of {role, content} objectstemperaturenumberOptional. 0–2 range.max_completion_tokensintegerOptional. Max tokens to generate.streambooleanOptional. Enable streaming. Default: false.Routing Strategies
Append a routing strategy to the model name using @strategy:
@priceRoute to cheapest available instance@latencyRoute to fastest available instance@qualityRoute to highest-quality instanceExample
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.clod.io/v1",
apiKey: process.env.CLOD_API_KEY,
});
const res = await client.chat.completions.create({
model: "DeepSeek V3",
messages: [{ role: "user", content: "Explain energy markets." }],
});
console.log(res.choices[0].message.content);