Docs · SDKs

SDKs e compatibilidade

Use o SDK oficial para chamadas tipadas, ou aponte um cliente que você já tem para a base URL da Onerall.

TypeScript

npm i @onerall/sdk
import { Onerall } from "@onerall/sdk";

const onerall = new Onerall({ apiKey: process.env.ONERALL_API_KEY! });

const out = await onerall.call("text.generate", { input: "Resuma este texto" });
console.log(out.data, out.usage.cost_usd);

Python

pip install onerall
from onerall import Onerall

client = Onerall(api_key=os.environ["ONERALL_API_KEY"])
out = client.call("vision.ocr", file_url="https://exemplo.com/nota.pdf")
print(out.data)

Cliente compatível com OpenAI

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://onerall.com/api/public/v1/compat",
  apiKey: process.env.ONERALL_API_KEY,
});

O modo compat aceita /chat/completions e /embeddings e aplica os mesmos limites e auditoria.