Developer tools
Agent Toolkit
Tchin API functions for your own AI agent (WhatsApp, website, support): create a payment or a payout, read their status and your balance. Ready for OpenAI, the Vercel AI SDK and LangChain.
Download the toolkitNode 18+, no dependencies, server-side only.AI skillsSo your coding assistant or AI knows Tchin.
Using it
const { TchinAgentToolkit } = require('./tchin-agent-toolkit');
const tchin = new TchinAgentToolkit(process.env.TCHIN_PUBLIC_KEY, process.env.TCHIN_PRIVATE_KEY, {
env: 'test', // 'live' pour de vrai
sansVersement: true, // pas d'argent sortant (conseillé pour un agent public)
});
// OpenAI Chat Completions
const r = await openai.chat.completions.create({ model: 'gpt-5', messages, tools: tchin.getTools() });
for (const appel of r.choices[0].message.tool_calls || []) {
const resultat = await tchin.executer(appel.function.name, appel.function.arguments);
messages.push({ role: 'tool', tool_call_id: appel.id, content: JSON.stringify(resultat) });
}
// OpenAI Agents SDK
const { Agent, tool } = require('@openai/agents');
const agent = new Agent({ name: 'Caisse', instructions: 'Tu aides les clients à payer.', tools: tchin.getAgentTools(tool) });
// Vercel AI SDK
const { tool: outil, jsonSchema } = require('ai');
const tools = tchin.getVercelTools(outil, jsonSchema);
// LangChain
const { tool: lcTool } = require('@langchain/core/tools');
const lcTools = tchin.getLangChainTools(lcTool);Tools
| Tool | What it does |
|---|---|
tchin_creer_paiement | a payment: returns token and payment_url; the customer pays themselves |
tchin_etat_paiement | pending, completed, failed, cancelled |
tchin_creer_versement | send money to a customer, who chooses where to receive it (money out: removed with sansVersement) |
tchin_versement, tchin_annuler_versement | a payout’s status; cancel it |
tchin_solde | your balances by country and in crypto |
Security
lectureSeule: the agent only reads.sansVersement: no money out.outils: an explicit list.- The toolkit refuses to start in a browser: your keys stay on the server.
- Errors are returned to the model as messages, never your keys.