Official SDKs: PHP, Node.js & Python
Install one package, set your API key and call any RSFlowHub API in a few lines. The SDKs handle authentication, errors, retries and file uploads, and they keep working when new APIs are released.
Direct System Definition: RSFlowHub SDKs
RSFlowHub has official open-source SDKs for PHP (composer require rsflowhub/rsflowhub-php), Node.js and TypeScript (npm install rsflowhub) and Python (pip install rsflowhub). Each SDK reads your key from RSFLOWHUB_API_KEY, calls the REST API at /api/v1, returns the same {success, request_id, data, meta} envelope, raises typed errors by error code and retries 429 and 5xx answers. Methods are named after the endpoint, so a new API works without upgrading the SDK.
Choose your language
| Language | Package | Works with | Guide | Source |
|---|---|---|---|---|
| PHP 8.1+ | rsflowhub/rsflowhub-php |
Laravel (auto-discovered facade), Symfony, WordPress, any PHP app | PHP guide | GitHub |
| Node.js / TypeScript 18+ | rsflowhub |
Next.js, Express, NestJS, Nuxt, SvelteKit, Bun, Deno, Cloudflare Workers, Vercel Edge | JavaScript guide | GitHub |
| Python 3.9+ | rsflowhub |
Django, FastAPI, Flask, Celery, scripts and notebooks (sync and async clients) | Python guide | GitHub |
1. Install
composer require rsflowhub/rsflowhub-php
npm install rsflowhub
# or: yarn add rsflowhub · pnpm add rsflowhub · bun add rsflowhub
pip install rsflowhub
# or: poetry add rsflowhub · uv add rsflowhub
2. Set your API key
Create a key in your dashboard and put it in an environment variable. Every SDK reads RSFLOWHUB_API_KEY automatically, so the key stays out of your code. See Authentication & API keys.
RSFLOWHUB_API_KEY=rfh_your_api_key
Your API key spends your credits, and anything in browser or mobile app code is public. Call RSFlowHub from your backend (a Next.js route handler or server action, Laravel, Express, Django, FastAPI) and have your frontend call that. The Node.js SDK refuses to start in a browser unless you explicitly allow it.
3. Make your first call
AI endpoints put their output in data.result. Each SDK gives you that directly: $res->result('key') in PHP, res.result in Node.js and Python. The request id is always there for support.
<?php
require 'vendor/autoload.php';
use RSFlowHub\RSFlowHub;
$client = new RSFlowHub(); // reads RSFLOWHUB_API_KEY, or new RSFlowHub('rfh_...')
$res = $client->ai->sentimentAnalysis([
'text' => 'Setup took two minutes and support answered right away.',
]);
echo $res->result('sentiment'); // "positive"
echo $res->requestId; // "req_..." quote it when you contact support
import { RSFlowHub } from 'rsflowhub';
const client = new RSFlowHub(); // reads RSFLOWHUB_API_KEY, or { apiKey: 'rfh_...' }
const res = await client.ai.sentimentAnalysis({
text: 'Setup took two minutes and support answered right away.',
});
console.log(res.result.sentiment); // "positive"
console.log(res.requestId); // "req_..." quote it when you contact support
from rsflowhub import RSFlowHub
client = RSFlowHub() # reads RSFLOWHUB_API_KEY, or RSFlowHub(api_key="rfh_...")
res = client.ai.sentiment_analysis(
text="Setup took two minutes and support answered right away.",
)
print(res.result["sentiment"]) # "positive"
print(res.request_id) # "req_..." quote it when you contact support
How methods are named
A method is the endpoint's URL name in the style of each language. Every API in the API reference works this way, including APIs released after you installed the SDK.
| Endpoint | PHP | Node.js / TypeScript | Python |
|---|---|---|---|
POST /ai/sentiment-analysis |
$client->ai->sentimentAnalysis([...]) |
client.ai.sentimentAnalysis({...}) |
client.ai.sentiment_analysis(...) |
POST /ai/translation |
$client->ai->translation([...]) |
client.ai.translation({...}) |
client.ai.translation(...) |
POST /ai/pii-redaction |
$client->ai->piiRedaction([...]) |
client.ai.piiRedaction({...}) |
client.ai.pii_redaction(...) |
POST /knowledge-bases/{id}/ask |
$client->knowledgeBases->ask($id, [...]) |
client.knowledgeBases.ask(id, {...}) |
client.knowledge_bases.ask(id, ...) |
POST /chatbots/{id}/messages |
$client->chatbots->sendMessage($id, [...]) |
client.chatbots.sendMessage(id, {...}) |
client.chatbots.send_message(id, ...) |
| Any other route | $client->request('GET', '/account/usage') |
client.request('GET', '/account/usage') |
client.request("GET", "/account/usage") |
Ids in the URL come first, then the request body. Every method also has typed parameters for autocomplete in your editor; the full list is in each repository's docs/ENDPOINTS.md.
Language guides
Each guide covers the response object, path ids and file uploads, knowledge bases and chatbots, every error class, options, retries and framework examples for that language.
RSFlowHub PHP SDK
composer require rsflowhub/rsflowhub-php
PHP 8.1+ · Laravel, Symfony, WordPress, any PHP app
RSFlowHub JavaScript & TypeScript SDK
npm install rsflowhub
Node.js 18+ · Next.js, React (server side), Express, NestJS, Nuxt, SvelteKit
RSFlowHub Python SDK
pip install rsflowhub
Python 3.9+ · Django, FastAPI, Flask, Celery, scripts and notebooks
All SDKs retry 429, 502, 503 and 504 answers with backoff (never charged) and turn every other API error into a typed exception with the error code, message and request id. Limits and credits: Rate limits & credits.
Why the SDKs never go out of date
- Methods are not hard-coded. An AI endpoint is called by its name, so a new API works the day it ships.
- New routes are looked up live. Any other method the SDK does not know yet is found in the public OpenAPI document the first time you call it.
- Types are regenerated weekly. Autocomplete and reference docs are rebuilt from the same OpenAPI document, so upgrading only adds editor hints.
The OpenAPI document (
/api/v1/openapi.json) describes every request and response. Import it into Postman or Insomnia, or generate a client for Go, Java, C# or Ruby with any OpenAPI generator. More examples are in the examples repository.