@ramen-ai/sdk
v0.6.2
Published
The official TypeScript/Node.js SDK for the ramen ai PaaS and Expert Runtime.
Maintainers
Readme
@ramen-ai/sdk
The official TypeScript/Node.js SDK for the ramen ai platform — PaaS guardrail evaluation and Expert Runtime chat.
Get a free API key — register at ramenai.dev/pricing to get your
ramen_ak_...key.
Install
npm install @ramen-ai/sdkQuick Start
import { RamenClient } from '@ramen-ai/sdk';
const client = new RamenClient({ apiKey: 'ramen_ak_...' });
// Evaluate content against guardrail policies
const evaluation = await client.paas.evaluate({
policy_ids: ['your-policy-id'],
input: 'Content to evaluate',
});
console.log(evaluation.allowed); // true | false
console.log(evaluation.total_violations); // GuardrailViolation[]
console.log(evaluation.statutory_anchors); // string[] — causal legal citations
// Chat with a deployed Expert
const chat = await client.experts.chat('your-expert-id', 'Hello!');
console.log(chat.response);API Reference
RamenClient(config)
| Option | Type | Required | Description |
|----------------|----------|----------|---------------------------------------------------------------------------------|
| apiKey | string | Yes | Your ramen ai API key (ramen_ak_...) — get one at ramenai.dev/pricing |
| baseUrl | string | No | Override the default https://api.ramenai.dev |
| providerKey | string | No | BYOK — your own LLM provider key (OpenAI, Anthropic, etc.). Required on Developer and Professional tiers; omit on Business and Enterprise where managed inference is included. Forwarded as X-Provider-Key. |
| providerName | string | No | BYOK — provider selector: "openai" (default) | "anthropic" | "google". Only meaningful with providerKey. |
client.paas.evaluate(request)
Evaluate input against one or more guardrail policies in parallel. Returns a PaasEvaluateResponse with:
allowed— the compliance verdicttotal_violations—GuardrailViolation[]withreasoningandrecovery_instruction(V5)statutory_anchors—string[]— causal legal citations bound to the verdict. Empty[]onallowed: true; anchors of violating policies only onallowed: falsereceipt— V5 Ed25519-signed cryptographic audit receipt when configured server-side
client.paas.auditAsync(request)
Submit an asynchronous compliance audit. Results are delivered to your webhook URL.
client.experts.chat(expertId, message, history?)
Send a message to a deployed Expert and receive a response.
License
MIT
