SDK Compatibility
SeedofCode AI is strictly designed to be a drop-in replacement for the OpenAI API. Our inference endpoints accept the exact same JSON payloads and return the exact same response structures as OpenAI's /chat/completions routes.
Because of this, you do not need to install a special SDK to use SeedofCode AI. You can simply install the official OpenAI library for your language, change the baseURL, and pass your SeedofCode API key.
Official OpenAI SDKs
Our system perfectly mimics the response format of OpenAI, down to the exact choices[0].message.content payload hierarchy.
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://api.ai.seedofcode.dev/api',
apiKey: process.env.SOC_API_KEY,
});
async function main() {
const response = await client.chat.completions.create({
model: 'qwen2.5vl:7b',
messages: [{ role: 'user', content: 'What is the speed of light?' }],
});
console.log(response.choices[0].message.content);
}
main();LangChain Integration
SeedofCode AI also works seamlessly with LangChain's existing OpenAI integrations by simply overriding the base URL config.
import { ChatOpenAI } from "@langchain/openai";
const llm = new ChatOpenAI({
modelName: "qwen2.5vl:7b",
openAIApiKey: process.env.SOC_API_KEY,
configuration: {
baseURL: "https://api.ai.seedofcode.dev/api",
}
});
const response = await llm.invoke("Hello, world!");
console.log(response.content);Supported Endpoints
Currently, SeedofCode AI supports the following OpenAI-compatible endpoints:
- Chat Completions (Used automatically by the SDK for all chat interactions)
- Models (Used automatically by the SDK to list available models)
Note: Embeddings, Image Generation, and Audio endpoints are not currently supported by SeedofCode.