Coding & Development
For code generation, refactoring, explanation, and unit test generation, we recommend:
- Choosing models with strong coding capabilities (such as Claude 4,
deepseek-coder-v3) - Providing clear API/file context and constraints in the prompt
- Controlling the output format (for example, JSON or Markdown code blocks)
Example
import OpenAI from "openai";
const client = new OpenAI({ apiKey: "...", baseURL: "https://api.manysky.top/v1" });
const r = await client.chat.completions.create({
model: "claude-sonnet-4-5-20250929",
messages: [{ role: "user", content: "Please generate a simple login page using JavaScript, HTML, and CSS." }]
});
console.log(r.choices[0].message.content);