Xpersona
B

Baidu Text Translate

CLAWHUB · Unverified

Translate text using Baidu AI Translation API via trans-cli with Baidu-specific language codes, API key management, error handling, and environment diagnostics. Skill: Baidu Text Translate Owner: baidu-translate Summary: Translate text using Baidu AI Translation API via trans-cli with Baidu-specific language codes, API key management, error handling, and environment diagnostics. Tags: latest:1.0.1 Version history: v1.0.1 | 2026-04-29T03:28:05.140Z | user - Added required TRANS_API_KEY environment variable to skill metadata. - No other changes to skill logic or documentation.

62
Rank
84
Safety
1.4k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.4K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: medium.

clawhub skill install s173pby7qgzc6mnef856135vr983z06v:baidu-text-translate
  1. Setup complexity is MEDIUM. Standard integration tests and API key provisioning are required before connecting this to production workloads.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-baidu-translate-baidu-text-translate/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

16,931 characters of source documentation, loaded on request.

Extracted files

3 files captured from the source.

SKILL.md

---
name: baidu-text-translate
description: Use this skill whenever you need to translate text with the trans-cli tool (Baidu Translation AI API). Covers JSON output contract, Baidu-specific language codes (jp/kor/fra/spa/ara — not ISO defaults), exit code semantics, error decision tree, first-time API key setup, QUOTA_EXCEEDED / AUTH_FAILED recovery, environment self-diagnosis via `trans doctor`, and listing supported languages via `trans languages`. Trigger on any of: running `trans text`, shell pipelines with translation, trans-cli errors, API key configuration, `trans doctor` checks, or looking up language codes.
homepage: https://fanyi.baidu.com
metadata: {"clawdbot":{"emoji":"🌐","requires":{"bins":["trans"],"env":["TRANS_API_KEY"]},"install":[{"id":"npm","kind":"npm","package":"@bdtrans/trans-cli","bins":["trans"],"label":"Install trans-cli (npm)"}]}}
---

# baidu_text_translate — Agent Reference

`trans text` wraps the Baidu AI Translation API. Use `--json` — it separates
success (stdout) from errors (stderr) and gives you structured fields to act on.

```bash
trans text --json "你好世界"                             # auto-detect → English
trans text --json --from zh --to jp "你好"               # explicit languages
trans text --json --to fra --reference "使用正式语气" "你好"  # custom instruction
echo "早上好" | trans text --json                        # stdin pipe
```

---

## Environment Diagnosis

Before translating, verify the environment with `trans doctor`:

```bash
trans doctor           # human-readable output
trans doctor --json    # JSON output for Agent parsing
```

**JSON contract** (stdout):
```json
{
  "checks": [
    {"name":"api_key",     "ok":true,  "source":"env/config", "message":"configured"},
    {"name":"connectivity","ok":true,  "latency_ms":243,       "message":"reachable"},
    {"name":"account",     "ok":true,                          "message":"valid"}
  ],
  "all_ok": true
}
```

| Exit | `all_ok` | Meaning |
|------|----------|---------|
| 0 | `true` | All checks passed — ready to translate |
| 2 | `false` | At least one check failed — inspect `checks[].ok` |

**When a check fails**, `help_url` in the failing check points to the fix:
- `api_key.ok:false` → set `TRANS_API_KEY` (see Configuration below)
- `account.ok:false` → key invalid/expired or quota exhausted

Run `trans doctor --json` as the first step when diagnosing any trans-cli failure.

---

## JSON Contract

**Success** (stdout, exit 0):
```json
{"from":"zh","to":"en","source":"你好","translated":"Hello"}
```

| Field | Note |
|-------|------|
| `from` | API-detected language — may differ from `--from auto` |
| `to` | Target language |
| `source` | Original input |
| `translated` | Result |

**Error** (stderr, exit ≠ 0):
```json
{"code":"AUTH_FAILED","message":"…","help_url":"https://…","raw_code":"52001"}
```

`help_url` and `raw_code` are omitted when not applicable.

---

## Error Decision Tree

| Exit | `code` | Cause | Action |
|------|--------|-------|--------|

_meta.json

{
  "ownerId": "kn7fhw0h9fm3z24r13j111w56583yfp7",
  "slug": "baidu-text-translate",
  "version": "1.0.1",
  "publishedAt": 1777433285140
}

skill-card.md

## Description:

Translate text using Baidu AI Translation API via trans-cli with Baidu-specific language codes, API key management, error handling, and environment diagnostics.

This skill is ready for commercial/non-commercial use.

## Publisher:

[baidu-translate](https://clawhub.ai/user/baidu-translate)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and agents use this skill to translate text with Baidu's trans-cli, diagnose API key and account readiness, choose Baidu-specific language codes, and respond to translation errors.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Translated text is sent to Baidu's external translation service.

Mitigation: Avoid translating secrets, credentials, private documents, or regulated data unless that data sharing has been approved.

Risk: The skill depends on installing and running the external @bdtrans/trans-cli npm package.

Mitigation: Review the npm package and version before installation, especially in sensitive environments.

Risk: The Baidu API key may be exposed through unsafe shell history, config files, or prompts.

Mitigation: Prefer TRANS_API_KEY or carefully managed config storage and do not paste credentials into translated text.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/baidu-translate/skills/baidu-text-translate)
- [Baidu Translate](https://fanyi.baidu.com)
- [Baidu Translation Open Platform](https://fanyi-api.baidu.com/)
- [Baidu Developer Center](https://fanyi-api.baidu.com/manage/developer)
- [Baidu API Key Management](https://fanyi-api.baidu.com/manage/apiKey)
- [Baidu Account Recharge](https://fanyi-api.baidu.com/manage/account)
- [Baidu Translation Usage Details](https://fanyi-api.baidu.com/api/trans/user/usage)

## Skill Output:

**Output Type(s):** [text, markdown, shell commands, configuration, guidance]

**Output Format:** [Markdown with inline shell commands and JSON examples]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Guidance centers on trans-cli JSON output, exit codes, language codes, API key setup, and environment diagnostics.]

## Skill Version(s):

1.0.1 (source: server release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to Baidu Text Translate and adjacent AI workflows.