Translate API: text translation for AI agents
Translate text between 20 languages with automatic source language detection, for $0.002 USDC per call through x402 on Base. No signup, no API key.
Endpoint
POST https://apisphere.us.ci/api/v1/translate returns the translated text, detected source language, and target language. A plain GET only advertises the x402 payment challenge - send text over POST.
- Price: $0.002 USDC per call, settled on Base through x402.
- Freshness: results cached for 15 minutes (NEAR_REAL_TIME).
- Supports 20 languages with automatic source detection.
Request fields
Send a JSON body. Invalid bodies return 400 with field-level details.
- text (required): 1 to 10,000 characters - the text to translate.
- target_language (required): ISO 639-1 code (e.g., "id", "en", "es").
- source_language (optional): ISO 639-1 code; omit for auto-detection.
curl -X POST https://apisphere.us.ci/api/v1/translate -H "Content-Type: application/json" -H "X-PAYMENT: <signed-payment-payload>" -d '{"text": "Hello, how are you?", "target_language": "id"}'Response
A 200 response returns the translated text, detected source language, and target language, plus a meta block with the request id and latency.
- 400 - invalid text or language code (details in the response).
- 402 - missing or invalid payment.
- 429 - rate limited; honor Retry-After.
- 502 - upstream provider error; the same request is safe to retry.
{
"translated_text": "Halo, apa kabar?",
"detected_source_language": "en",
"input": "Hello, how are you?",
"target_language": "id",
"meta": {
"cache": "miss",
"request_id": "7f3a9c2e-1b4d-4f6a-8c2e-9d1f5a3b7c4e",
"latency_ms": 98
}
}