API Reference
Chat Completions API
The /v1/chat/completions endpoint, built for flexibility and tuned for cost, speed, or quality.
Endpoint
Method
POST
Base URL
https://api.clod.io
Endpoint
/v1/chat/completions
Request body
modelstringModel name, e.g. "clod/deepseek-v4p1-flash", or with a strategy "clod/deepseek-v4p1-flash@price"messagesarrayArray of {role, content} objectstemperaturenumberOptional. Range 0 to 2.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: "clod/deepseek-v4p1-flash",
messages: [{ role: "user", content: "Summarize this changelog." }],
});
console.log(res.choices[0].message.content);