safyan-sdk
v1.0.0
Published
Safyan SDK — The first human-to-AI language. Make every AI prompt better with one line of code.
Maintainers
Readme
safyan-sdk
The first human-to-AI language. Make every AI prompt better with one line of code.
Install
npm install safyan-sdkQuick Start — OpenAI Drop-in
Change your base URL. That's it. Every prompt gets optimized automatically.
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.safyan.ai/v1",
apiKey: "sfk_your_key_here"
});
const response = await client.chat.completions.create({
model: "safyan-auto",
messages: [{ role: "user", content: "explain recursion" }]
});
console.log(response.choices[0].message.content);Direct SDK Usage
import { Safyan } from "safyan-sdk";
const safyan = new Safyan({ apiKey: "sfk_your_key_here" });
// Optimize a prompt
const result = await safyan.optimize("make my code faster", { mode: "code" });
console.log(result.translation);
// Score a prompt (0-100)
const score = await safyan.score("help me with something");
console.log(score.total, score.grade); // 22 "F"
// Compile only (no AI call, instant)
const compiled = await safyan.compile("write tests for my API");
console.log(compiled.compiled);Models
safyan-auto— full optimization + smart model routingsafyan-fast— compile only, half the cost
Get Your API Key
- Sign up at safyan.ai
- Go to safyan.ai/console
- Create a key (starts with
sfk_)
Links
License
MIT — AQ Holdings Inc.
