50 lines
2.3 KiB
Markdown
50 lines
2.3 KiB
Markdown
|
|
# NOMYO.js Documentation
|
||
|
|
|
||
|
|
Comprehensive documentation for the NOMYO secure JavaScript/TypeScript chat client — a drop-in replacement for OpenAI's `ChatCompletion` API with end-to-end encryption.
|
||
|
|
|
||
|
|
To use this library you need an active subscription on [NOMYO Inference](https://chat.nomyo.ai/).
|
||
|
|
|
||
|
|
## Quick Start
|
||
|
|
|
||
|
|
```javascript
|
||
|
|
import { SecureChatCompletion } from 'nomyo-js';
|
||
|
|
|
||
|
|
const client = new SecureChatCompletion({ apiKey: process.env.NOMYO_API_KEY });
|
||
|
|
|
||
|
|
const response = await client.create({
|
||
|
|
model: 'Qwen/Qwen3-0.6B',
|
||
|
|
messages: [{ role: 'user', content: 'Hello!' }],
|
||
|
|
security_tier: 'standard',
|
||
|
|
});
|
||
|
|
|
||
|
|
console.log(response.choices[0].message.content);
|
||
|
|
```
|
||
|
|
|
||
|
|
## Documentation
|
||
|
|
|
||
|
|
1. [Installation](installation.md) — npm, CDN, and native addon setup
|
||
|
|
2. [Getting Started](getting-started.md) — first request, auth, security tiers, error handling
|
||
|
|
3. [API Reference](api-reference.md) — complete constructor options, methods, and types
|
||
|
|
4. [Models](models.md) — available models and selection guidance
|
||
|
|
5. [Security Guide](security-guide.md) — encryption architecture, best practices, and compliance
|
||
|
|
6. [Rate Limits](rate-limits.md) — request limits, burst behaviour, and retry strategy
|
||
|
|
7. [Examples](examples.md) — real-world scenarios, browser usage, and advanced patterns
|
||
|
|
8. [Troubleshooting](troubleshooting.md) — common errors and their fixes
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## Key Features
|
||
|
|
|
||
|
|
- **End-to-end encryption** — AES-256-GCM + RSA-OAEP-4096. No plaintext ever leaves your process.
|
||
|
|
- **OpenAI-compatible API** — `create()` / `acreate()` accept the same parameters as the OpenAI SDK.
|
||
|
|
- **Browser + Node.js** — single package, separate entry points for each runtime.
|
||
|
|
- **Automatic key management** — keys are generated on first use and optionally persisted to disk (Node.js).
|
||
|
|
- **Automatic key rotation** — RSA keys rotate on a configurable interval (default 24 h) to limit fingerprint lifetime.
|
||
|
|
- **Security tiers** — per-request routing to `standard`, `high`, or `maximum` isolation hardware.
|
||
|
|
- **Retry with exponential backoff** — automatic retries on 429 / 5xx / network errors (configurable).
|
||
|
|
- **Resource lifecycle** — `dispose()` immediately zeros in-memory key material and stops the rotation timer.
|
||
|
|
|
||
|
|
## Technical Security Docs
|
||
|
|
|
||
|
|
For cryptographic architecture, threat model, and implementation status see [SECURITY.md](../docs/SECURITY.md).
|