@studio99/api
v0.1.0
Published
Official Node.js client for the Studio99 Indic Typography API: exact Hindi, Marathi, Gujarati and English typography as editable SVG and PNG.
Maintainers
Readme
studio99-node
Official Node.js client for the Studio99 Indic Typography API: exact Hindi, Marathi, Gujarati and English text as editable SVG and PNG, from real calligraphy fonts.
- Zero dependencies, TypeScript types included, Node 18+
- Types generated by hand from the OpenAPI spec
- Server-side only. The client refuses to start in a browser, so your key never ships to users.
Install
npm install @studio99/api
# or, before the npm release:
npm install github:studio99-app/studio99-nodeGet an API key at https://accounts.studio99.app/dashboard/products/studio99-api (Free plan: 100 credits a month, watermarked previews).
Quick start
import { Studio99 } from '@studio99/api';
const s99 = new Studio99(); // reads STUDIO99_API_KEY
const { data, usage } = await s99.generate({
text: 'shubh vivah', // Latin letters are transliterated; Devanagari/Gujarati work as-is
language: 'hindi',
use_case: 'wedding',
count: 4, // 1 credit per variant
});
for (const variant of data.generatedResults) {
console.log(variant.fontFamily, variant.resultText);
// variant.svg.svgString is a complete, editable SVG document
}
console.log('Credits left:', usage.remaining);Methods
| Method | Endpoint | Cost |
|---|---|---|
| generate(body) | POST /generate | 1 credit per variant |
| render({ text, fontId, fontSize?, format? }) | POST /render | 1 credit |
| fonts({ language?, mood?, use_case?, limit? }) | GET /fonts | free |
| library.search({ q?, category?, language?, page?, limit? }) | GET /library/search | free |
| library.get(id) | GET /library/{id} | free |
| library.download(id, 'PNG' \| 'JPG' \| 'SVG') | GET /library/{id}/download | 1 credit |
| library.renderSvg(id) | GET /library/{id}/render-svg | 1 credit |
| capabilities(), health() | meta | free |
Every method resolves to { data, usage?, rateLimit }.
Exact rendering in one font
const { data: { fonts } } = await s99.fonts({ language: 'marathi', mood: 'festive', limit: 5 });
const { data } = await s99.render({ text: 'दिवाळीच्या शुभेच्छा', fontId: fonts[0].id, format: 'svg' });
if (data.format === 'svg') console.log(data.svgString);Free plan
Free-plan calls return a small watermarked JPG in preview (no commercial licence) instead of svg/png. Check usage.license or variant.commercialLicense.
Errors and retries
Failed calls throw Studio99Error with code (the API error code, e.g. INSUFFICIENT_CREDITS, TEXT_TOO_LONG, FONT_NOT_FOUND), status and rateLimit.
The client retries RATE_LIMIT_EXCEEDED after the reset time (nothing is charged for a rate-limited call). GET requests are also retried on network errors and 502-504. A generate or render call that may have reached the engine is never retried automatically, so you are never charged twice. Tune with new Studio99({ maxRetries, timeoutMs }).
Keep your key safe
- Keep it in an environment variable on your server. Never commit it, never send it to a browser or a mobile app.
- Call Studio99 from your backend and pass only the resulting SVG/PNG to your frontend.
- Rotate a leaked key at accounts.studio99.app; a revoked key stops working within a minute.
Links
Docs · Pricing · Changelog · Status · API terms · Examples
Licence
This client: MIT. The API, its fonts and the artwork it returns are governed by the API terms; the fonts are proprietary and never leave our servers.
Built by ArtoMania Studio, Pune · [email protected]
