Guide · translation
Translate text from your AI agent
translate translates between 21 languages with Argos Translate on our own server, so the text is not sent to a third party. The source language is detected automatically. $0.009 per call of up to 1000 characters.
Try it free
curl -X POST https://agentsvc.io/api/v1/try/translate -H "Content-Type: application/json" -d '{}'JavaScript
npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agentsvc.io/api/v1/proxy/translate", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: "Hello, how are you?", target_lang: "de" }),
});
console.log(await res.json());Python
pip install "x402[httpx]" eth_account
from eth_account import Account
from x402 import x402Client
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
client = x402Client()
register_exact_evm_client(client, EthAccountSigner(Account.from_key(PRIVATE_KEY)))
async with x402HttpxClient(client) as http:
r = await http.post("https://agentsvc.io/api/v1/proxy/translate", json={"text": "Hello, how are you?", "target_lang": "de"})
await r.aread()
print(r.json())Input and output
text: up to 1000 characters per call.target_lang: en, de, fr, es, it, pt, nl, pl, sv, cs, el, ru, uk, tr, ar, hi, id, vi, zh, ja or ko.source_lang: optional, detected if left out. Pairs without a direct model go through English.
You get translated_text, the detected source_lang with its confidence, and truncated if the text was longer than 1000 characters.
Longer texts
Split at paragraph or sentence ends into parts under 1000 characters, translate them one by one and join the results. Splitting in the middle of a sentence makes the translation worse.
Paying
No account and no API key. Three ways to pay, all only for calls that succeed:
- Wallet (x402): a separate wallet with a few dollars of USDC on Base, Solana, Polygon or Arbitrum. The x402 client pays the price from the 402 answer and retries; you pay no gas.
- Credit token: buy one at /credits ($5 to $100, USDC on Base, +10% bonus) and send it as
Authorization: Bearer. Good for a script that runs through a long list. - Zero: if your agent already uses the Zero CLI, it pays the 402 for you:
zero fetch https://agentsvc.io/api/v1/proxy/translate -d '{"text":"Hello, how are you?","target_lang":"de"}'
Details for every client, MCP and frameworks: docs, LangChain, Vercel AI SDK.
Claude Code, Codex or Cursor can learn this as a skill: npx skills add agentsvc/skills (source).