{"id":"7830d938-e77e-46e0-a780-efbaa61aee78","entityType":"agent","slug":"clawhub-sendmux-ai-sendmux-token-efficient-usage","name":"sendmux-token-efficient-usage","canonicalUrl":"https://www.xpersona.co/agent/clawhub-sendmux-ai-sendmux-token-efficient-usage","canonicalPath":"/agent/clawhub-sendmux-ai-sendmux-token-efficient-usage","generatedAt":"2026-10-10T10:42:50.425Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T06:28:10.081Z","emptyReason":null},"description":"Choose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.6K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s175c163jct9mhsx0mrfbz64j989s00r:sendmux-token-efficient-usage","sourceUrl":"https://clawhub.ai/sendmux.ai/sendmux-token-efficient-usage","homepage":"https://clawhub.ai/sendmux.ai/skills/sendmux-token-efficient-usage","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/sendmux.ai/sendmux-token-efficient-usage","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/sendmux.ai/skills/sendmux-token-efficient-usage","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":64,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"sendmux-token-efficient-usage technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metadata."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T06:28:10.081Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T06:28:10.081Z","emptyReason":null},"stars":null,"forks":null,"downloads":1619,"packageName":null,"latestVersion":"1.0.11","tractionLabel":"1.6K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T06:28:10.081Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T06:28:10.081Z","lastCrawledAt":"2026-10-10T06:28:10.081Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T06:28:10.081Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.11","createdAt":"2026-10-02T04:23:30.076Z","changelog":"sendmux-token-efficient-usage v1.0.11 - Updated internal documentation in SKILL.md. - Removed the obsolete skill-card.md file. - Incremented version from 1.7.0 to 1.7.1 in SKILL.md. - No changes to runtime logic or user-facing features.","fileCount":3,"zipByteSize":7790},{"version":"1.0.10","createdAt":"2026-09-30T12:03:09.183Z","changelog":"Version 1.7.0 - Updated version number to 1.7.0. - SKILL.md content refreshed (minor or meta changes only; main guidance and tables remain unchanged). - Removed the deprecated skill-card.md file for streamlined documentation.","fileCount":3,"zipByteSize":7763},{"version":"1.0.9","createdAt":"2026-09-18T05:52:35.470Z","changelog":"Version 1.6.0 introduces updated environment variable guidance and clarifies authentication and attachment handling. - Added guidance for the SENDMUX_API_KEY environment variable in skill metadata. - Updated authentication connection and product surface selection details. - Streamlined connection validation procedures for CLI, SDK, and MCP. - Clarified credential and attachment handling boundaries. - Expanded attachment handling instructions and credential ownership clarifications. - Removed legacy file: skill-card.md.","fileCount":3,"zipByteSize":7942},{"version":"1.0.8","createdAt":"2026-09-11T04:00:34.414Z","changelog":"Version 1.5.0 - Added guidance for validating credentials using `get-connection` CLI/MCP operations. - Expanded authentication instructions to cover REST OAuth profiles and clarify usage of API keys for different surfaces. - Clarified boundaries regarding API-key use for management calls and OAuth profile routing for login/refresh. - Updated procedure descriptions to emphasize credential validation and correct routing for authentication. - Removed redundant or unclear details for improved accuracy. - Removed obsolete skill-card.md file.","fileCount":3,"zipByteSize":5736},{"version":"1.0.7","createdAt":"2026-09-01T10:37:53.475Z","changelog":"Version 1.0.7 - Clarified inbox storage behavior: after owner-approved sending, inbox increases to at least 5 GiB; revoking sending does not reduce storage. - No functional or code changes; documentation wording improved for accuracy.","fileCount":3,"zipByteSize":5494},{"version":"1.0.6","createdAt":"2026-09-01T10:28:55.533Z","changelog":"- Updated skill documentation for improved clarity and minor corrections. - Increased minimum inbox size after owner-approved sending from 5 GiB to at least 5 GiB. - Removed redundant file: skill-card.md. - Version bump from 1.4.0 to 1.4.1.","fileCount":3,"zipByteSize":5521},{"version":"1.0.5","createdAt":"2026-09-01T06:06:09.399Z","changelog":"sendmux-token-efficient-usage v1.4.0 - Added details for CLI agent registration, durable profile reuse, and delegated token flow after owner approval. - Clarified inbox storage caps and limits before and after sending approval and revocation. - Updated boundaries around agent token handling and SEND/MAILBOX resource keys. - Removed the obsolete \"skill-card.md\" file. - Incremented version and improved explanations for agent setup and secure call patterns.","fileCount":3,"zipByteSize":5398},{"version":"1.0.4","createdAt":"2026-07-09T03:58:52.735Z","changelog":"- Version bumped from 1.2.0 to 1.3.0 in SKILL.md. - No other content changes detected.","fileCount":3,"zipByteSize":5223}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s175c163jct9mhsx0mrfbz64j989s00r:sendmux-token-efficient-usage","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s175c163jct9mhsx0mrfbz64j989s00r:sendmux-token-efficient-usage` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/sendmux.ai/sendmux-token-efficient-usage before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sendmux-ai-sendmux-token-efficient-usage/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sendmux-ai-sendmux-token-efficient-usage/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sendmux-ai-sendmux-token-efficient-usage/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-sendmux-ai-sendmux-token-efficient-usage/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-sendmux-ai-sendmux-token-efficient-usage/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-sendmux-ai-sendmux-token-efficient-usage/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T10:42:50.421Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sendmux-ai-sendmux-token-efficient-usage/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sendmux-ai-sendmux-token-efficient-usage/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sendmux-ai-sendmux-token-efficient-usage/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-sendmux-ai-sendmux-token-efficient-usage/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T06:28:10.081Z","emptyReason":null},"readme":"Skill: sendmux-token-efficient-usage\n\nOwner: sendmux.ai\n\nSummary: Choose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\n\nTags: latest:1.0.11\n\nVersion history:\n\nv1.0.11 | 2026-10-02T04:23:30.076Z | auto\n\nsendmux-token-efficient-usage v1.0.11\n\n- Updated internal documentation in SKILL.md.\n- Removed the obsolete skill-card.md file.\n- Incremented version from 1.7.0 to 1.7.1 in SKILL.md.\n- No changes to runtime logic or user-facing features.\n\nv1.0.10 | 2026-09-30T12:03:09.183Z | auto\n\nVersion 1.7.0\n\n- Updated version number to 1.7.0.\n- SKILL.md content refreshed (minor or meta changes only; main guidance and tables remain unchanged).\n- Removed the deprecated skill-card.md file for streamlined documentation.\n\nv1.0.9 | 2026-09-18T05:52:35.470Z | auto\n\nVersion 1.6.0 introduces updated environment variable guidance and clarifies authentication and attachment handling.\n\n- Added guidance for the SENDMUX_API_KEY environment variable in skill metadata.\n- Updated authentication connection and product surface selection details.\n- Streamlined connection validation procedures for CLI, SDK, and MCP.\n- Clarified credential and attachment handling boundaries.\n- Expanded attachment handling instructions and credential ownership clarifications.\n- Removed legacy file: skill-card.md.\n\nv1.0.8 | 2026-09-11T04:00:34.414Z | auto\n\nVersion 1.5.0\n\n- Added guidance for validating credentials using `get-connection` CLI/MCP operations.\n- Expanded authentication instructions to cover REST OAuth profiles and clarify usage of API keys for different surfaces.\n- Clarified boundaries regarding API-key use for management calls and OAuth profile routing for login/refresh.\n- Updated procedure descriptions to emphasize credential validation and correct routing for authentication.\n- Removed redundant or unclear details for improved accuracy.\n- Removed obsolete skill-card.md file.\n\nv1.0.7 | 2026-09-01T10:37:53.475Z | auto\n\nVersion 1.0.7\n\n- Clarified inbox storage behavior: after owner-approved sending, inbox increases to at least 5 GiB; revoking sending does not reduce storage.\n- No functional or code changes; documentation wording improved for accuracy.\n\nv1.0.6 | 2026-09-01T10:28:55.533Z | auto\n\n- Updated skill documentation for improved clarity and minor corrections.\n- Increased minimum inbox size after owner-approved sending from 5 GiB to at least 5 GiB.\n- Removed redundant file: skill-card.md.\n- Version bump from 1.4.0 to 1.4.1.\n\nv1.0.5 | 2026-09-01T06:06:09.399Z | auto\n\nsendmux-token-efficient-usage v1.4.0\n\n- Added details for CLI agent registration, durable profile reuse, and delegated token flow after owner approval.\n- Clarified inbox storage caps and limits before and after sending approval and revocation.\n- Updated boundaries around agent token handling and SEND/MAILBOX resource keys.\n- Removed the obsolete \"skill-card.md\" file.\n- Incremented version and improved explanations for agent setup and secure call patterns.\n\nv1.0.4 | 2026-07-09T03:58:52.735Z | auto\n\n- Version bumped from 1.2.0 to 1.3.0 in SKILL.md.\n- No other content changes detected.\n\nv1.0.3 | 2026-07-09T01:46:37.531Z | auto\n\n- Bump skill version from 1.1.0 to 1.2.0 in SKILL.md.\n- No other content changes.\n\nv1.0.2 | 2026-07-08T04:08:16.548Z | auto\n\n- Updated SKILL.md with new details: Sending uploads now capped at 18 MiB per file; clarified use of `blob_id` for mailbox sends and `attachment_id` for Sending sends.\n- Improved guidance on attachment handling, specifying when to use `blob_id` or `attachment_id` instead of inline base64.\n- Removed the redundant skill-card.md file for better consolidation.\n\nv1.0.1 | 2026-07-06T01:37:12.841Z | auto\n\n**Summary:** Updated to version 1.1.0 with documentation improvements.\n\n- Bumped version number from 1.0.0 to 1.1.0.\n- No functional or behavioral changes; SKILL.md edits only.\n- Documentation updated, but core guidance and usage remain unchanged.\n\nv1.0.0 | 2026-07-03T09:06:37.584Z | auto\n\nsendmux-token-efficient-usage v1.0.0\n\n- Initial release.\n- Provides a detailed guide for choosing token-efficient Sendmux API calls across MCP, CLI, SDKs, and HTTP.\n- Outlines boundaries for safe usage, including API key handling and attachment transfer guidelines.\n- Includes tables mapping common tasks to the cheapest correct Sendmux API operations.\n- Offers best practices for reducing token usage, such as batching, syncing by delta, using counts/snippets, and efficient paginations.\n- Contains CLI examples for common token-efficient workflows.\n\nArchive index:\n\nArchive v1.0.11: 3 files, 7790 bytes\n\nFiles: skill-card.md (1846b), SKILL.md (17697b), _meta.json (149b)\n\nFile v1.0.11:SKILL.md\n\n---\nname: \"sendmux-token-efficient-usage\"\ndescription: \"Choose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\"\nversion: \"1.7.1\"\nmetadata:\n  openclaw:\n    skillKey: \"sendmux-token-efficient-usage\"\n    homepage: \"https://github.com/Sendmux/skills\"\n    primaryEnv: \"SENDMUX_API_KEY\"\n    envVars:\n      - name: \"SENDMUX_API_KEY\"\n        required: false\n        description: \"Optional Sendmux API key or scoped agent token used by CLI, SDK, HTTP, or MCP examples.\"\n---\n\n# Sendmux token-efficient usage\n\n## ClawHub account note\n\nThis ClawHub skill connects OpenClaw agents to Sendmux. Some workflows require a Sendmux account and an appropriate Sendmux API key or agent token. Sendmux account usage is external to ClawHub; do not ask users to paste secrets into chat.\n\nUse this skill to choose the lowest-cost Sendmux route that still answers the task correctly.\n\n## Boundaries\n\n- Do not ask the user to paste an API key.\n- For API-key authentication, use `smx_mbx_*` keys for normal Mailbox calls.\n- For a self-registered agent, reuse one durable CLI profile. Mailbox reads become available after provisioning, before owner approval; Sending stays blocked until owner approval.\n- For API-key authentication, use `smx_root_*` for Management calls.\n- Do not default to MCP for every task. MCP is best when the required tool is curated; CLI and SDK cover broader surfaces.\n- Keep real attachment bytes outside model context and route their mechanics to `sendmux-attachments`; use the attachment route reference below.\n- Do not read full mailbox bodies, every message, or every log row unless the user asks for full content and narrower calls cannot answer.\n\nChoose the authentication connection, then its already-approved product surface. For an existing OAuth profile, use the already-known approved surface from its granted permissions or setup context. If that surface is unknown, show the surface-specific alternatives below and ask which one the profile grants; there is no universal Mailbox default.\n\n| Authentication connection | Validate with | Ownership boundary |\n| --- | --- | --- |\n| Existing CLI or REST OAuth profile | The selected CLI operation: `mailbox:get-connection`, `management:get-connection`, or `sending:get-connection` | Explain that the check stays within the profile's approved surface, scopes, and mailboxes. `sendmux-cli` owns login and refresh. |\n| SDK application credentials | The selected SDK operation: `mailboxGetConnection`, `managementGetConnection`, or `sendingGetConnection` | The application supplies SDK credentials; this is not a CLI profile check. |\n| Already-connected MCP session | The selected MCP operation: `mailbox_get_connection`, `management_get_connection`, or `sending_get_connection` | This validates only that MCP session. `sendmux-mcp-setup` owns hosted MCP OAuth setup; it is not an alternate view of a REST profile. |\n\nThese checks need no mailbox selector and send no email. Public OpenAPI discovery does not validate credentials.\n\n## Surface choice\n\n| Situation                               | Use                                 | Why                                                           |\n| --------------------------------------- | ----------------------------------- | ------------------------------------------------------------- |\n| Connected agent and curated tool exists | MCP tool                            | Small schema and no SDK boilerplate.                          |\n| One-off terminal task                   | `sendmux` CLI with `--json`         | Direct, scriptable, exposes the full generated operation set. |\n| Application code or repeated workflow   | SDK for the project already in use  | Reuses client setup, pagination, headers, and retry helpers.  |\n| MCP lacks the needed operation          | CLI for terminal work, SDK for code | Do not invent uncurated MCP tools.                            |\n| No package/tooling available            | Direct HTTP                         | Keep request bodies and headers aligned to OpenAPI.           |\n\nCredential ownership follows the surface. For a durable CLI agent profile, the CLI automatically exchanges and caches the one-hour delegated token for `sending:*` commands. SDK callers supply a compatible `apiKey` or `accessToken` (or their own provider callback); SDK helpers do not read or update CLI profile state.\n\n## Cheapest-call map\n\n| Task                            | Cheapest correct default                                                                                                               |\n| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |\n| Send one outbound email         | `sending_send_email`, CLI `sending:send`, SDK `sendingSendEmail`; include `Idempotency-Key`.                                           |\n| Send multiple outbound emails   | `sending_send_email_batch`, CLI `sending:send:batch`, SDK `sendingSendEmailBatch`; do not loop single sends.                           |\n| Send or read attachments        | Use the attachment route reference below.                                                                                              |\n| Count matching mailbox messages | `mailbox_count_messages`, CLI `mailbox:count-messages`, SDK `mailboxCountMessages`.                                                    |\n| Search mailbox text             | `mailbox_search_message_snippets`, CLI `mailbox:search-message-snippets`, SDK `mailboxSearchMessageSnippets`; then fetch selected IDs. |\n| Read several known messages     | `mailbox_batch_get_messages`, CLI `mailbox:batch-get-messages`, SDK `mailboxBatchGetMessages`.                                         |\n| Update/delete several messages  | Batch update/delete after explicit confirmation.                                                                                       |\n| Resume broad mailbox sync       | `mailbox_get_changes`, CLI `mailbox:get-changes`, SDK `mailboxGetChanges`.                                                             |\n| Resume filtered mailbox sync    | CLI/SDK `mailbox:query-message-changes` / `mailboxQueryMessageChanges`; MCP does not curate it yet.                                    |\n| Watch live mailbox events       | CLI/SDK `mailbox:stream-events` / `mailboxStreamEvents`; MCP does not curate it yet.                                                   |\n| Scan threads                    | List threads, then fetch one thread or its messages.                                                                                   |\n| Manage domains/mailboxes/keys   | Management MCP for curated create/list/get/update/suspend/resume/key tools; CLI/SDK for uncovered lifecycle work.                      |\n| Manage sending accounts         | CLI/SDK; MCP does not curate provider tools yet.                                                                                       |\n| Manage webhooks                 | MCP for list/create/test; CLI/SDK for get/update/delete/rotate/delivery payloads.                                                      |\n| Inspect spend, logs, metrics    | Metrics first; use `management:list-email-logs` / `managementListEmailLogs` for filtered summaries, then `management:get-email-log` / `managementGetEmailLog` for one selected row. |\n\n### Attachment route reference\n\n`sendmux-attachments` owns the detailed upload/download procedures and current direct-upload limits.\n\nWhen comparing local-file routes, state how bytes move and which size authority applies for each alternative below, then recommend the one matching the user's environment:\n\n1. **Terminal:** recommend CLI `--attach` for a one-off task. It uploads directly outside model context; server-enforced direct-upload limits apply. There is no presign-limit response.\n2. **Application code:** name `sendEmailWithFiles` or `uploadAttachmentFromFile` from `@sendmux/sending/node`, or `uploadMailboxAttachmentFromFile` from `@sendmux/mailbox/node`. These helpers upload directly outside model context; server-enforced direct-upload limits apply, with no presign-limit response.\n3. **Connected MCP:** name `sending_create_attachment_upload` for Sending, or `mailbox_upload_attachment` with `presign_upload_url=true` for Mailbox. Both use presigned external transfer outside model context. For Sending, obey the upload intent's returned `max_size_bytes`; Mailbox accepts requested `size_bytes` up to 7,500,000.\n\nFor tiny agent-authored content, MCP inline `content_base64` is available only after measuring the decoded content at no more than 32,768 bytes; a filename or file type cannot establish eligibility.\n\nFor presigned Sending uploads, the intent returns a temporary `upload_id`; take the final `attachment_id` from the successful external `PUT` response. A successful external Mailbox upload returns the `blob_id` for Mailbox sends. Never use MCP `file_path` or real-file inline base64.\n\nFor an agent with no key, avoid manual protocol calls and token copying:\n\n```bash\nsendmux agent:register my-agent --default --json\nsendmux mailbox:me:get --profile my-agent --json\nsendmux agent:invite-owner owner@example.com --profile my-agent --json\n```\n\nRegister once, then reuse the durable profile across processes. For this self-registered agent, sending has two owner gates: the owner accepts the invitation, then explicitly approves sending. Once both are complete, use the same profile with `sending:*`; the CLI handles the one-hour delegated token exchange and cache.\n\nExplain the storage boundary alongside this setup: the inbox is capped at 500 MiB before approval. Owner-approved sending raises it to at least 5 GiB first. Revoking sending does not itself change the current inbox storage allocation.\n\n## Read less\n\nFor mailbox questions, reduce the result set before reading content:\n\n1. Count when the user asks \"how many\" or when the query may be broad.\n2. Search snippets with a small `limit` when the user needs examples; choose from the returned `message_id`, `subject`, and `preview` fields.\n3. Batch-get only selected message IDs.\n4. Request clean body/content only when message text affects the answer.\n\nCLI:\n\n```bash\nsendmux mailbox:count-messages \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --json\n\nsendmux mailbox:search-message-snippets \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=10 \\\n  --json\n\nsendmux mailbox:batch-get-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"body_mode\": \"clean_json\",\n    \"max_body_chars\": 4000,\n    \"strip_quotes\": true,\n    \"strip_signature\": true,\n    \"include_attachments\": \"metadata\"\n  }' \\\n  --json\n```\n\n## Write fewer requests\n\nBatch when there is more than one target.\n\nFor API-key or delegated-token authentication, name the Sending authority alongside the recommended call: a send-capable `smx_mbx_*` key or owner-approved Sending-resource `smx_agent_*` token. This applies to both single and batch sends.\n\n```bash\nsendmux sending:send:batch \\\n  --idempotency-key \"$IDEMPOTENCY_KEY\" \\\n  --body-file ./messages.json \\\n  --json\n\nsendmux mailbox:batch-update-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"seen\": true,\n    \"if_in_state\": \"state_from_prior_read\"\n  }' \\\n  --json\n```\n\nFor batch sends, inspect every per-message result before reporting success. Batch can contain mixed outcomes.\n\n## Sync by delta\n\nUse sync endpoints instead of re-listing stable data.\n\nChoose the sync route that matches the requested view: broad mailbox state uses `mailbox:get-changes` / `mailboxGetChanges`; a filtered message view uses `mailbox:query-message-changes` / `mailboxQueryMessageChanges`.\n\nBroad mailbox sync:\n\n```bash\nsendmux mailbox:get-changes \\\n  --query types=messages,folders,threads \\\n  --query messages_since_state=\"$MESSAGES_STATE\" \\\n  --query folders_since_state=\"$FOLDERS_STATE\" \\\n  --query threads_since_state=\"$THREADS_STATE\" \\\n  --query limit=100 \\\n  --json\n```\n\nThis multi-resource sync requires `types=messages,folders,threads`; omitting `types` deliberately selects the legacy message-only response. Before the next call, persist each returned resource's `new_state` and `has_more`. Map `data.types.messages.new_state`, `data.types.folders.new_state`, and `data.types.threads.new_state` to the matching `*_since_state` input. Continue each resource whose saved `has_more` is true independently with its saved state; a narrower response updates only the resource it requested.\n\nFor a message-only continuation, use the selected resource's fields exactly:\n\n```bash\nsendmux mailbox:get-changes \\\n  --query types=messages \\\n  --query messages_since_state=\"$NEXT_MESSAGES_STATE\" \\\n  --query limit=100 \\\n  --json\n```\n\nAfter every response, replace the current response, set `NEXT_MESSAGES_STATE` from its `data.types.messages.new_state`, and repeat only while that same latest response's `data.types.messages.has_more` is true.\n\nFiltered message sync:\n\n```bash\nsendmux mailbox:query-message-changes \\\n  --query since_query_state=\"$QUERY_STATE\" \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=100 \\\n  --json\n```\n\nAfter every response, set `QUERY_STATE` from its `data.new_query_state`, and continue with the same filters only while that same latest response's `data.has_more` is true and the next page is needed.\n\nA polling-loop answer must distinguish sync continuation from cursor-paginated list calls. For the latter, preserve the same filters and a small bounded limit, count matches cumulatively across pages, stop immediately when the local threshold is reached even mid-page, and follow the returned `pagination.next_cursor` only while another list page is needed. At the start of every polling tick, call each enabled sync route once with its saved state and perform each enabled conditional-log read once, even when the prior sync response had `has_more=false`; within that tick, add one call for every requested continuation page.\n\nUse the public delivery-log seams exactly:\n\n- For filtered summary pages, use CLI `management:list-email-logs` or SDK `managementListEmailLogs`. Preserve only supported filters (`status`, `from_date`, `to_date`, `provider_id`, `search`), and map the returned `pagination.next_cursor` to the next `cursor` input.\n- For repeated reads of one known log, CLI `management:get-email-log --if-none-match \"$ETAG\"` can send an ETag supplied from elsewhere, but CLI output is the API JSON body—not an HTTP status/header envelope. It cannot acquire or refresh the ETag or branch on `304`.\n- For the first metadata-bearing read and every later `304`-aware read, use the supported SDK packages directly; `priorEtag` is absent on the first call:\n\n```ts\nimport { responseEtag } from \"@sendmux/core\";\nimport { createManagementClient, managementGetEmailLog } from \"@sendmux/management\";\n\nconst client = createManagementClient({ apiKey: process.env.SENDMUX_API_KEY! });\n\nconst result = await managementGetEmailLog({\n  client,\n  path: { public_id: logId },\n  headers: priorEtag ? { \"If-None-Match\": priorEtag } : {},\n  throwOnError: false,\n});\n\nif (result.response?.status === 304) {\n  // Unchanged representation; there is no response body.\n} else if (result.error) {\n  // Handle the unsuccessful response.\n} else {\n  const log = result.data?.data;\n  const nextEtag = responseEtag(result.response);\n}\n```\n\nThe terminal delivery statuses are `sent`, `failed`, and `rejected`. A `304` means the representation is unchanged; it does not establish a terminal delivery status.\n\n## Transfer less\n\n- Use small `limit` values on list calls.\n- Follow `pagination.next_cursor` only until enough evidence has been gathered.\n- Prefer summary or metrics endpoints before log lists.\n- Use `If-None-Match` for repeated detail reads that previously returned an `ETag`.\n- Use `If-Match` for updates when the prior read returned an `ETag`.\n- For inbound attachments, fetch metadata and use the short-lived `download_url`; if it expires, re-fetch metadata instead of building URLs manually.\n- For outbound attachments, follow the attachment route reference above.\n\nCLI conditional examples:\n\n```bash\nsendmux management:get-email-log \\\n  --path public_id=dlog_abc \\\n  --if-none-match \"$ETAG\" \\\n  --json\n\nsendmux management:update-mailbox \\\n  --path public_id=mbx_abc \\\n  --if-match \"$ETAG\" \\\n  --body '{\"display_name\":\"Agent Inbox\"}' \\\n  --json\n```\n\nSDK helpers:\n\n```\nimport {\n  conditionalHeaders,\n  idempotencyHeaders,\n  paginate,\n  responseEtag,\n} from \"@sendmux/core\";\n\nconst headers = conditionalHeaders({ ifNoneMatch: priorEtag });\nconst writeHeaders = {\n  ...conditionalHeaders({ etag: priorEtag }),\n  ...idempotencyHeaders(operationKey),\n};\n```\n\n## Retry safely\n\nUse `Idempotency-Key` on supported mutations so retrying does not create duplicate work.\n\nGood candidates:\n\n- `sending:send` and `sending:send:batch`.\n- `mailbox:send-message`.\n- Management creates, mailbox key creation, suspend/resume, provider mutations, webhook create/rotate/test.\n\nWhen retrying application code, prefer SDK retry helpers only for safe reads or idempotent writes. Non-idempotent writes should fail rather than risk duplicate side effects.\n\n## Routing\n\n- Setup, key scopes, first call: `sendmux-getting-started`.\n- Email send bodies and SMTP-vs-HTTP choice: `sendmux-send-email`.\n- Attachment upload/download mechanics: `sendmux-attachments`.\n- Mailbox read/search/sync/triage/reply details: `sendmux-mailbox-agent`.\n- Management domains, mailboxes, webhooks, billing, logs: `sendmux-management`.\n- CLI syntax and profiles: `sendmux-cli`.\n- MCP installation and client config: `sendmux-mcp-setup`.\n\nFile v1.0.11:_meta.json\n\n{\n  \"ownerId\": \"kn77z51yqhw8mt9vjfkpt8w74989rfb3\",\n  \"slug\": \"sendmux-token-efficient-usage\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1790915010076\n}\n\nFile v1.0.11:skill-card.md\n\n## Description:\n\nChoose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[sendmux.ai](https://clawhub.ai/user/sendmux.ai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agents use this guide to choose efficient Sendmux email, mailbox, and management operations while limiting unnecessary data retrieval and repeated requests.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Send, delete, or management actions can change account data or send email.\n\nMitigation: Review each requested action before execution and grant management access only when needed.\n\nRisk: Broad credentials or unnecessary mailbox reads can expose sensitive content.\n\nMitigation: Use scoped credentials where possible, keep secrets out of chat, and prefer snippets or targeted reads.\n\n## Reference(s):\n\n- [Sendmux skills homepage (listed in skill metadata)](https://github.com/Sendmux/skills)\n- [ClawHub skill release](https://clawhub.ai/sendmux.ai/skills/sendmux-token-efficient-usage)\n\n## Skill Output:\n\n**Output Type(s):** [Guidance, Shell commands, Code, Configuration instructions]\n\n**Output Format:** [Markdown guidance with command and API examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Recommends scoped credentials, narrow reads, batching, and safe retries.]\n\n## Skill Version(s):\n\n1.0.11 (source: ClawHub release metadata; artifact frontmatter says 1.7.1)\n\n## Ethical Considerations:\n\nUsers 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.\n\nArchive v1.0.10: 3 files, 7763 bytes\n\nFiles: skill-card.md (1788b), SKILL.md (17697b), _meta.json (149b)\n\nFile v1.0.10:SKILL.md\n\n---\nname: \"sendmux-token-efficient-usage\"\ndescription: \"Choose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\"\nversion: \"1.7.0\"\nmetadata:\n  openclaw:\n    skillKey: \"sendmux-token-efficient-usage\"\n    homepage: \"https://github.com/Sendmux/skills\"\n    primaryEnv: \"SENDMUX_API_KEY\"\n    envVars:\n      - name: \"SENDMUX_API_KEY\"\n        required: false\n        description: \"Optional Sendmux API key or scoped agent token used by CLI, SDK, HTTP, or MCP examples.\"\n---\n\n# Sendmux token-efficient usage\n\n## ClawHub account note\n\nThis ClawHub skill connects OpenClaw agents to Sendmux. Some workflows require a Sendmux account and an appropriate Sendmux API key or agent token. Sendmux account usage is external to ClawHub; do not ask users to paste secrets into chat.\n\nUse this skill to choose the lowest-cost Sendmux route that still answers the task correctly.\n\n## Boundaries\n\n- Do not ask the user to paste an API key.\n- For API-key authentication, use `smx_mbx_*` keys for normal Mailbox calls.\n- For a self-registered agent, reuse one durable CLI profile. Mailbox reads become available after provisioning, before owner approval; Sending stays blocked until owner approval.\n- For API-key authentication, use `smx_root_*` for Management calls.\n- Do not default to MCP for every task. MCP is best when the required tool is curated; CLI and SDK cover broader surfaces.\n- Keep real attachment bytes outside model context and route their mechanics to `sendmux-attachments`; use the attachment route reference below.\n- Do not read full mailbox bodies, every message, or every log row unless the user asks for full content and narrower calls cannot answer.\n\nChoose the authentication connection, then its already-approved product surface. For an existing OAuth profile, use the already-known approved surface from its granted permissions or setup context. If that surface is unknown, show the surface-specific alternatives below and ask which one the profile grants; there is no universal Mailbox default.\n\n| Authentication connection | Validate with | Ownership boundary |\n| --- | --- | --- |\n| Existing CLI or REST OAuth profile | The selected CLI operation: `mailbox:get-connection`, `management:get-connection`, or `sending:get-connection` | Explain that the check stays within the profile's approved surface, scopes, and mailboxes. `sendmux-cli` owns login and refresh. |\n| SDK application credentials | The selected SDK operation: `mailboxGetConnection`, `managementGetConnection`, or `sendingGetConnection` | The application supplies SDK credentials; this is not a CLI profile check. |\n| Already-connected MCP session | The selected MCP operation: `mailbox_get_connection`, `management_get_connection`, or `sending_get_connection` | This validates only that MCP session. `sendmux-mcp-setup` owns hosted MCP OAuth setup; it is not an alternate view of a REST profile. |\n\nThese checks need no mailbox selector and send no email. Public OpenAPI discovery does not validate credentials.\n\n## Surface choice\n\n| Situation                               | Use                                 | Why                                                           |\n| --------------------------------------- | ----------------------------------- | ------------------------------------------------------------- |\n| Connected agent and curated tool exists | MCP tool                            | Small schema and no SDK boilerplate.                          |\n| One-off terminal task                   | `sendmux` CLI with `--json`         | Direct, scriptable, exposes the full generated operation set. |\n| Application code or repeated workflow   | SDK for the project already in use  | Reuses client setup, pagination, headers, and retry helpers.  |\n| MCP lacks the needed operation          | CLI for terminal work, SDK for code | Do not invent uncurated MCP tools.                            |\n| No package/tooling available            | Direct HTTP                         | Keep request bodies and headers aligned to OpenAPI.           |\n\nCredential ownership follows the surface. For a durable CLI agent profile, the CLI automatically exchanges and caches the one-hour delegated token for `sending:*` commands. SDK callers supply a compatible `apiKey` or `accessToken` (or their own provider callback); SDK helpers do not read or update CLI profile state.\n\n## Cheapest-call map\n\n| Task                            | Cheapest correct default                                                                                                               |\n| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |\n| Send one outbound email         | `sending_send_email`, CLI `sending:send`, SDK `sendingSendEmail`; include `Idempotency-Key`.                                           |\n| Send multiple outbound emails   | `sending_send_email_batch`, CLI `sending:send:batch`, SDK `sendingSendEmailBatch`; do not loop single sends.                           |\n| Send or read attachments        | Use the attachment route reference below.                                                                                              |\n| Count matching mailbox messages | `mailbox_count_messages`, CLI `mailbox:count-messages`, SDK `mailboxCountMessages`.                                                    |\n| Search mailbox text             | `mailbox_search_message_snippets`, CLI `mailbox:search-message-snippets`, SDK `mailboxSearchMessageSnippets`; then fetch selected IDs. |\n| Read several known messages     | `mailbox_batch_get_messages`, CLI `mailbox:batch-get-messages`, SDK `mailboxBatchGetMessages`.                                         |\n| Update/delete several messages  | Batch update/delete after explicit confirmation.                                                                                       |\n| Resume broad mailbox sync       | `mailbox_get_changes`, CLI `mailbox:get-changes`, SDK `mailboxGetChanges`.                                                             |\n| Resume filtered mailbox sync    | CLI/SDK `mailbox:query-message-changes` / `mailboxQueryMessageChanges`; MCP does not curate it yet.                                    |\n| Watch live mailbox events       | CLI/SDK `mailbox:stream-events` / `mailboxStreamEvents`; MCP does not curate it yet.                                                   |\n| Scan threads                    | List threads, then fetch one thread or its messages.                                                                                   |\n| Manage domains/mailboxes/keys   | Management MCP for curated create/list/get/update/suspend/resume/key tools; CLI/SDK for uncovered lifecycle work.                      |\n| Manage sending accounts         | CLI/SDK; MCP does not curate provider tools yet.                                                                                       |\n| Manage webhooks                 | MCP for list/create/test; CLI/SDK for get/update/delete/rotate/delivery payloads.                                                      |\n| Inspect spend, logs, metrics    | Metrics first; use `management:list-email-logs` / `managementListEmailLogs` for filtered summaries, then `management:get-email-log` / `managementGetEmailLog` for one selected row. |\n\n### Attachment route reference\n\n`sendmux-attachments` owns the detailed upload/download procedures and current direct-upload limits.\n\nWhen comparing local-file routes, state how bytes move and which size authority applies for each alternative below, then recommend the one matching the user's environment:\n\n1. **Terminal:** recommend CLI `--attach` for a one-off task. It uploads directly outside model context; server-enforced direct-upload limits apply. There is no presign-limit response.\n2. **Application code:** name `sendEmailWithFiles` or `uploadAttachmentFromFile` from `@sendmux/sending/node`, or `uploadMailboxAttachmentFromFile` from `@sendmux/mailbox/node`. These helpers upload directly outside model context; server-enforced direct-upload limits apply, with no presign-limit response.\n3. **Connected MCP:** name `sending_create_attachment_upload` for Sending, or `mailbox_upload_attachment` with `presign_upload_url=true` for Mailbox. Both use presigned external transfer outside model context. For Sending, obey the upload intent's returned `max_size_bytes`; Mailbox accepts requested `size_bytes` up to 7,500,000.\n\nFor tiny agent-authored content, MCP inline `content_base64` is available only after measuring the decoded content at no more than 32,768 bytes; a filename or file type cannot establish eligibility.\n\nFor presigned Sending uploads, the intent returns a temporary `upload_id`; take the final `attachment_id` from the successful external `PUT` response. A successful external Mailbox upload returns the `blob_id` for Mailbox sends. Never use MCP `file_path` or real-file inline base64.\n\nFor an agent with no key, avoid manual protocol calls and token copying:\n\n```bash\nsendmux agent:register my-agent --default --json\nsendmux mailbox:me:get --profile my-agent --json\nsendmux agent:invite-owner owner@example.com --profile my-agent --json\n```\n\nRegister once, then reuse the durable profile across processes. For this self-registered agent, sending has two owner gates: the owner accepts the invitation, then explicitly approves sending. Once both are complete, use the same profile with `sending:*`; the CLI handles the one-hour delegated token exchange and cache.\n\nExplain the storage boundary alongside this setup: the inbox is capped at 500 MiB before approval. Owner-approved sending raises it to at least 5 GiB first. Revoking sending does not itself change the current inbox storage allocation.\n\n## Read less\n\nFor mailbox questions, reduce the result set before reading content:\n\n1. Count when the user asks \"how many\" or when the query may be broad.\n2. Search snippets with a small `limit` when the user needs examples; choose from the returned `message_id`, `subject`, and `preview` fields.\n3. Batch-get only selected message IDs.\n4. Request clean body/content only when message text affects the answer.\n\nCLI:\n\n```bash\nsendmux mailbox:count-messages \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --json\n\nsendmux mailbox:search-message-snippets \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=10 \\\n  --json\n\nsendmux mailbox:batch-get-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"body_mode\": \"clean_json\",\n    \"max_body_chars\": 4000,\n    \"strip_quotes\": true,\n    \"strip_signature\": true,\n    \"include_attachments\": \"metadata\"\n  }' \\\n  --json\n```\n\n## Write fewer requests\n\nBatch when there is more than one target.\n\nFor API-key or delegated-token authentication, name the Sending authority alongside the recommended call: a send-capable `smx_mbx_*` key or owner-approved Sending-resource `smx_agent_*` token. This applies to both single and batch sends.\n\n```bash\nsendmux sending:send:batch \\\n  --idempotency-key \"$IDEMPOTENCY_KEY\" \\\n  --body-file ./messages.json \\\n  --json\n\nsendmux mailbox:batch-update-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"seen\": true,\n    \"if_in_state\": \"state_from_prior_read\"\n  }' \\\n  --json\n```\n\nFor batch sends, inspect every per-message result before reporting success. Batch can contain mixed outcomes.\n\n## Sync by delta\n\nUse sync endpoints instead of re-listing stable data.\n\nChoose the sync route that matches the requested view: broad mailbox state uses `mailbox:get-changes` / `mailboxGetChanges`; a filtered message view uses `mailbox:query-message-changes` / `mailboxQueryMessageChanges`.\n\nBroad mailbox sync:\n\n```bash\nsendmux mailbox:get-changes \\\n  --query types=messages,folders,threads \\\n  --query messages_since_state=\"$MESSAGES_STATE\" \\\n  --query folders_since_state=\"$FOLDERS_STATE\" \\\n  --query threads_since_state=\"$THREADS_STATE\" \\\n  --query limit=100 \\\n  --json\n```\n\nThis multi-resource sync requires `types=messages,folders,threads`; omitting `types` deliberately selects the legacy message-only response. Before the next call, persist each returned resource's `new_state` and `has_more`. Map `data.types.messages.new_state`, `data.types.folders.new_state`, and `data.types.threads.new_state` to the matching `*_since_state` input. Continue each resource whose saved `has_more` is true independently with its saved state; a narrower response updates only the resource it requested.\n\nFor a message-only continuation, use the selected resource's fields exactly:\n\n```bash\nsendmux mailbox:get-changes \\\n  --query types=messages \\\n  --query messages_since_state=\"$NEXT_MESSAGES_STATE\" \\\n  --query limit=100 \\\n  --json\n```\n\nAfter every response, replace the current response, set `NEXT_MESSAGES_STATE` from its `data.types.messages.new_state`, and repeat only while that same latest response's `data.types.messages.has_more` is true.\n\nFiltered message sync:\n\n```bash\nsendmux mailbox:query-message-changes \\\n  --query since_query_state=\"$QUERY_STATE\" \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=100 \\\n  --json\n```\n\nAfter every response, set `QUERY_STATE` from its `data.new_query_state`, and continue with the same filters only while that same latest response's `data.has_more` is true and the next page is needed.\n\nA polling-loop answer must distinguish sync continuation from cursor-paginated list calls. For the latter, preserve the same filters and a small bounded limit, count matches cumulatively across pages, stop immediately when the local threshold is reached even mid-page, and follow the returned `pagination.next_cursor` only while another list page is needed. At the start of every polling tick, call each enabled sync route once with its saved state and perform each enabled conditional-log read once, even when the prior sync response had `has_more=false`; within that tick, add one call for every requested continuation page.\n\nUse the public delivery-log seams exactly:\n\n- For filtered summary pages, use CLI `management:list-email-logs` or SDK `managementListEmailLogs`. Preserve only supported filters (`status`, `from_date`, `to_date`, `provider_id`, `search`), and map the returned `pagination.next_cursor` to the next `cursor` input.\n- For repeated reads of one known log, CLI `management:get-email-log --if-none-match \"$ETAG\"` can send an ETag supplied from elsewhere, but CLI output is the API JSON body—not an HTTP status/header envelope. It cannot acquire or refresh the ETag or branch on `304`.\n- For the first metadata-bearing read and every later `304`-aware read, use the supported SDK packages directly; `priorEtag` is absent on the first call:\n\n```ts\nimport { responseEtag } from \"@sendmux/core\";\nimport { createManagementClient, managementGetEmailLog } from \"@sendmux/management\";\n\nconst client = createManagementClient({ apiKey: process.env.SENDMUX_API_KEY! });\n\nconst result = await managementGetEmailLog({\n  client,\n  path: { public_id: logId },\n  headers: priorEtag ? { \"If-None-Match\": priorEtag } : {},\n  throwOnError: false,\n});\n\nif (result.response?.status === 304) {\n  // Unchanged representation; there is no response body.\n} else if (result.error) {\n  // Handle the unsuccessful response.\n} else {\n  const log = result.data?.data;\n  const nextEtag = responseEtag(result.response);\n}\n```\n\nThe terminal delivery statuses are `sent`, `failed`, and `rejected`. A `304` means the representation is unchanged; it does not establish a terminal delivery status.\n\n## Transfer less\n\n- Use small `limit` values on list calls.\n- Follow `pagination.next_cursor` only until enough evidence has been gathered.\n- Prefer summary or metrics endpoints before log lists.\n- Use `If-None-Match` for repeated detail reads that previously returned an `ETag`.\n- Use `If-Match` for updates when the prior read returned an `ETag`.\n- For inbound attachments, fetch metadata and use the short-lived `download_url`; if it expires, re-fetch metadata instead of building URLs manually.\n- For outbound attachments, follow the attachment route reference above.\n\nCLI conditional examples:\n\n```bash\nsendmux management:get-email-log \\\n  --path public_id=dlog_abc \\\n  --if-none-match \"$ETAG\" \\\n  --json\n\nsendmux management:update-mailbox \\\n  --path public_id=mbx_abc \\\n  --if-match \"$ETAG\" \\\n  --body '{\"display_name\":\"Agent Inbox\"}' \\\n  --json\n```\n\nSDK helpers:\n\n```\nimport {\n  conditionalHeaders,\n  idempotencyHeaders,\n  paginate,\n  responseEtag,\n} from \"@sendmux/core\";\n\nconst headers = conditionalHeaders({ ifNoneMatch: priorEtag });\nconst writeHeaders = {\n  ...conditionalHeaders({ etag: priorEtag }),\n  ...idempotencyHeaders(operationKey),\n};\n```\n\n## Retry safely\n\nUse `Idempotency-Key` on supported mutations so retrying does not create duplicate work.\n\nGood candidates:\n\n- `sending:send` and `sending:send:batch`.\n- `mailbox:send-message`.\n- Management creates, mailbox key creation, suspend/resume, provider mutations, webhook create/rotate/test.\n\nWhen retrying application code, prefer SDK retry helpers only for safe reads or idempotent writes. Non-idempotent writes should fail rather than risk duplicate side effects.\n\n## Routing\n\n- Setup, key scopes, first call: `sendmux-getting-started`.\n- Email send bodies and SMTP-vs-HTTP choice: `sendmux-send-email`.\n- Attachment upload/download mechanics: `sendmux-attachments`.\n- Mailbox read/search/sync/triage/reply details: `sendmux-mailbox-agent`.\n- Management domains, mailboxes, webhooks, billing, logs: `sendmux-management`.\n- CLI syntax and profiles: `sendmux-cli`.\n- MCP installation and client config: `sendmux-mcp-setup`.\n\nFile v1.0.10:_meta.json\n\n{\n  \"ownerId\": \"kn77z51yqhw8mt9vjfkpt8w74989rfb3\",\n  \"slug\": \"sendmux-token-efficient-usage\",\n  \"version\": \"1.0.10\",\n  \"publishedAt\": 1790769789183\n}\n\nFile v1.0.10:skill-card.md\n\n## Description:\n\nChoose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[sendmux.ai](https://clawhub.ai/user/sendmux.ai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agent operators use this skill to choose efficient Sendmux mailbox, sending, and management calls while minimizing unnecessary reads, transfers, and repeat requests.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Broad credentials or exposed secrets could permit unintended mailbox or management access.\n\nMitigation: Use credentials scoped to the intended actions and do not paste secrets into chat.\n\nRisk: Sending email, deleting messages, and changing keys or webhooks can have significant effects.\n\nMitigation: Require user direction and review these actions before execution.\n\n## Reference(s):\n\n- [Sendmux skills homepage](https://github.com/Sendmux/skills)\n- [Sendmux token-efficient usage on ClawHub](https://clawhub.ai/sendmux.ai/skills/sendmux-token-efficient-usage)\n\n## Skill Output:\n\n**Output Type(s):** [Guidance, Shell commands, Code, Configuration instructions]\n\n**Output Format:** [Markdown with CLI and SDK examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Recommends bounded results, batching, incremental sync, and safe retries.]\n\n## Skill Version(s):\n\n1.0.10 (source: ClawHub release metadata)\n\n## Ethical Considerations:\n\nUsers 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.\n\nArchive v1.0.9: 3 files, 7942 bytes\n\nFiles: skill-card.md (2214b), SKILL.md (17697b), _meta.json (148b)\n\nFile v1.0.9:SKILL.md\n\n---\nname: \"sendmux-token-efficient-usage\"\ndescription: \"Choose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\"\nversion: \"1.6.0\"\nmetadata:\n  openclaw:\n    skillKey: \"sendmux-token-efficient-usage\"\n    homepage: \"https://github.com/Sendmux/skills\"\n    primaryEnv: \"SENDMUX_API_KEY\"\n    envVars:\n      - name: \"SENDMUX_API_KEY\"\n        required: false\n        description: \"Optional Sendmux API key or scoped agent token used by CLI, SDK, HTTP, or MCP examples.\"\n---\n\n# Sendmux token-efficient usage\n\n## ClawHub account note\n\nThis ClawHub skill connects OpenClaw agents to Sendmux. Some workflows require a Sendmux account and an appropriate Sendmux API key or agent token. Sendmux account usage is external to ClawHub; do not ask users to paste secrets into chat.\n\nUse this skill to choose the lowest-cost Sendmux route that still answers the task correctly.\n\n## Boundaries\n\n- Do not ask the user to paste an API key.\n- For API-key authentication, use `smx_mbx_*` keys for normal Mailbox calls.\n- For a self-registered agent, reuse one durable CLI profile. Mailbox reads become available after provisioning, before owner approval; Sending stays blocked until owner approval.\n- For API-key authentication, use `smx_root_*` for Management calls.\n- Do not default to MCP for every task. MCP is best when the required tool is curated; CLI and SDK cover broader surfaces.\n- Keep real attachment bytes outside model context and route their mechanics to `sendmux-attachments`; use the attachment route reference below.\n- Do not read full mailbox bodies, every message, or every log row unless the user asks for full content and narrower calls cannot answer.\n\nChoose the authentication connection, then its already-approved product surface. For an existing OAuth profile, use the already-known approved surface from its granted permissions or setup context. If that surface is unknown, show the surface-specific alternatives below and ask which one the profile grants; there is no universal Mailbox default.\n\n| Authentication connection | Validate with | Ownership boundary |\n| --- | --- | --- |\n| Existing CLI or REST OAuth profile | The selected CLI operation: `mailbox:get-connection`, `management:get-connection`, or `sending:get-connection` | Explain that the check stays within the profile's approved surface, scopes, and mailboxes. `sendmux-cli` owns login and refresh. |\n| SDK application credentials | The selected SDK operation: `mailboxGetConnection`, `managementGetConnection`, or `sendingGetConnection` | The application supplies SDK credentials; this is not a CLI profile check. |\n| Already-connected MCP session | The selected MCP operation: `mailbox_get_connection`, `management_get_connection`, or `sending_get_connection` | This validates only that MCP session. `sendmux-mcp-setup` owns hosted MCP OAuth setup; it is not an alternate view of a REST profile. |\n\nThese checks need no mailbox selector and send no email. Public OpenAPI discovery does not validate credentials.\n\n## Surface choice\n\n| Situation                               | Use                                 | Why                                                           |\n| --------------------------------------- | ----------------------------------- | ------------------------------------------------------------- |\n| Connected agent and curated tool exists | MCP tool                            | Small schema and no SDK boilerplate.                          |\n| One-off terminal task                   | `sendmux` CLI with `--json`         | Direct, scriptable, exposes the full generated operation set. |\n| Application code or repeated workflow   | SDK for the project already in use  | Reuses client setup, pagination, headers, and retry helpers.  |\n| MCP lacks the needed operation          | CLI for terminal work, SDK for code | Do not invent uncurated MCP tools.                            |\n| No package/tooling available            | Direct HTTP                         | Keep request bodies and headers aligned to OpenAPI.           |\n\nCredential ownership follows the surface. For a durable CLI agent profile, the CLI automatically exchanges and caches the one-hour delegated token for `sending:*` commands. SDK callers supply a compatible `apiKey` or `accessToken` (or their own provider callback); SDK helpers do not read or update CLI profile state.\n\n## Cheapest-call map\n\n| Task                            | Cheapest correct default                                                                                                               |\n| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |\n| Send one outbound email         | `sending_send_email`, CLI `sending:send`, SDK `sendingSendEmail`; include `Idempotency-Key`.                                           |\n| Send multiple outbound emails   | `sending_send_email_batch`, CLI `sending:send:batch`, SDK `sendingSendEmailBatch`; do not loop single sends.                           |\n| Send or read attachments        | Use the attachment route reference below.                                                                                              |\n| Count matching mailbox messages | `mailbox_count_messages`, CLI `mailbox:count-messages`, SDK `mailboxCountMessages`.                                                    |\n| Search mailbox text             | `mailbox_search_message_snippets`, CLI `mailbox:search-message-snippets`, SDK `mailboxSearchMessageSnippets`; then fetch selected IDs. |\n| Read several known messages     | `mailbox_batch_get_messages`, CLI `mailbox:batch-get-messages`, SDK `mailboxBatchGetMessages`.                                         |\n| Update/delete several messages  | Batch update/delete after explicit confirmation.                                                                                       |\n| Resume broad mailbox sync       | `mailbox_get_changes`, CLI `mailbox:get-changes`, SDK `mailboxGetChanges`.                                                             |\n| Resume filtered mailbox sync    | CLI/SDK `mailbox:query-message-changes` / `mailboxQueryMessageChanges`; MCP does not curate it yet.                                    |\n| Watch live mailbox events       | CLI/SDK `mailbox:stream-events` / `mailboxStreamEvents`; MCP does not curate it yet.                                                   |\n| Scan threads                    | List threads, then fetch one thread or its messages.                                                                                   |\n| Manage domains/mailboxes/keys   | Management MCP for curated create/list/get/update/suspend/resume/key tools; CLI/SDK for uncovered lifecycle work.                      |\n| Manage sending accounts         | CLI/SDK; MCP does not curate provider tools yet.                                                                                       |\n| Manage webhooks                 | MCP for list/create/test; CLI/SDK for get/update/delete/rotate/delivery payloads.                                                      |\n| Inspect spend, logs, metrics    | Metrics first; use `management:list-email-logs` / `managementListEmailLogs` for filtered summaries, then `management:get-email-log` / `managementGetEmailLog` for one selected row. |\n\n### Attachment route reference\n\n`sendmux-attachments` owns the detailed upload/download procedures and current direct-upload limits.\n\nWhen comparing local-file routes, state how bytes move and which size authority applies for each alternative below, then recommend the one matching the user's environment:\n\n1. **Terminal:** recommend CLI `--attach` for a one-off task. It uploads directly outside model context; server-enforced direct-upload limits apply. There is no presign-limit response.\n2. **Application code:** name `sendEmailWithFiles` or `uploadAttachmentFromFile` from `@sendmux/sending/node`, or `uploadMailboxAttachmentFromFile` from `@sendmux/mailbox/node`. These helpers upload directly outside model context; server-enforced direct-upload limits apply, with no presign-limit response.\n3. **Connected MCP:** name `sending_create_attachment_upload` for Sending, or `mailbox_upload_attachment` with `presign_upload_url=true` for Mailbox. Both use presigned external transfer outside model context. For Sending, obey the upload intent's returned `max_size_bytes`; Mailbox accepts requested `size_bytes` up to 7,500,000.\n\nFor tiny agent-authored content, MCP inline `content_base64` is available only after measuring the decoded content at no more than 32,768 bytes; a filename or file type cannot establish eligibility.\n\nFor presigned Sending uploads, the intent returns a temporary `upload_id`; take the final `attachment_id` from the successful external `PUT` response. A successful external Mailbox upload returns the `blob_id` for Mailbox sends. Never use MCP `file_path` or real-file inline base64.\n\nFor an agent with no key, avoid manual protocol calls and token copying:\n\n```bash\nsendmux agent:register my-agent --default --json\nsendmux mailbox:me:get --profile my-agent --json\nsendmux agent:invite-owner owner@example.com --profile my-agent --json\n```\n\nRegister once, then reuse the durable profile across processes. For this self-registered agent, sending has two owner gates: the owner accepts the invitation, then explicitly approves sending. Once both are complete, use the same profile with `sending:*`; the CLI handles the one-hour delegated token exchange and cache.\n\nExplain the storage boundary alongside this setup: the inbox is capped at 500 MiB before approval. Owner-approved sending raises it to at least 5 GiB first. Revoking sending does not itself change the current inbox storage allocation.\n\n## Read less\n\nFor mailbox questions, reduce the result set before reading content:\n\n1. Count when the user asks \"how many\" or when the query may be broad.\n2. Search snippets with a small `limit` when the user needs examples; choose from the returned `message_id`, `subject`, and `preview` fields.\n3. Batch-get only selected message IDs.\n4. Request clean body/content only when message text affects the answer.\n\nCLI:\n\n```bash\nsendmux mailbox:count-messages \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --json\n\nsendmux mailbox:search-message-snippets \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=10 \\\n  --json\n\nsendmux mailbox:batch-get-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"body_mode\": \"clean_json\",\n    \"max_body_chars\": 4000,\n    \"strip_quotes\": true,\n    \"strip_signature\": true,\n    \"include_attachments\": \"metadata\"\n  }' \\\n  --json\n```\n\n## Write fewer requests\n\nBatch when there is more than one target.\n\nFor API-key or delegated-token authentication, name the Sending authority alongside the recommended call: a send-capable `smx_mbx_*` key or owner-approved Sending-resource `smx_agent_*` token. This applies to both single and batch sends.\n\n```bash\nsendmux sending:send:batch \\\n  --idempotency-key \"$IDEMPOTENCY_KEY\" \\\n  --body-file ./messages.json \\\n  --json\n\nsendmux mailbox:batch-update-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"seen\": true,\n    \"if_in_state\": \"state_from_prior_read\"\n  }' \\\n  --json\n```\n\nFor batch sends, inspect every per-message result before reporting success. Batch can contain mixed outcomes.\n\n## Sync by delta\n\nUse sync endpoints instead of re-listing stable data.\n\nChoose the sync route that matches the requested view: broad mailbox state uses `mailbox:get-changes` / `mailboxGetChanges`; a filtered message view uses `mailbox:query-message-changes` / `mailboxQueryMessageChanges`.\n\nBroad mailbox sync:\n\n```bash\nsendmux mailbox:get-changes \\\n  --query types=messages,folders,threads \\\n  --query messages_since_state=\"$MESSAGES_STATE\" \\\n  --query folders_since_state=\"$FOLDERS_STATE\" \\\n  --query threads_since_state=\"$THREADS_STATE\" \\\n  --query limit=100 \\\n  --json\n```\n\nThis multi-resource sync requires `types=messages,folders,threads`; omitting `types` deliberately selects the legacy message-only response. Before the next call, persist each returned resource's `new_state` and `has_more`. Map `data.types.messages.new_state`, `data.types.folders.new_state`, and `data.types.threads.new_state` to the matching `*_since_state` input. Continue each resource whose saved `has_more` is true independently with its saved state; a narrower response updates only the resource it requested.\n\nFor a message-only continuation, use the selected resource's fields exactly:\n\n```bash\nsendmux mailbox:get-changes \\\n  --query types=messages \\\n  --query messages_since_state=\"$NEXT_MESSAGES_STATE\" \\\n  --query limit=100 \\\n  --json\n```\n\nAfter every response, replace the current response, set `NEXT_MESSAGES_STATE` from its `data.types.messages.new_state`, and repeat only while that same latest response's `data.types.messages.has_more` is true.\n\nFiltered message sync:\n\n```bash\nsendmux mailbox:query-message-changes \\\n  --query since_query_state=\"$QUERY_STATE\" \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=100 \\\n  --json\n```\n\nAfter every response, set `QUERY_STATE` from its `data.new_query_state`, and continue with the same filters only while that same latest response's `data.has_more` is true and the next page is needed.\n\nA polling-loop answer must distinguish sync continuation from cursor-paginated list calls. For the latter, preserve the same filters and a small bounded limit, count matches cumulatively across pages, stop immediately when the local threshold is reached even mid-page, and follow the returned `pagination.next_cursor` only while another list page is needed. At the start of every polling tick, call each enabled sync route once with its saved state and perform each enabled conditional-log read once, even when the prior sync response had `has_more=false`; within that tick, add one call for every requested continuation page.\n\nUse the public delivery-log seams exactly:\n\n- For filtered summary pages, use CLI `management:list-email-logs` or SDK `managementListEmailLogs`. Preserve only supported filters (`status`, `from_date`, `to_date`, `provider_id`, `search`), and map the returned `pagination.next_cursor` to the next `cursor` input.\n- For repeated reads of one known log, CLI `management:get-email-log --if-none-match \"$ETAG\"` can send an ETag supplied from elsewhere, but CLI output is the API JSON body—not an HTTP status/header envelope. It cannot acquire or refresh the ETag or branch on `304`.\n- For the first metadata-bearing read and every later `304`-aware read, use the supported SDK packages directly; `priorEtag` is absent on the first call:\n\n```ts\nimport { responseEtag } from \"@sendmux/core\";\nimport { createManagementClient, managementGetEmailLog } from \"@sendmux/management\";\n\nconst client = createManagementClient({ apiKey: process.env.SENDMUX_API_KEY! });\n\nconst result = await managementGetEmailLog({\n  client,\n  path: { public_id: logId },\n  headers: priorEtag ? { \"If-None-Match\": priorEtag } : {},\n  throwOnError: false,\n});\n\nif (result.response?.status === 304) {\n  // Unchanged representation; there is no response body.\n} else if (result.error) {\n  // Handle the unsuccessful response.\n} else {\n  const log = result.data?.data;\n  const nextEtag = responseEtag(result.response);\n}\n```\n\nThe terminal delivery statuses are `sent`, `failed`, and `rejected`. A `304` means the representation is unchanged; it does not establish a terminal delivery status.\n\n## Transfer less\n\n- Use small `limit` values on list calls.\n- Follow `pagination.next_cursor` only until enough evidence has been gathered.\n- Prefer summary or metrics endpoints before log lists.\n- Use `If-None-Match` for repeated detail reads that previously returned an `ETag`.\n- Use `If-Match` for updates when the prior read returned an `ETag`.\n- For inbound attachments, fetch metadata and use the short-lived `download_url`; if it expires, re-fetch metadata instead of building URLs manually.\n- For outbound attachments, follow the attachment route reference above.\n\nCLI conditional examples:\n\n```bash\nsendmux management:get-email-log \\\n  --path public_id=dlog_abc \\\n  --if-none-match \"$ETAG\" \\\n  --json\n\nsendmux management:update-mailbox \\\n  --path public_id=mbx_abc \\\n  --if-match \"$ETAG\" \\\n  --body '{\"display_name\":\"Agent Inbox\"}' \\\n  --json\n```\n\nSDK helpers:\n\n```\nimport {\n  conditionalHeaders,\n  idempotencyHeaders,\n  paginate,\n  responseEtag,\n} from \"@sendmux/core\";\n\nconst headers = conditionalHeaders({ ifNoneMatch: priorEtag });\nconst writeHeaders = {\n  ...conditionalHeaders({ etag: priorEtag }),\n  ...idempotencyHeaders(operationKey),\n};\n```\n\n## Retry safely\n\nUse `Idempotency-Key` on supported mutations so retrying does not create duplicate work.\n\nGood candidates:\n\n- `sending:send` and `sending:send:batch`.\n- `mailbox:send-message`.\n- Management creates, mailbox key creation, suspend/resume, provider mutations, webhook create/rotate/test.\n\nWhen retrying application code, prefer SDK retry helpers only for safe reads or idempotent writes. Non-idempotent writes should fail rather than risk duplicate side effects.\n\n## Routing\n\n- Setup, key scopes, first call: `sendmux-getting-started`.\n- Email send bodies and SMTP-vs-HTTP choice: `sendmux-send-email`.\n- Attachment upload/download mechanics: `sendmux-attachments`.\n- Mailbox read/search/sync/triage/reply details: `sendmux-mailbox-agent`.\n- Management domains, mailboxes, webhooks, billing, logs: `sendmux-management`.\n- CLI syntax and profiles: `sendmux-cli`.\n- MCP installation and client config: `sendmux-mcp-setup`.\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn77z51yqhw8mt9vjfkpt8w74989rfb3\",\n  \"slug\": \"sendmux-token-efficient-usage\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1789710755470\n}\n\nFile v1.0.9:skill-card.md\n\n## Description:\n\nChoose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[sendmux.ai](https://clawhub.ai/user/sendmux.ai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agents use this skill to choose efficient Sendmux MCP, CLI, SDK, or HTTP routes for mailbox, sending, management, attachment, sync, and log tasks while minimizing tokens and calls.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sendmux credentials or scoped tokens could be exposed if a user is asked to paste secrets into chat.\n\nMitigation: Use available environment variables, CLI profiles, OAuth sessions, or scoped tokens outside chat, and keep SENDMUX_API_KEY values out of model-visible content.\n\nRisk: Email sending, message updates or deletes, and management changes can create external side effects.\n\nMitigation: Require clear user confirmation before side-effecting operations and use idempotency keys or conditional headers where the skill recommends them.\n\nRisk: Broad mailbox, attachment, or log reads can expose unnecessary content and increase token usage.\n\nMitigation: Prefer counts, snippets, small limits, selected batch reads, metadata-only attachment handling, cursors, deltas, and ETag checks before fetching full content.\n\n## Reference(s):\n\n- [Sendmux skills homepage](https://github.com/Sendmux/skills)\n\n## Skill Output:\n\n**Output Type(s):** [Guidance, Markdown, Code, Shell commands, Configuration]\n\n**Output Format:** [Markdown guidance with CLI, SDK, MCP, and HTTP examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Focuses on low-token Sendmux route selection, credential boundaries, batching, cursors, ETags, idempotency, and attachment handling.]\n\n## Skill Version(s):\n\n1.0.9 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers 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.\n\nArchive v1.0.8: 3 files, 5736 bytes\n\nFiles: skill-card.md (2452b), SKILL.md (11075b), _meta.json (148b)\n\nFile v1.0.8:SKILL.md\n\n---\nname: \"sendmux-token-efficient-usage\"\ndescription: \"Choose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\"\nversion: \"1.5.0\"\nmetadata:\n  openclaw:\n    skillKey: \"sendmux-token-efficient-usage\"\n    homepage: \"https://github.com/Sendmux/skills\"\n---\n\n# Sendmux token-efficient usage\n\n## ClawHub account note\n\nThis ClawHub skill connects OpenClaw agents to Sendmux. Some workflows require a Sendmux account and an appropriate Sendmux API key or agent token. Sendmux account usage is external to ClawHub; do not ask users to paste secrets into chat.\n\nUse this skill to choose the lowest-cost Sendmux route that still answers the task correctly.\n\n## Boundaries\n\n- Do not ask the user to paste an API key.\n- For API-key authentication, use send-capable `smx_mbx_*` keys or owner-approved Sending-resource `smx_agent_*` tokens for Sending calls, and `smx_mbx_*` keys for normal Mailbox calls.\n- For a self-registered agent, reuse one durable CLI profile for reads. Sending stays blocked until owner approval, then `sending:*` commands exchange and cache a one-hour delegated token automatically.\n- Its inbox is capped at 500 MiB before approval. Owner-approved sending raises it to at least 5 GiB first. Revoking sending does not itself change the current inbox storage allocation.\n- For API-key authentication, use `smx_root_*` for Management calls. REST OAuth profiles can use their approved surfaces, scopes and mailboxes; route login and refresh to `sendmux-cli`.\n- Do not default to MCP for every task. MCP is best when the required tool is curated; CLI and SDK cover broader surfaces.\n- Do not pipe real attachments through model context as base64. Route attachment transfer to `sendmux-attachments`; prefer `file_path`, presigned URLs, CLI `--attach`, or SDK file helpers. Mailbox uploads cap each attachment at 7,500,000 bytes; Sending uploads cap each file at 18 MiB; MCP inline base64 caps at 32 KiB decoded.\n- Do not read full mailbox bodies, every message, or every log row unless the user asks for full content and narrower calls cannot answer.\n\nValidate credentials with the selected surface's `get-connection` CLI operation or MCP `mailbox_get_connection`, `management_get_connection`, or `sending_get_connection`. These checks need no mailbox selector and send no email; public OpenAPI discovery does not validate credentials.\n\n## Surface choice\n\n| Situation                               | Use                                 | Why                                                           |\n| --------------------------------------- | ----------------------------------- | ------------------------------------------------------------- |\n| Connected agent and curated tool exists | MCP tool                            | Small schema and no SDK boilerplate.                          |\n| One-off terminal task                   | `sendmux` CLI with `--json`         | Direct, scriptable, exposes the full generated operation set. |\n| Application code or repeated workflow   | SDK for the project already in use  | Reuses client setup, pagination, headers, and retry helpers.  |\n| MCP lacks the needed operation          | CLI for terminal work, SDK for code | Do not invent uncurated MCP tools.                            |\n| No package/tooling available            | Direct HTTP                         | Keep request bodies and headers aligned to OpenAPI.           |\n\n## Cheapest-call map\n\n| Task                            | Cheapest correct default                                                                                                               |\n| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |\n| Send one outbound email         | `sending_send_email`, CLI `sending:send`, SDK `sendingSendEmail`; include `Idempotency-Key`.                                           |\n| Send multiple outbound emails   | `sending_send_email_batch`, CLI `sending:send:batch`, SDK `sendingSendEmailBatch`; do not loop single sends.                           |\n| Send or read attachments        | `sendmux-attachments`; use `file_path`, presigned upload/download URLs, CLI `--attach`, SDK file helpers, `blob_id` for mailbox sends, and `attachment_id` for Sending sends instead of inline base64. |\n| Count matching mailbox messages | `mailbox_count_messages`, CLI `mailbox:count-messages`, SDK `mailboxCountMessages`.                                                    |\n| Search mailbox text             | `mailbox_search_message_snippets`, CLI `mailbox:search-message-snippets`, SDK `mailboxSearchMessageSnippets`; then fetch selected IDs. |\n| Read several known messages     | `mailbox_batch_get_messages`, CLI `mailbox:batch-get-messages`, SDK `mailboxBatchGetMessages`.                                         |\n| Update/delete several messages  | Batch update/delete after explicit confirmation.                                                                                       |\n| Resume broad mailbox sync       | `mailbox_get_changes`, CLI `mailbox:get-changes`, SDK `mailboxGetChanges`.                                                             |\n| Resume filtered mailbox sync    | CLI/SDK `mailbox:query-message-changes` / `mailboxQueryMessageChanges`; MCP does not curate it yet.                                    |\n| Watch live mailbox events       | CLI/SDK `mailbox:stream-events` / `mailboxStreamEvents`; MCP does not curate it yet.                                                   |\n| Scan threads                    | List threads, then fetch one thread or its messages.                                                                                   |\n| Manage domains/mailboxes/keys   | Management MCP for curated create/list/get/update/suspend/resume/key tools; CLI/SDK for uncovered lifecycle work.                      |\n| Manage sending accounts         | CLI/SDK; MCP does not curate provider tools yet.                                                                                       |\n| Manage webhooks                 | MCP for list/create/test; CLI/SDK for get/update/delete/rotate/delivery payloads.                                                      |\n| Inspect spend, logs, metrics    | Summary/metrics first; filter log lists with small `limit`, then fetch one selected row.                                               |\n\nFor an agent with no key, avoid manual protocol calls and token copying:\n\n```bash\nsendmux agent:register my-agent --default --json\nsendmux mailbox:me:get --profile my-agent --json\nsendmux agent:invite-owner owner@example.com --profile my-agent --json\n```\n\nRegister once, then reuse the durable profile across processes. After owner acceptance and sending approval, use the same profile with `sending:*`; the CLI handles the one-hour delegated token exchange and cache.\n\n## Read less\n\nFor mailbox questions, reduce the result set before reading content:\n\n1. Count when the user asks \"how many\" or when the query may be broad.\n2. Search snippets with a small `limit` when the user needs examples.\n3. Batch-get only selected message IDs.\n4. Request clean body/content only when message text affects the answer.\n\nCLI:\n\n```bash\nsendmux mailbox:count-messages \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --json\n\nsendmux mailbox:search-message-snippets \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=10 \\\n  --json\n\nsendmux mailbox:batch-get-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"body_mode\": \"clean_json\",\n    \"max_body_chars\": 4000,\n    \"strip_quotes\": true,\n    \"strip_signature\": true,\n    \"include_attachments\": \"metadata\"\n  }' \\\n  --json\n```\n\n## Write fewer requests\n\nBatch when there is more than one target.\n\n```bash\nsendmux sending:send:batch \\\n  --idempotency-key \"$IDEMPOTENCY_KEY\" \\\n  --body-file ./messages.json \\\n  --json\n\nsendmux mailbox:batch-update-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"seen\": true,\n    \"if_in_state\": \"state_from_prior_read\"\n  }' \\\n  --json\n```\n\nFor batch sends, inspect every per-message result before reporting success. Batch can contain mixed outcomes.\n\n## Sync by delta\n\nUse sync endpoints instead of re-listing stable data.\n\nBroad mailbox sync:\n\n```bash\nsendmux mailbox:get-changes \\\n  --query messages_since_state=\"$MESSAGES_STATE\" \\\n  --query folders_since_state=\"$FOLDERS_STATE\" \\\n  --query threads_since_state=\"$THREADS_STATE\" \\\n  --query limit=100 \\\n  --json\n```\n\nFiltered message sync:\n\n```bash\nsendmux mailbox:query-message-changes \\\n  --query since_query_state=\"$QUERY_STATE\" \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=100 \\\n  --json\n```\n\nStore the returned state token. Continue with the same filters only while `has_more` is true and the next page is needed.\n\n## Transfer less\n\n- Use small `limit` values on list calls.\n- Follow `pagination.next_cursor` only until enough evidence has been gathered.\n- Prefer summary or metrics endpoints before log lists.\n- Use `If-None-Match` for repeated detail reads that previously returned an `ETag`.\n- Use `If-Match` for updates when the prior read returned an `ETag`.\n- For inbound attachments, fetch metadata and use the short-lived `download_url`; if it expires, re-fetch metadata instead of building URLs manually.\n- For outbound attachments, a file path or presigned URL is usually under 100 tokens, while base64 can burn thousands of tokens and corrupt large files.\n\nCLI conditional examples:\n\n```bash\nsendmux management:get-email-log \\\n  --path public_id=dlog_abc \\\n  --if-none-match \"$ETAG\" \\\n  --json\n\nsendmux management:update-mailbox \\\n  --path public_id=mbx_abc \\\n  --if-match \"$ETAG\" \\\n  --body '{\"display_name\":\"Agent Inbox\"}' \\\n  --json\n```\n\nSDK helpers:\n\n```\nimport {\n  conditionalHeaders,\n  idempotencyHeaders,\n  paginate,\n  responseEtag,\n} from \"@sendmux/core\";\n\nconst headers = conditionalHeaders({ ifNoneMatch: priorEtag });\nconst writeHeaders = {\n  ...conditionalHeaders({ etag: priorEtag }),\n  ...idempotencyHeaders(operationKey),\n};\n```\n\n## Retry safely\n\nUse `Idempotency-Key` on supported mutations so retrying does not create duplicate work.\n\nGood candidates:\n\n- `sending:send` and `sending:send:batch`.\n- `mailbox:send-message`.\n- Management creates, mailbox key creation, suspend/resume, provider mutations, webhook create/rotate/test.\n\nWhen retrying application code, prefer SDK retry helpers only for safe reads or idempotent writes. Non-idempotent writes should fail rather than risk duplicate side effects.\n\n## Routing\n\n- Setup, key scopes, first call: `sendmux-getting-started`.\n- Email send bodies and SMTP-vs-HTTP choice: `sendmux-send-email`.\n- Attachment upload/download mechanics: `sendmux-attachments`.\n- Mailbox read/search/sync/triage/reply details: `sendmux-mailbox-agent`.\n- Management domains, mailboxes, webhooks, billing, logs: `sendmux-management`.\n- CLI syntax and profiles: `sendmux-cli`.\n- MCP installation and client config: `sendmux-mcp-setup`.\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn77z51yqhw8mt9vjfkpt8w74989rfb3\",\n  \"slug\": \"sendmux-token-efficient-usage\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1789099234414\n}\n\nFile v1.0.8:skill-card.md\n\n## Description:\n\nChoose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[sendmux.ai](https://clawhub.ai/user/sendmux.ai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agent operators use this skill to choose token-efficient Sendmux operations for email sending, mailbox search and sync, attachment transfer, account management, webhooks, logs, and related workflows across MCP, CLI, SDKs, and HTTP.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Available Sendmux credentials or CLI profiles may allow an agent to send email, read or change mailbox content, manage webhooks, inspect logs, or perform account-management operations.\n\nMitigation: Install only for agents that should work with the Sendmux account, and review available credentials, CLI profiles, mailbox scopes, and management scopes before use.\n\nRisk: Mailbox bodies, attachments, logs, or broad search results can expose more account data than the task requires.\n\nMitigation: Prefer counts, snippets, small limits, selected message IDs, metadata-only attachment handling, and narrow filters before reading full content.\n\nRisk: Retried sends or mutation requests can create duplicate or unintended side effects.\n\nMitigation: Use idempotency keys for supported mutations, inspect per-message batch results, and require explicit confirmation before batch updates or deletes.\n\n## Reference(s):\n\n- [Sendmux Skills Repository](https://github.com/Sendmux/skills)\n- [ClawHub Skill Page](https://clawhub.ai/sendmux.ai/skills/sendmux-token-efficient-usage)\n\n## Skill Output:\n\n**Output Type(s):** [Guidance, Shell commands, Code, Configuration]\n\n**Output Format:** [Markdown with tables, inline command examples, and code snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Provides operation-selection guidance and credential-scope cautions; it does not execute Sendmux requests by itself.]\n\n## Skill Version(s):\n\n1.0.8 (source: ClawHub release metadata; artifact frontmatter states 1.5.0)\n\n## Ethical Considerations:\n\nUsers 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.\n\nArchive v1.0.7: 3 files, 5494 bytes\n\nFiles: skill-card.md (2201b), SKILL.md (10617b), _meta.json (148b)\n\nFile v1.0.7:SKILL.md\n\n---\nname: \"sendmux-token-efficient-usage\"\ndescription: \"Choose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\"\nversion: \"1.4.2\"\nmetadata:\n  openclaw:\n    skillKey: \"sendmux-token-efficient-usage\"\n    homepage: \"https://github.com/Sendmux/skills\"\n---\n\n# Sendmux token-efficient usage\n\n## ClawHub account note\n\nThis ClawHub skill connects OpenClaw agents to Sendmux. Some workflows require a Sendmux account and an appropriate Sendmux API key or agent token. Sendmux account usage is external to ClawHub; do not ask users to paste secrets into chat.\n\nUse this skill to choose the lowest-cost Sendmux route that still answers the task correctly.\n\n## Boundaries\n\n- Do not ask the user to paste an API key.\n- Use send-capable `smx_mbx_*` keys or owner-approved Sending-resource `smx_agent_*` tokens for Sending calls, and `smx_mbx_*` keys for normal Mailbox calls.\n- For a self-registered agent, reuse one durable CLI profile for reads. Sending stays blocked until owner approval, then `sending:*` commands exchange and cache a one-hour delegated token automatically.\n- Its inbox is capped at 500 MiB before approval. Owner-approved sending raises it to at least 5 GiB first. Revoking sending does not itself change the current inbox storage allocation.\n- Use `smx_root_*` for Management calls.\n- Do not default to MCP for every task. MCP is best when the required tool is curated; CLI and SDK cover broader surfaces.\n- Do not pipe real attachments through model context as base64. Route attachment transfer to `sendmux-attachments`; prefer `file_path`, presigned URLs, CLI `--attach`, or SDK file helpers. Mailbox uploads cap each attachment at 7,500,000 bytes; Sending uploads cap each file at 18 MiB; MCP inline base64 caps at 32 KiB decoded.\n- Do not read full mailbox bodies, every message, or every log row unless the user asks for full content and narrower calls cannot answer.\n\n## Surface choice\n\n| Situation                               | Use                                 | Why                                                           |\n| --------------------------------------- | ----------------------------------- | ------------------------------------------------------------- |\n| Connected agent and curated tool exists | MCP tool                            | Small schema and no SDK boilerplate.                          |\n| One-off terminal task                   | `sendmux` CLI with `--json`         | Direct, scriptable, exposes the full generated operation set. |\n| Application code or repeated workflow   | SDK for the project already in use  | Reuses client setup, pagination, headers, and retry helpers.  |\n| MCP lacks the needed operation          | CLI for terminal work, SDK for code | Do not invent uncurated MCP tools.                            |\n| No package/tooling available            | Direct HTTP                         | Keep request bodies and headers aligned to OpenAPI.           |\n\n## Cheapest-call map\n\n| Task                            | Cheapest correct default                                                                                                               |\n| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |\n| Send one outbound email         | `sending_send_email`, CLI `sending:send`, SDK `sendingSendEmail`; include `Idempotency-Key`.                                           |\n| Send multiple outbound emails   | `sending_send_email_batch`, CLI `sending:send:batch`, SDK `sendingSendEmailBatch`; do not loop single sends.                           |\n| Send or read attachments        | `sendmux-attachments`; use `file_path`, presigned upload/download URLs, CLI `--attach`, SDK file helpers, `blob_id` for mailbox sends, and `attachment_id` for Sending sends instead of inline base64. |\n| Count matching mailbox messages | `mailbox_count_messages`, CLI `mailbox:count-messages`, SDK `mailboxCountMessages`.                                                    |\n| Search mailbox text             | `mailbox_search_message_snippets`, CLI `mailbox:search-message-snippets`, SDK `mailboxSearchMessageSnippets`; then fetch selected IDs. |\n| Read several known messages     | `mailbox_batch_get_messages`, CLI `mailbox:batch-get-messages`, SDK `mailboxBatchGetMessages`.                                         |\n| Update/delete several messages  | Batch update/delete after explicit confirmation.                                                                                       |\n| Resume broad mailbox sync       | `mailbox_get_changes`, CLI `mailbox:get-changes`, SDK `mailboxGetChanges`.                                                             |\n| Resume filtered mailbox sync    | CLI/SDK `mailbox:query-message-changes` / `mailboxQueryMessageChanges`; MCP does not curate it yet.                                    |\n| Watch live mailbox events       | CLI/SDK `mailbox:stream-events` / `mailboxStreamEvents`; MCP does not curate it yet.                                                   |\n| Scan threads                    | List threads, then fetch one thread or its messages.                                                                                   |\n| Manage domains/mailboxes/keys   | Management MCP for curated create/list/get/update/suspend/resume/key tools; CLI/SDK for uncovered lifecycle work.                      |\n| Manage sending accounts         | CLI/SDK; MCP does not curate provider tools yet.                                                                                       |\n| Manage webhooks                 | MCP for list/create/test; CLI/SDK for get/update/delete/rotate/delivery payloads.                                                      |\n| Inspect spend, logs, metrics    | Summary/metrics first; filter log lists with small `limit`, then fetch one selected row.                                               |\n\nFor an agent with no key, avoid manual protocol calls and token copying:\n\n```bash\nsendmux agent:register my-agent --default --json\nsendmux mailbox:me:get --profile my-agent --json\nsendmux agent:invite-owner owner@example.com --profile my-agent --json\n```\n\nRegister once, then reuse the durable profile across processes. After owner acceptance and sending approval, use the same profile with `sending:*`; the CLI handles the one-hour delegated token exchange and cache.\n\n## Read less\n\nFor mailbox questions, reduce the result set before reading content:\n\n1. Count when the user asks \"how many\" or when the query may be broad.\n2. Search snippets with a small `limit` when the user needs examples.\n3. Batch-get only selected message IDs.\n4. Request clean body/content only when message text affects the answer.\n\nCLI:\n\n```bash\nsendmux mailbox:count-messages \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --json\n\nsendmux mailbox:search-message-snippets \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=10 \\\n  --json\n\nsendmux mailbox:batch-get-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"body_mode\": \"clean_json\",\n    \"max_body_chars\": 4000,\n    \"strip_quotes\": true,\n    \"strip_signature\": true,\n    \"include_attachments\": \"metadata\"\n  }' \\\n  --json\n```\n\n## Write fewer requests\n\nBatch when there is more than one target.\n\n```bash\nsendmux sending:send:batch \\\n  --idempotency-key \"$IDEMPOTENCY_KEY\" \\\n  --body-file ./messages.json \\\n  --json\n\nsendmux mailbox:batch-update-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"seen\": true,\n    \"if_in_state\": \"state_from_prior_read\"\n  }' \\\n  --json\n```\n\nFor batch sends, inspect every per-message result before reporting success. Batch can contain mixed outcomes.\n\n## Sync by delta\n\nUse sync endpoints instead of re-listing stable data.\n\nBroad mailbox sync:\n\n```bash\nsendmux mailbox:get-changes \\\n  --query messages_since_state=\"$MESSAGES_STATE\" \\\n  --query folders_since_state=\"$FOLDERS_STATE\" \\\n  --query threads_since_state=\"$THREADS_STATE\" \\\n  --query limit=100 \\\n  --json\n```\n\nFiltered message sync:\n\n```bash\nsendmux mailbox:query-message-changes \\\n  --query since_query_state=\"$QUERY_STATE\" \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=100 \\\n  --json\n```\n\nStore the returned state token. Continue with the same filters only while `has_more` is true and the next page is needed.\n\n## Transfer less\n\n- Use small `limit` values on list calls.\n- Follow `pagination.next_cursor` only until enough evidence has been gathered.\n- Prefer summary or metrics endpoints before log lists.\n- Use `If-None-Match` for repeated detail reads that previously returned an `ETag`.\n- Use `If-Match` for updates when the prior read returned an `ETag`.\n- For inbound attachments, fetch metadata and use the short-lived `download_url`; if it expires, re-fetch metadata instead of building URLs manually.\n- For outbound attachments, a file path or presigned URL is usually under 100 tokens, while base64 can burn thousands of tokens and corrupt large files.\n\nCLI conditional examples:\n\n```bash\nsendmux management:get-email-log \\\n  --path public_id=dlog_abc \\\n  --if-none-match \"$ETAG\" \\\n  --json\n\nsendmux management:update-mailbox \\\n  --path public_id=mbx_abc \\\n  --if-match \"$ETAG\" \\\n  --body '{\"display_name\":\"Agent Inbox\"}' \\\n  --json\n```\n\nSDK helpers:\n\n```\nimport {\n  conditionalHeaders,\n  idempotencyHeaders,\n  paginate,\n  responseEtag,\n} from \"@sendmux/core\";\n\nconst headers = conditionalHeaders({ ifNoneMatch: priorEtag });\nconst writeHeaders = {\n  ...conditionalHeaders({ etag: priorEtag }),\n  ...idempotencyHeaders(operationKey),\n};\n```\n\n## Retry safely\n\nUse `Idempotency-Key` on supported mutations so retrying does not create duplicate work.\n\nGood candidates:\n\n- `sending:send` and `sending:send:batch`.\n- `mailbox:send-message`.\n- Management creates, mailbox key creation, suspend/resume, provider mutations, webhook create/rotate/test.\n\nWhen retrying application code, prefer SDK retry helpers only for safe reads or idempotent writes. Non-idempotent writes should fail rather than risk duplicate side effects.\n\n## Routing\n\n- Setup, key scopes, first call: `sendmux-getting-started`.\n- Email send bodies and SMTP-vs-HTTP choice: `sendmux-send-email`.\n- Attachment upload/download mechanics: `sendmux-attachments`.\n- Mailbox read/search/sync/triage/reply details: `sendmux-mailbox-agent`.\n- Management domains, mailboxes, webhooks, billing, logs: `sendmux-management`.\n- CLI syntax and profiles: `sendmux-cli`.\n- MCP installation and client config: `sendmux-mcp-setup`.\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn77z51yqhw8mt9vjfkpt8w74989rfb3\",\n  \"slug\": \"sendmux-token-efficient-usage\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1788259073475\n}\n\nFile v1.0.7:skill-card.md\n\n## Description:\n\nChoose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[sendmux.ai](https://clawhub.ai/user/sendmux.ai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agents use this skill to choose efficient Sendmux MCP, CLI, SDK, or HTTP routes for mailbox, sending, attachment, log, and management tasks while minimizing token-heavy reads and repeated requests.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The agent may use Sendmux credentials or permissions beyond what the user intends.\n\nMitigation: Use only Sendmux credentials and permissions intended for the agent, and do not ask users to paste secrets into chat.\n\nRisk: Email sending, deletion, key, webhook, or management actions can have external side effects.\n\nMitigation: Review these actions before approval and use the skill's batching, idempotency, and explicit-confirmation guidance for mutations.\n\nRisk: Large mailbox bodies, logs, or attachments can expose unnecessary content and consume excessive context.\n\nMitigation: Prefer counts, snippets, selected IDs, metadata, presigned URLs, small limits, and attachment transfer paths outside model context.\n\n## Reference(s):\n\n- [Sendmux Skills Repository](https://github.com/Sendmux/skills)\n- [ClawHub Skill Page](https://clawhub.ai/sendmux.ai/skills/sendmux-token-efficient-usage)\n\n## Skill Output:\n\n**Output Type(s):** [Guidance, Markdown, Shell commands, Configuration]\n\n**Output Format:** [Markdown guidance with inline shell command and code examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Focuses on lower-token Sendmux route selection; it does not generate files.]\n\n## Skill Version(s):\n\n1.0.7 (source: server release evidence; artifact frontmatter reports 1.4.2)\n\n## Ethical Considerations:\n\nUsers 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.\n\nArchive v1.0.6: 3 files, 5521 bytes\n\nFiles: skill-card.md (2377b), SKILL.md (10585b), _meta.json (148b)\n\nFile v1.0.6:SKILL.md\n\n---\nname: \"sendmux-token-efficient-usage\"\ndescription: \"Choose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\"\nversion: \"1.4.1\"\nmetadata:\n  openclaw:\n    skillKey: \"sendmux-token-efficient-usage\"\n    homepage: \"https://github.com/Sendmux/skills\"\n---\n\n# Sendmux token-efficient usage\n\n## ClawHub account note\n\nThis ClawHub skill connects OpenClaw agents to Sendmux. Some workflows require a Sendmux account and an appropriate Sendmux API key or agent token. Sendmux account usage is external to ClawHub; do not ask users to paste secrets into chat.\n\nUse this skill to choose the lowest-cost Sendmux route that still answers the task correctly.\n\n## Boundaries\n\n- Do not ask the user to paste an API key.\n- Use send-capable `smx_mbx_*` keys or owner-approved Sending-resource `smx_agent_*` tokens for Sending calls, and `smx_mbx_*` keys for normal Mailbox calls.\n- For a self-registered agent, reuse one durable CLI profile for reads. Sending stays blocked until owner approval, then `sending:*` commands exchange and cache a one-hour delegated token automatically.\n- Its inbox is capped at 500 MiB before approval. Owner-approved sending raises it to at least 5 GiB first, and later send revocation does not shrink it.\n- Use `smx_root_*` for Management calls.\n- Do not default to MCP for every task. MCP is best when the required tool is curated; CLI and SDK cover broader surfaces.\n- Do not pipe real attachments through model context as base64. Route attachment transfer to `sendmux-attachments`; prefer `file_path`, presigned URLs, CLI `--attach`, or SDK file helpers. Mailbox uploads cap each attachment at 7,500,000 bytes; Sending uploads cap each file at 18 MiB; MCP inline base64 caps at 32 KiB decoded.\n- Do not read full mailbox bodies, every message, or every log row unless the user asks for full content and narrower calls cannot answer.\n\n## Surface choice\n\n| Situation                               | Use                                 | Why                                                           |\n| --------------------------------------- | ----------------------------------- | ------------------------------------------------------------- |\n| Connected agent and curated tool exists | MCP tool                            | Small schema and no SDK boilerplate.                          |\n| One-off terminal task                   | `sendmux` CLI with `--json`         | Direct, scriptable, exposes the full generated operation set. |\n| Application code or repeated workflow   | SDK for the project already in use  | Reuses client setup, pagination, headers, and retry helpers.  |\n| MCP lacks the needed operation          | CLI for terminal work, SDK for code | Do not invent uncurated MCP tools.                            |\n| No package/tooling available            | Direct HTTP                         | Keep request bodies and headers aligned to OpenAPI.           |\n\n## Cheapest-call map\n\n| Task                            | Cheapest correct default                                                                                                               |\n| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |\n| Send one outbound email         | `sending_send_email`, CLI `sending:send`, SDK `sendingSendEmail`; include `Idempotency-Key`.                                           |\n| Send multiple outbound emails   | `sending_send_email_batch`, CLI `sending:send:batch`, SDK `sendingSendEmailBatch`; do not loop single sends.                           |\n| Send or read attachments        | `sendmux-attachments`; use `file_path`, presigned upload/download URLs, CLI `--attach`, SDK file helpers, `blob_id` for mailbox sends, and `attachment_id` for Sending sends instead of inline base64. |\n| Count matching mailbox messages | `mailbox_count_messages`, CLI `mailbox:count-messages`, SDK `mailboxCountMessages`.                                                    |\n| Search mailbox text             | `mailbox_search_message_snippets`, CLI `mailbox:search-message-snippets`, SDK `mailboxSearchMessageSnippets`; then fetch selected IDs. |\n| Read several known messages     | `mailbox_batch_get_messages`, CLI `mailbox:batch-get-messages`, SDK `mailboxBatchGetMessages`.                                         |\n| Update/delete several messages  | Batch update/delete after explicit confirmation.                                                                                       |\n| Resume broad mailbox sync       | `mailbox_get_changes`, CLI `mailbox:get-changes`, SDK `mailboxGetChanges`.                                                             |\n| Resume filtered mailbox sync    | CLI/SDK `mailbox:query-message-changes` / `mailboxQueryMessageChanges`; MCP does not curate it yet.                                    |\n| Watch live mailbox events       | CLI/SDK `mailbox:stream-events` / `mailboxStreamEvents`; MCP does not curate it yet.                                                   |\n| Scan threads                    | List threads, then fetch one thread or its messages.                                                                                   |\n| Manage domains/mailboxes/keys   | Management MCP for curated create/list/get/update/suspend/resume/key tools; CLI/SDK for uncovered lifecycle work.                      |\n| Manage sending accounts         | CLI/SDK; MCP does not curate provider tools yet.                                                                                       |\n| Manage webhooks                 | MCP for list/create/test; CLI/SDK for get/update/delete/rotate/delivery payloads.                                                      |\n| Inspect spend, logs, metrics    | Summary/metrics first; filter log lists with small `limit`, then fetch one selected row.                                               |\n\nFor an agent with no key, avoid manual protocol calls and token copying:\n\n```bash\nsendmux agent:register my-agent --default --json\nsendmux mailbox:me:get --profile my-agent --json\nsendmux agent:invite-owner owner@example.com --profile my-agent --json\n```\n\nRegister once, then reuse the durable profile across processes. After owner acceptance and sending approval, use the same profile with `sending:*`; the CLI handles the one-hour delegated token exchange and cache.\n\n## Read less\n\nFor mailbox questions, reduce the result set before reading content:\n\n1. Count when the user asks \"how many\" or when the query may be broad.\n2. Search snippets with a small `limit` when the user needs examples.\n3. Batch-get only selected message IDs.\n4. Request clean body/content only when message text affects the answer.\n\nCLI:\n\n```bash\nsendmux mailbox:count-messages \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --json\n\nsendmux mailbox:search-message-snippets \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=10 \\\n  --json\n\nsendmux mailbox:batch-get-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"body_mode\": \"clean_json\",\n    \"max_body_chars\": 4000,\n    \"strip_quotes\": true,\n    \"strip_signature\": true,\n    \"include_attachments\": \"metadata\"\n  }' \\\n  --json\n```\n\n## Write fewer requests\n\nBatch when there is more than one target.\n\n```bash\nsendmux sending:send:batch \\\n  --idempotency-key \"$IDEMPOTENCY_KEY\" \\\n  --body-file ./messages.json \\\n  --json\n\nsendmux mailbox:batch-update-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"seen\": true,\n    \"if_in_state\": \"state_from_prior_read\"\n  }' \\\n  --json\n```\n\nFor batch sends, inspect every per-message result before reporting success. Batch can contain mixed outcomes.\n\n## Sync by delta\n\nUse sync endpoints instead of re-listing stable data.\n\nBroad mailbox sync:\n\n```bash\nsendmux mailbox:get-changes \\\n  --query messages_since_state=\"$MESSAGES_STATE\" \\\n  --query folders_since_state=\"$FOLDERS_STATE\" \\\n  --query threads_since_state=\"$THREADS_STATE\" \\\n  --query limit=100 \\\n  --json\n```\n\nFiltered message sync:\n\n```bash\nsendmux mailbox:query-message-changes \\\n  --query since_query_state=\"$QUERY_STATE\" \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=100 \\\n  --json\n```\n\nStore the returned state token. Continue with the same filters only while `has_more` is true and the next page is needed.\n\n## Transfer less\n\n- Use small `limit` values on list calls.\n- Follow `pagination.next_cursor` only until enough evidence has been gathered.\n- Prefer summary or metrics endpoints before log lists.\n- Use `If-None-Match` for repeated detail reads that previously returned an `ETag`.\n- Use `If-Match` for updates when the prior read returned an `ETag`.\n- For inbound attachments, fetch metadata and use the short-lived `download_url`; if it expires, re-fetch metadata instead of building URLs manually.\n- For outbound attachments, a file path or presigned URL is usually under 100 tokens, while base64 can burn thousands of tokens and corrupt large files.\n\nCLI conditional examples:\n\n```bash\nsendmux management:get-email-log \\\n  --path public_id=dlog_abc \\\n  --if-none-match \"$ETAG\" \\\n  --json\n\nsendmux management:update-mailbox \\\n  --path public_id=mbx_abc \\\n  --if-match \"$ETAG\" \\\n  --body '{\"display_name\":\"Agent Inbox\"}' \\\n  --json\n```\n\nSDK helpers:\n\n```\nimport {\n  conditionalHeaders,\n  idempotencyHeaders,\n  paginate,\n  responseEtag,\n} from \"@sendmux/core\";\n\nconst headers = conditionalHeaders({ ifNoneMatch: priorEtag });\nconst writeHeaders = {\n  ...conditionalHeaders({ etag: priorEtag }),\n  ...idempotencyHeaders(operationKey),\n};\n```\n\n## Retry safely\n\nUse `Idempotency-Key` on supported mutations so retrying does not create duplicate work.\n\nGood candidates:\n\n- `sending:send` and `sending:send:batch`.\n- `mailbox:send-message`.\n- Management creates, mailbox key creation, suspend/resume, provider mutations, webhook create/rotate/test.\n\nWhen retrying application code, prefer SDK retry helpers only for safe reads or idempotent writes. Non-idempotent writes should fail rather than risk duplicate side effects.\n\n## Routing\n\n- Setup, key scopes, first call: `sendmux-getting-started`.\n- Email send bodies and SMTP-vs-HTTP choice: `sendmux-send-email`.\n- Attachment upload/download mechanics: `sendmux-attachments`.\n- Mailbox read/search/sync/triage/reply details: `sendmux-mailbox-agent`.\n- Management domains, mailboxes, webhooks, billing, logs: `sendmux-management`.\n- CLI syntax and profiles: `sendmux-cli`.\n- MCP installation and client config: `sendmux-mcp-setup`.\n\nFile v1.0.6:_meta.json\n\n{\n  \"ownerId\": \"kn77z51yqhw8mt9vjfkpt8w74989rfb3\",\n  \"slug\": \"sendmux-token-efficient-usage\",\n  \"version\": \"1.0.6\",\n  \"publishedAt\": 1788258535533\n}\n\nFile v1.0.6:skill-card.md\n\n## Description:\n\nChoose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[sendmux.ai](https://clawhub.ai/user/sendmux.ai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and OpenClaw agents use this skill to select efficient Sendmux MCP, CLI, SDK, or HTTP workflows for email, mailbox, attachment, webhook, log, and management tasks while minimizing unnecessary token use and requests.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Send-capable, mailbox, or management credentials can affect email, mailboxes, webhooks, logs, and account resources.\n\nMitigation: Install only for intended Sendmux workflows, limit available credentials or profiles to the task, use the appropriate key scope, and do not ask users to paste secrets into chat.\n\nRisk: Broad mailbox reads, log scans, or inline attachment transfer can expose unnecessary content and consume excessive model context.\n\nMitigation: Prefer counts, snippets, batch fetches, small limits, cursors, ETags, and file path or presigned URL attachment transfer before reading full bodies or embedding files.\n\nRisk: Retries or repeated write calls can duplicate email and management side effects.\n\nMitigation: Use batch endpoints where appropriate, inspect per-message batch results, and include idempotency keys on supported mutations.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/sendmux.ai/skills/sendmux-token-efficient-usage)\n- [Sendmux skills homepage](https://github.com/Sendmux/skills)\n\n## Skill Output:\n\n**Output Type(s):** [guidance, shell commands, code, configuration]\n\n**Output Format:** [Markdown with inline shell commands and code snippets]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Emphasizes concise calls, batching, deltas, cursors, ETags, idempotency keys, and attachment transfer patterns.]\n\n## Skill Version(s):\n\n1.0.6 (source: server release metadata; artifact frontmatter reports 1.4.1)\n\n## Ethical Considerations:\n\nUsers 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.\n\nArchive v1.0.5: 3 files, 5398 bytes\n\nFiles: skill-card.md (2139b), SKILL.md (10576b), _meta.json (148b)\n\nFile v1.0.5:SKILL.md\n\n---\nname: \"sendmux-token-efficient-usage\"\ndescription: \"Choose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\"\nversion: \"1.4.0\"\nmetadata:\n  openclaw:\n    skillKey: \"sendmux-token-efficient-usage\"\n    homepage: \"https://github.com/Sendmux/skills\"\n---\n\n# Sendmux token-efficient usage\n\n## ClawHub account note\n\nThis ClawHub skill connects OpenClaw agents to Sendmux. Some workflows require a Sendmux account and an appropriate Sendmux API key or agent token. Sendmux account usage is external to ClawHub; do not ask users to paste secrets into chat.\n\nUse this skill to choose the lowest-cost Sendmux route that still answers the task correctly.\n\n## Boundaries\n\n- Do not ask the user to paste an API key.\n- Use send-capable `smx_mbx_*` keys or owner-approved Sending-resource `smx_agent_*` tokens for Sending calls, and `smx_mbx_*` keys for normal Mailbox calls.\n- For a self-registered agent, reuse one durable CLI profile for reads. Sending stays blocked until owner approval, then `sending:*` commands exchange and cache a one-hour delegated token automatically.\n- Its inbox is capped at 500 MiB before approval. Owner-approved sending raises it to 5 GiB first, and later send revocation does not shrink it.\n- Use `smx_root_*` for Management calls.\n- Do not default to MCP for every task. MCP is best when the required tool is curated; CLI and SDK cover broader surfaces.\n- Do not pipe real attachments through model context as base64. Route attachment transfer to `sendmux-attachments`; prefer `file_path`, presigned URLs, CLI `--attach`, or SDK file helpers. Mailbox uploads cap each attachment at 7,500,000 bytes; Sending uploads cap each file at 18 MiB; MCP inline base64 caps at 32 KiB decoded.\n- Do not read full mailbox bodies, every message, or every log row unless the user asks for full content and narrower calls cannot answer.\n\n## Surface choice\n\n| Situation                               | Use                                 | Why                                                           |\n| --------------------------------------- | ----------------------------------- | ------------------------------------------------------------- |\n| Connected agent and curated tool exists | MCP tool                            | Small schema and no SDK boilerplate.                          |\n| One-off terminal task                   | `sendmux` CLI with `--json`         | Direct, scriptable, exposes the full generated operation set. |\n| Application code or repeated workflow   | SDK for the project already in use  | Reuses client setup, pagination, headers, and retry helpers.  |\n| MCP lacks the needed operation          | CLI for terminal work, SDK for code | Do not invent uncurated MCP tools.                            |\n| No package/tooling available            | Direct HTTP                         | Keep request bodies and headers aligned to OpenAPI.           |\n\n## Cheapest-call map\n\n| Task                            | Cheapest correct default                                                                                                               |\n| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |\n| Send one outbound email         | `sending_send_email`, CLI `sending:send`, SDK `sendingSendEmail`; include `Idempotency-Key`.                                           |\n| Send multiple outbound emails   | `sending_send_email_batch`, CLI `sending:send:batch`, SDK `sendingSendEmailBatch`; do not loop single sends.                           |\n| Send or read attachments        | `sendmux-attachments`; use `file_path`, presigned upload/download URLs, CLI `--attach`, SDK file helpers, `blob_id` for mailbox sends, and `attachment_id` for Sending sends instead of inline base64. |\n| Count matching mailbox messages | `mailbox_count_messages`, CLI `mailbox:count-messages`, SDK `mailboxCountMessages`.                                                    |\n| Search mailbox text             | `mailbox_search_message_snippets`, CLI `mailbox:search-message-snippets`, SDK `mailboxSearchMessageSnippets`; then fetch selected IDs. |\n| Read several known messages     | `mailbox_batch_get_messages`, CLI `mailbox:batch-get-messages`, SDK `mailboxBatchGetMessages`.                                         |\n| Update/delete several messages  | Batch update/delete after explicit confirmation.                                                                                       |\n| Resume broad mailbox sync       | `mailbox_get_changes`, CLI `mailbox:get-changes`, SDK `mailboxGetChanges`.                                                             |\n| Resume filtered mailbox sync    | CLI/SDK `mailbox:query-message-changes` / `mailboxQueryMessageChanges`; MCP does not curate it yet.                                    |\n| Watch live mailbox events       | CLI/SDK `mailbox:stream-events` / `mailboxStreamEvents`; MCP does not curate it yet.                                                   |\n| Scan threads                    | List threads, then fetch one thread or its messages.                                                                                   |\n| Manage domains/mailboxes/keys   | Management MCP for curated create/list/get/update/suspend/resume/key tools; CLI/SDK for uncovered lifecycle work.                      |\n| Manage sending accounts         | CLI/SDK; MCP does not curate provider tools yet.                                                                                       |\n| Manage webhooks                 | MCP for list/create/test; CLI/SDK for get/update/delete/rotate/delivery payloads.                                                      |\n| Inspect spend, logs, metrics    | Summary/metrics first; filter log lists with small `limit`, then fetch one selected row.                                               |\n\nFor an agent with no key, avoid manual protocol calls and token copying:\n\n```bash\nsendmux agent:register my-agent --default --json\nsendmux mailbox:me:get --profile my-agent --json\nsendmux agent:invite-owner owner@example.com --profile my-agent --json\n```\n\nRegister once, then reuse the durable profile across processes. After owner acceptance and sending approval, use the same profile with `sending:*`; the CLI handles the one-hour delegated token exchange and cache.\n\n## Read less\n\nFor mailbox questions, reduce the result set before reading content:\n\n1. Count when the user asks \"how many\" or when the query may be broad.\n2. Search snippets with a small `limit` when the user needs examples.\n3. Batch-get only selected message IDs.\n4. Request clean body/content only when message text affects the answer.\n\nCLI:\n\n```bash\nsendmux mailbox:count-messages \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --json\n\nsendmux mailbox:search-message-snippets \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=10 \\\n  --json\n\nsendmux mailbox:batch-get-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"body_mode\": \"clean_json\",\n    \"max_body_chars\": 4000,\n    \"strip_quotes\": true,\n    \"strip_signature\": true,\n    \"include_attachments\": \"metadata\"\n  }' \\\n  --json\n```\n\n## Write fewer requests\n\nBatch when there is more than one target.\n\n```bash\nsendmux sending:send:batch \\\n  --idempotency-key \"$IDEMPOTENCY_KEY\" \\\n  --body-file ./messages.json \\\n  --json\n\nsendmux mailbox:batch-update-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"seen\": true,\n    \"if_in_state\": \"state_from_prior_read\"\n  }' \\\n  --json\n```\n\nFor batch sends, inspect every per-message result before reporting success. Batch can contain mixed outcomes.\n\n## Sync by delta\n\nUse sync endpoints instead of re-listing stable data.\n\nBroad mailbox sync:\n\n```bash\nsendmux mailbox:get-changes \\\n  --query messages_since_state=\"$MESSAGES_STATE\" \\\n  --query folders_since_state=\"$FOLDERS_STATE\" \\\n  --query threads_since_state=\"$THREADS_STATE\" \\\n  --query limit=100 \\\n  --json\n```\n\nFiltered message sync:\n\n```bash\nsendmux mailbox:query-message-changes \\\n  --query since_query_state=\"$QUERY_STATE\" \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=100 \\\n  --json\n```\n\nStore the returned state token. Continue with the same filters only while `has_more` is true and the next page is needed.\n\n## Transfer less\n\n- Use small `limit` values on list calls.\n- Follow `pagination.next_cursor` only until enough evidence has been gathered.\n- Prefer summary or metrics endpoints before log lists.\n- Use `If-None-Match` for repeated detail reads that previously returned an `ETag`.\n- Use `If-Match` for updates when the prior read returned an `ETag`.\n- For inbound attachments, fetch metadata and use the short-lived `download_url`; if it expires, re-fetch metadata instead of building URLs manually.\n- For outbound attachments, a file path or presigned URL is usually under 100 tokens, while base64 can burn thousands of tokens and corrupt large files.\n\nCLI conditional examples:\n\n```bash\nsendmux management:get-email-log \\\n  --path public_id=dlog_abc \\\n  --if-none-match \"$ETAG\" \\\n  --json\n\nsendmux management:update-mailbox \\\n  --path public_id=mbx_abc \\\n  --if-match \"$ETAG\" \\\n  --body '{\"display_name\":\"Agent Inbox\"}' \\\n  --json\n```\n\nSDK helpers:\n\n```\nimport {\n  conditionalHeaders,\n  idempotencyHeaders,\n  paginate,\n  responseEtag,\n} from \"@sendmux/core\";\n\nconst headers = conditionalHeaders({ ifNoneMatch: priorEtag });\nconst writeHeaders = {\n  ...conditionalHeaders({ etag: priorEtag }),\n  ...idempotencyHeaders(operationKey),\n};\n```\n\n## Retry safely\n\nUse `Idempotency-Key` on supported mutations so retrying does not create duplicate work.\n\nGood candidates:\n\n- `sending:send` and `sending:send:batch`.\n- `mailbox:send-message`.\n- Management creates, mailbox key creation, suspend/resume, provider mutations, webhook create/rotate/test.\n\nWhen retrying application code, prefer SDK retry helpers only for safe reads or idempotent writes. Non-idempotent writes should fail rather than risk duplicate side effects.\n\n## Routing\n\n- Setup, key scopes, first call: `sendmux-getting-started`.\n- Email send bodies and SMTP-vs-HTTP choice: `sendmux-send-email`.\n- Attachment upload/download mechanics: `sendmux-attachments`.\n- Mailbox read/search/sync/triage/reply details: `sendmux-mailbox-agent`.\n- Management domains, mailboxes, webhooks, billing, logs: `sendmux-management`.\n- CLI syntax and profiles: `sendmux-cli`.\n- MCP installation and client config: `sendmux-mcp-setup`.\n\nFile v1.0.5:_meta.json\n\n{\n  \"ownerId\": \"kn77z51yqhw8mt9vjfkpt8w74989rfb3\",\n  \"slug\": \"sendmux-token-efficient-usage\",\n  \"version\": \"1.0.5\",\n  \"publishedAt\": 1788242769399\n}\n\nFile v1.0.5:skill-card.md\n\n## Description:\n\nChoose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[sendmux.ai](https://clawhub.ai/user/sendmux.ai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and external agent users use this skill to select token-efficient Sendmux routes for mailbox reads, sending workflows, attachment handling, sync, management, logs, and billing inspection.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Sendmux credentials or delegated tokens can expose mailbox, sending, management, logs, or billing capabilities if they are over-scoped or shared in chat.\n\nMitigation: Use appropriately scoped Sendmux credentials, avoid pasting secrets into chat, and rely on owner-approved delegated tokens for sending workflows.\n\nRisk: Bulk mailbox changes or send-capable operations can create destructive or high-impact side effects.\n\nMitigation: Require explicit confirmation before destructive, bulk, or send-capable operations, and use idempotency keys for supported mutations.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/sendmux.ai/skills/sendmux-token-efficient-usage)\n- [Sendmux skills homepage](https://github.com/Sendmux/skills)\n\n## Skill Output:\n\n**Output Type(s):** [Guidance, Shell commands, Code, Configuration]\n\n**Output Format:** [Markdown guidance with inline bash commands, code snippets, and API route names]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Focuses on token-efficient Sendmux usage patterns including batching, snippets, deltas, cursors, ETags, idempotency, and scoped credential handling.]\n\n## Skill Version(s):\n\n1.0.5 (source: ClawHub release metadata; artifact frontmatter and changelog report 1.4.0)\n\n## Ethical Considerations:\n\nUsers 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.\n\nArchive v1.0.4: 3 files, 5223 bytes\n\nFiles: skill-card.md (2395b), SKILL.md (9871b), _meta.json (148b)\n\nFile v1.0.4:SKILL.md\n\n---\nname: \"sendmux-token-efficient-usage\"\ndescription: \"Choose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\"\nversion: \"1.3.0\"\nmetadata:\n  openclaw:\n    skillKey: \"sendmux-token-efficient-usage\"\n    homepage: \"https://github.com/Sendmux/skills\"\n---\n\n# Sendmux token-efficient usage\n\n## ClawHub account note\n\nThis ClawHub skill connects OpenClaw agents to Sendmux. Some workflows require a Sendmux account and an appropriate Sendmux API key or agent token. Sendmux account usage is external to ClawHub; do not ask users to paste secrets into chat.\n\nUse this skill to choose the lowest-cost Sendmux route that still answers the task correctly.\n\n## Boundaries\n\n- Do not ask the user to paste an API key.\n- Use send-capable `smx_mbx_*` keys or owner-approved Sending-resource `smx_agent_*` tokens for Sending calls, and `smx_mbx_*` keys for normal Mailbox calls.\n- Use scoped `smx_agent_*` only for the calls its scopes and resource allow. Pre-claim agent tokens cannot send.\n- Use `smx_root_*` for Management calls.\n- Do not default to MCP for every task. MCP is best when the required tool is curated; CLI and SDK cover broader surfaces.\n- Do not pipe real attachments through model context as base64. Route attachment transfer to `sendmux-attachments`; prefer `file_path`, presigned URLs, CLI `--attach`, or SDK file helpers. Mailbox uploads cap each attachment at 7,500,000 bytes; Sending uploads cap each file at 18 MiB; MCP inline base64 caps at 32 KiB decoded.\n- Do not read full mailbox bodies, every message, or every log row unless the user asks for full content and narrower calls cannot answer.\n\n## Surface choice\n\n| Situation                               | Use                                 | Why                                                           |\n| --------------------------------------- | ----------------------------------- | ------------------------------------------------------------- |\n| Connected agent and curated tool exists | MCP tool                            | Small schema and no SDK boilerplate.                          |\n| One-off terminal task                   | `sendmux` CLI with `--json`         | Direct, scriptable, exposes the full generated operation set. |\n| Application code or repeated workflow   | SDK for the project already in use  | Reuses client setup, pagination, headers, and retry helpers.  |\n| MCP lacks the needed operation          | CLI for terminal work, SDK for code | Do not invent uncurated MCP tools.                            |\n| No package/tooling available            | Direct HTTP                         | Keep request bodies and headers aligned to OpenAPI.           |\n\n## Cheapest-call map\n\n| Task                            | Cheapest correct default                                                                                                               |\n| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |\n| Send one outbound email         | `sending_send_email`, CLI `sending:send`, SDK `sendingSendEmail`; include `Idempotency-Key`.                                           |\n| Send multiple outbound emails   | `sending_send_email_batch`, CLI `sending:send:batch`, SDK `sendingSendEmailBatch`; do not loop single sends.                           |\n| Send or read attachments        | `sendmux-attachments`; use `file_path`, presigned upload/download URLs, CLI `--attach`, SDK file helpers, `blob_id` for mailbox sends, and `attachment_id` for Sending sends instead of inline base64. |\n| Count matching mailbox messages | `mailbox_count_messages`, CLI `mailbox:count-messages`, SDK `mailboxCountMessages`.                                                    |\n| Search mailbox text             | `mailbox_search_message_snippets`, CLI `mailbox:search-message-snippets`, SDK `mailboxSearchMessageSnippets`; then fetch selected IDs. |\n| Read several known messages     | `mailbox_batch_get_messages`, CLI `mailbox:batch-get-messages`, SDK `mailboxBatchGetMessages`.                                         |\n| Update/delete several messages  | Batch update/delete after explicit confirmation.                                                                                       |\n| Resume broad mailbox sync       | `mailbox_get_changes`, CLI `mailbox:get-changes`, SDK `mailboxGetChanges`.                                                             |\n| Resume filtered mailbox sync    | CLI/SDK `mailbox:query-message-changes` / `mailboxQueryMessageChanges`; MCP does not curate it yet.                                    |\n| Watch live mailbox events       | CLI/SDK `mailbox:stream-events` / `mailboxStreamEvents`; MCP does not curate it yet.                                                   |\n| Scan threads                    | List threads, then fetch one thread or its messages.                                                                                   |\n| Manage domains/mailboxes/keys   | Management MCP for curated create/list/get/update/suspend/resume/key tools; CLI/SDK for uncovered lifecycle work.                      |\n| Manage sending accounts         | CLI/SDK; MCP does not curate provider tools yet.                                                                                       |\n| Manage webhooks                 | MCP for list/create/test; CLI/SDK for get/update/delete/rotate/delivery payloads.                                                      |\n| Inspect spend, logs, metrics    | Summary/metrics first; filter log lists with small `limit`, then fetch one selected row.                                               |\n\n## Read less\n\nFor mailbox questions, reduce the result set before reading content:\n\n1. Count when the user asks \"how many\" or when the query may be broad.\n2. Search snippets with a small `limit` when the user needs examples.\n3. Batch-get only selected message IDs.\n4. Request clean body/content only when message text affects the answer.\n\nCLI:\n\n```bash\nsendmux mailbox:count-messages \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --json\n\nsendmux mailbox:search-message-snippets \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=10 \\\n  --json\n\nsendmux mailbox:batch-get-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"body_mode\": \"clean_json\",\n    \"max_body_chars\": 4000,\n    \"strip_quotes\": true,\n    \"strip_signature\": true,\n    \"include_attachments\": \"metadata\"\n  }' \\\n  --json\n```\n\n## Write fewer requests\n\nBatch when there is more than one target.\n\n```bash\nsendmux sending:send:batch \\\n  --idempotency-key \"$IDEMPOTENCY_KEY\" \\\n  --body-file ./messages.json \\\n  --json\n\nsendmux mailbox:batch-update-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"seen\": true,\n    \"if_in_state\": \"state_from_prior_read\"\n  }' \\\n  --json\n```\n\nFor batch sends, inspect every per-message result before reporting success. Batch can contain mixed outcomes.\n\n## Sync by delta\n\nUse sync endpoints instead of re-listing stable data.\n\nBroad mailbox sync:\n\n```bash\nsendmux mailbox:get-changes \\\n  --query messages_since_state=\"$MESSAGES_STATE\" \\\n  --query folders_since_state=\"$FOLDERS_STATE\" \\\n  --query threads_since_state=\"$THREADS_STATE\" \\\n  --query limit=100 \\\n  --json\n```\n\nFiltered message sync:\n\n```bash\nsendmux mailbox:query-message-changes \\\n  --query since_query_state=\"$QUERY_STATE\" \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=100 \\\n  --json\n```\n\nStore the returned state token. Continue with the same filters only while `has_more` is true and the next page is needed.\n\n## Transfer less\n\n- Use small `limit` values on list calls.\n- Follow `pagination.next_cursor` only until enough evidence has been gathered.\n- Prefer summary or metrics endpoints before log lists.\n- Use `If-None-Match` for repeated detail reads that previously returned an `ETag`.\n- Use `If-Match` for updates when the prior read returned an `ETag`.\n- For inbound attachments, fetch metadata and use the short-lived `download_url`; if it expires, re-fetch metadata instead of building URLs manually.\n- For outbound attachments, a file path or presigned URL is usually under 100 tokens, while base64 can burn thousands of tokens and corrupt large files.\n\nCLI conditional examples:\n\n```bash\nsendmux management:get-email-log \\\n  --path public_id=dlog_abc \\\n  --if-none-match \"$ETAG\" \\\n  --json\n\nsendmux management:update-mailbox \\\n  --path public_id=mbx_abc \\\n  --if-match \"$ETAG\" \\\n  --body '{\"display_name\":\"Agent Inbox\"}' \\\n  --json\n```\n\nSDK helpers:\n\n```\nimport {\n  conditionalHeaders,\n  idempotencyHeaders,\n  paginate,\n  responseEtag,\n} from \"@sendmux/core\";\n\nconst headers = conditionalHeaders({ ifNoneMatch: priorEtag });\nconst writeHeaders = {\n  ...conditionalHeaders({ etag: priorEtag }),\n  ...idempotencyHeaders(operationKey),\n};\n```\n\n## Retry safely\n\nUse `Idempotency-Key` on supported mutations so retrying does not create duplicate work.\n\nGood candidates:\n\n- `sending:send` and `sending:send:batch`.\n- `mailbox:send-message`.\n- Management creates, mailbox key creation, suspend/resume, provider mutations, webhook create/rotate/test.\n\nWhen retrying application code, prefer SDK retry helpers only for safe reads or idempotent writes. Non-idempotent writes should fail rather than risk duplicate side effects.\n\n## Routing\n\n- Setup, key scopes, first call: `sendmux-getting-started`.\n- Email send bodies and SMTP-vs-HTTP choice: `sendmux-send-email`.\n- Attachment upload/download mechanics: `sendmux-attachments`.\n- Mailbox read/search/sync/triage/reply details: `sendmux-mailbox-agent`.\n- Management domains, mailboxes, webhooks, billing, logs: `sendmux-management`.\n- CLI syntax and profiles: `sendmux-cli`.\n- MCP installation and client config: `sendmux-mcp-setup`.\n\nFile v1.0.4:_meta.json\n\n{\n  \"ownerId\": \"kn77z51yqhw8mt9vjfkpt8w74989rfb3\",\n  \"slug\": \"sendmux-token-efficient-usage\",\n  \"version\": \"1.0.4\",\n  \"publishedAt\": 1783569532735\n}\n\nFile v1.0.4:skill-card.md\n\n## Description: <br>\nChoose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[sendmux.ai](https://clawhub.ai/user/sendmux.ai) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and agents use this skill to choose efficient Sendmux operations for authorized email, mailbox, management, and API workflows while minimizing unnecessary reads, sends, retries, and attachment transfer. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Agents may access Sendmux keys or agent tokens while performing authorized workflows. <br>\nMitigation: Keep key and token scopes narrow, use the appropriate Sendmux credential type for each surface, and do not ask users to paste secrets into chat. <br>\nRisk: Sends, deletes, provider changes, and other account-impacting actions can have side effects. <br>\nMitigation: Require explicit approval for account-impacting actions and use idempotency keys for supported mutations and retries. <br>\nRisk: Full mailbox reads, broad log scans, or inline attachment transfer can expose unnecessary content and consume excess context. <br>\nMitigation: Prefer counts, snippets, small limits, batch reads, deltas, cursors, ETags, and file paths or presigned URLs for attachments. <br>\n\n\n## Reference(s): <br>\n- [Sendmux skills repository](https://github.com/Sendmux/skills) <br>\n- [ClawHub skill page](https://clawhub.ai/sendmux.ai/skills/sendmux-token-efficient-usage) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [Guidance, Shell commands, Code, Configuration instructions] <br>\n**Output Format:** [Markdown with tables and inline bash/code blocks] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Provides route, batching, pagination, idempotency, and attachment-handling guidance for Sendmux workflows.] <br>\n\n## Skill Version(s): <br>\n1.0.4 (source: ClawHub release metadata; artifact frontmatter says 1.3.0) <br>\n\n## Ethical Considerations: <br>\nUsers 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. <br>\n\nArchive v1.0.3: 3 files, 5194 bytes\n\nFiles: skill-card.md (2373b), SKILL.md (9871b), _meta.json (148b)\n\nFile v1.0.3:SKILL.md\n\n---\nname: \"sendmux-token-efficient-usage\"\ndescription: \"Choose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\"\nversion: \"1.2.0\"\nmetadata:\n  openclaw:\n    skillKey: \"sendmux-token-efficient-usage\"\n    homepage: \"https://github.com/Sendmux/skills\"\n---\n\n# Sendmux token-efficient usage\n\n## ClawHub account note\n\nThis ClawHub skill connects OpenClaw agents to Sendmux. Some workflows require a Sendmux account and an appropriate Sendmux API key or agent token. Sendmux account usage is external to ClawHub; do not ask users to paste secrets into chat.\n\nUse this skill to choose the lowest-cost Sendmux route that still answers the task correctly.\n\n## Boundaries\n\n- Do not ask the user to paste an API key.\n- Use send-capable `smx_mbx_*` keys or owner-approved Sending-resource `smx_agent_*` tokens for Sending calls, and `smx_mbx_*` keys for normal Mailbox calls.\n- Use scoped `smx_agent_*` only for the calls its scopes and resource allow. Pre-claim agent tokens cannot send.\n- Use `smx_root_*` for Management calls.\n- Do not default to MCP for every task. MCP is best when the required tool is curated; CLI and SDK cover broader surfaces.\n- Do not pipe real attachments through model context as base64. Route attachment transfer to `sendmux-attachments`; prefer `file_path`, presigned URLs, CLI `--attach`, or SDK file helpers. Mailbox uploads cap each attachment at 7,500,000 bytes; Sending uploads cap each file at 18 MiB; MCP inline base64 caps at 32 KiB decoded.\n- Do not read full mailbox bodies, every message, or every log row unless the user asks for full content and narrower calls cannot answer.\n\n## Surface choice\n\n| Situation                               | Use                                 | Why                                                           |\n| --------------------------------------- | ----------------------------------- | ------------------------------------------------------------- |\n| Connected agent and curated tool exists | MCP tool                            | Small schema and no SDK boilerplate.                          |\n| One-off terminal task                   | `sendmux` CLI with `--json`         | Direct, scriptable, exposes the full generated operation set. |\n| Application code or repeated workflow   | SDK for the project already in use  | Reuses client setup, pagination, headers, and retry helpers.  |\n| MCP lacks the needed operation          | CLI for terminal work, SDK for code | Do not invent uncurated MCP tools.                            |\n| No package/tooling available            | Direct HTTP                         | Keep request bodies and headers aligned to OpenAPI.           |\n\n## Cheapest-call map\n\n| Task                            | Cheapest correct default                                                                                                               |\n| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |\n| Send one outbound email         | `sending_send_email`, CLI `sending:send`, SDK `sendingSendEmail`; include `Idempotency-Key`.                                           |\n| Send multiple outbound emails   | `sending_send_email_batch`, CLI `sending:send:batch`, SDK `sendingSendEmailBatch`; do not loop single sends.                           |\n| Send or read attachments        | `sendmux-attachments`; use `file_path`, presigned upload/download URLs, CLI `--attach`, SDK file helpers, `blob_id` for mailbox sends, and `attachment_id` for Sending sends instead of inline base64. |\n| Count matching mailbox messages | `mailbox_count_messages`, CLI `mailbox:count-messages`, SDK `mailboxCountMessages`.                                                    |\n| Search mailbox text             | `mailbox_search_message_snippets`, CLI `mailbox:search-message-snippets`, SDK `mailboxSearchMessageSnippets`; then fetch selected IDs. |\n| Read several known messages     | `mailbox_batch_get_messages`, CLI `mailbox:batch-get-messages`, SDK `mailboxBatchGetMessages`.                                         |\n| Update/delete several messages  | Batch update/delete after explicit confirmation.                                                                                       |\n| Resume broad mailbox sync       | `mailbox_get_changes`, CLI `mailbox:get-changes`, SDK `mailboxGetChanges`.                                                             |\n| Resume filtered mailbox sync    | CLI/SDK `mailbox:query-message-changes` / `mailboxQueryMessageChanges`; MCP does not curate it yet.                                    |\n| Watch live mailbox events       | CLI/SDK `mailbox:stream-events` / `mailboxStreamEvents`; MCP does not curate it yet.                                                   |\n| Scan threads                    | List threads, then fetch one thread or its messages.                                                                                   |\n| Manage domains/mailboxes/keys   | Management MCP for curated create/list/get/update/suspend/resume/key tools; CLI/SDK for uncovered lifecycle work.                      |\n| Manage sending accounts         | CLI/SDK; MCP does not curate provider tools yet.                                                                                       |\n| Manage webhooks                 | MCP for list/create/test; CLI/SDK for get/update/delete/rotate/delivery payloads.                                                      |\n| Inspect spend, logs, metrics    | Summary/metrics first; filter log lists with small `limit`, then fetch one selected row.                                               |\n\n## Read less\n\nFor mailbox questions, reduce the result set before reading content:\n\n1. Count when the user asks \"how many\" or when the query may be broad.\n2. Search snippets with a small `limit` when the user needs examples.\n3. Batch-get only selected message IDs.\n4. Request clean body/content only when message text affects the answer.\n\nCLI:\n\n```bash\nsendmux mailbox:count-messages \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --json\n\nsendmux mailbox:search-message-snippets \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=10 \\\n  --json\n\nsendmux mailbox:batch-get-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"body_mode\": \"clean_json\",\n    \"max_body_chars\": 4000,\n    \"strip_quotes\": true,\n    \"strip_signature\": true,\n    \"include_attachments\": \"metadata\"\n  }' \\\n  --json\n```\n\n## Write fewer requests\n\nBatch when there is more than one target.\n\n```bash\nsendmux sending:send:batch \\\n  --idempotency-key \"$IDEMPOTENCY_KEY\" \\\n  --body-file ./messages.json \\\n  --json\n\nsendmux mailbox:batch-update-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"seen\": true,\n    \"if_in_state\": \"state_from_prior_read\"\n  }' \\\n  --json\n```\n\nFor batch sends, inspect every per-message result before reporting success. Batch can contain mixed outcomes.\n\n## Sync by delta\n\nUse sync endpoints instead of re-listing stable data.\n\nBroad mailbox sync:\n\n```bash\nsendmux mailbox:get-changes \\\n  --query messages_since_state=\"$MESSAGES_STATE\" \\\n  --query folders_since_state=\"$FOLDERS_STATE\" \\\n  --query threads_since_state=\"$THREADS_STATE\" \\\n  --query limit=100 \\\n  --json\n```\n\nFiltered message sync:\n\n```bash\nsendmux mailbox:query-message-changes \\\n  --query since_query_state=\"$QUERY_STATE\" \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=100 \\\n  --json\n```\n\nStore the returned state token. Continue with the same filters only while `has_more` is true and the next page is needed.\n\n## Transfer less\n\n- Use small `limit` values on list calls.\n- Follow `pagination.next_cursor` only until enough evidence has been gathered.\n- Prefer summary or metrics endpoints before log lists.\n- Use `If-None-Match` for repeated detail reads that previously returned an `ETag`.\n- Use `If-Match` for updates when the prior read returned an `ETag`.\n- For inbound attachments, fetch metadata and use the short-lived `download_url`; if it expires, re-fetch metadata instead of building URLs manually.\n- For outbound attachments, a file path or presigned URL is usually under 100 tokens, while base64 can burn thousands of tokens and corrupt large files.\n\nCLI conditional examples:\n\n```bash\nsendmux management:get-email-log \\\n  --path public_id=dlog_abc \\\n  --if-none-match \"$ETAG\" \\\n  --json\n\nsendmux management:update-mailbox \\\n  --path public_id=mbx_abc \\\n  --if-match \"$ETAG\" \\\n  --body '{\"display_name\":\"Agent Inbox\"}' \\\n  --json\n```\n\nSDK helpers:\n\n```\nimport {\n  conditionalHeaders,\n  idempotencyHeaders,\n  paginate,\n  responseEtag,\n} from \"@sendmux/core\";\n\nconst headers = conditionalHeaders({ ifNoneMatch: priorEtag });\nconst writeHeaders = {\n  ...conditionalHeaders({ etag: priorEtag }),\n  ...idempotencyHeaders(operationKey),\n};\n```\n\n## Retry safely\n\nUse `Idempotency-Key` on supported mutations so retrying does not create duplicate work.\n\nGood candidates:\n\n- `sending:send` and `sending:send:batch`.\n- `mailbox:send-message`.\n- Management creates, mailbox key creation, suspend/resume, provider mutations, webhook create/rotate/test.\n\nWhen retrying application code, prefer SDK retry helpers only for safe reads or idempotent writes. Non-idempotent writes should fail rather than risk duplicate side effects.\n\n## Routing\n\n- Setup, key scopes, first call: `sendmux-getting-started`.\n- Email send bodies and SMTP-vs-HTTP choice: `sendmux-send-email`.\n- Attachment upload/download mechanics: `sendmux-attachments`.\n- Mailbox read/search/sync/triage/reply details: `sendmux-mailbox-agent`.\n- Management domains, mailboxes, webhooks, billing, logs: `sendmux-management`.\n- CLI syntax and profiles: `sendmux-cli`.\n- MCP installation and client config: `sendmux-mcp-setup`.\n\nFile v1.0.3:_meta.json\n\n{\n  \"ownerId\": \"kn77z51yqhw8mt9vjfkpt8w74989rfb3\",\n  \"slug\": \"sendmux-token-efficient-usage\",\n  \"version\": \"1.0.3\",\n  \"publishedAt\": 1783561597531\n}\n\nFile v1.0.3:skill-card.md\n\n## Description: <br>\nChoose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[sendmux.ai](https://clawhub.ai/user/sendmux.ai) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and agent operators use this skill to select efficient Sendmux routes for mailbox, sending, management, webhook, sync, and attachment workflows while avoiding unnecessary token use. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: Sendmux actions can send messages or change mailbox, webhook, or management resources. <br>\nMitigation: Review token scopes before use and confirm sending, update, delete, webhook, and management actions before execution. <br>\nRisk: Using broad reads, inline attachments, or full message bodies can expose unnecessary content and consume excessive context. <br>\nMitigation: Use counts, snippets, batch reads for selected IDs, small limits, metadata-only attachment handling, file paths, or presigned URLs where possible. <br>\nRisk: Retrying non-idempotent writes can create duplicate side effects. <br>\nMitigation: Use Idempotency-Key for supported mutations and fail non-idempotent writes instead of retrying them automatically. <br>\n\n\n## Reference(s): <br>\n- [Sendmux Skills Repository](https://github.com/Sendmux/skills) <br>\n- [ClawHub Skill Page](https://clawhub.ai/sendmux.ai/skills/sendmux-token-efficient-usage) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [guidance, shell commands, code, configuration] <br>\n**Output Format:** [Markdown guidance with inline shell commands and code snippets] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Focuses on low-token Sendmux usage patterns, scoped tokens, batching, deltas, cursors, ETags, idempotency, and attachment transfer choices.] <br>\n\n## Skill Version(s): <br>\n1.0.3 (source: server release metadata; artifact frontmatter reports 1.2.0) <br>\n\n## Ethical Considerations: <br>\nUsers 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. <br>\n\nArchive v1.0.2: 3 files, 5230 bytes\n\nFiles: skill-card.md (2376b), SKILL.md (9871b), _meta.json (148b)\n\nFile v1.0.2:SKILL.md\n\n---\nname: \"sendmux-token-efficient-usage\"\ndescription: \"Choose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\"\nversion: \"1.1.0\"\nmetadata:\n  openclaw:\n    skillKey: \"sendmux-token-efficient-usage\"\n    homepage: \"https://github.com/Sendmux/skills\"\n---\n\n# Sendmux token-efficient usage\n\n## ClawHub account note\n\nThis ClawHub skill connects OpenClaw agents to Sendmux. Some workflows require a Sendmux account and an appropriate Sendmux API key or agent token. Sendmux account usage is external to ClawHub; do not ask users to paste secrets into chat.\n\nUse this skill to choose the lowest-cost Sendmux route that still answers the task correctly.\n\n## Boundaries\n\n- Do not ask the user to paste an API key.\n- Use send-capable `smx_mbx_*` keys or owner-approved Sending-resource `smx_agent_*` tokens for Sending calls, and `smx_mbx_*` keys for normal Mailbox calls.\n- Use scoped `smx_agent_*` only for the calls its scopes and resource allow. Pre-claim agent tokens cannot send.\n- Use `smx_root_*` for Management calls.\n- Do not default to MCP for every task. MCP is best when the required tool is curated; CLI and SDK cover broader surfaces.\n- Do not pipe real attachments through model context as base64. Route attachment transfer to `sendmux-attachments`; prefer `file_path`, presigned URLs, CLI `--attach`, or SDK file helpers. Mailbox uploads cap each attachment at 7,500,000 bytes; Sending uploads cap each file at 18 MiB; MCP inline base64 caps at 32 KiB decoded.\n- Do not read full mailbox bodies, every message, or every log row unless the user asks for full content and narrower calls cannot answer.\n\n## Surface choice\n\n| Situation                               | Use                                 | Why                                                           |\n| --------------------------------------- | ----------------------------------- | ------------------------------------------------------------- |\n| Connected agent and curated tool exists | MCP tool                            | Small schema and no SDK boilerplate.                          |\n| One-off terminal task                   | `sendmux` CLI with `--json`         | Direct, scriptable, exposes the full generated operation set. |\n| Application code or repeated workflow   | SDK for the project already in use  | Reuses client setup, pagination, headers, and retry helpers.  |\n| MCP lacks the needed operation          | CLI for terminal work, SDK for code | Do not invent uncurated MCP tools.                            |\n| No package/tooling available            | Direct HTTP                         | Keep request bodies and headers aligned to OpenAPI.           |\n\n## Cheapest-call map\n\n| Task                            | Cheapest correct default                                                                                                               |\n| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |\n| Send one outbound email         | `sending_send_email`, CLI `sending:send`, SDK `sendingSendEmail`; include `Idempot","readmeExcerpt":"Skill: sendmux-token-efficient-usage Owner: sendmux.ai Summary: Choose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency. Tags: latest:1.0.11 Version history: v1.0.11 | 2026-10-02T04:23:30.076Z | auto sendmux-token-efficient-usage v1.0.11 - Updated internal documentation in SKILL.md. - Removed the obsolete skill-card.md file. - Incremen","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"sendmux agent:register my-agent --default --json\nsendmux mailbox:me:get --profile my-agent --json\nsendmux agent:invite-owner owner@example.com --profile my-agent --json"},{"language":"bash","snippet":"sendmux mailbox:count-messages \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --json\n\nsendmux mailbox:search-message-snippets \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=10 \\\n  --json\n\nsendmux mailbox:batch-get-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"body_mode\": \"clean_json\",\n    \"max_body_chars\": 4000,\n    \"strip_quotes\": true,\n    \"strip_signature\": true,\n    \"include_attachments\": \"metadata\"\n  }' \\\n  --json"},{"language":"bash","snippet":"sendmux sending:send:batch \\\n  --idempotency-key \"$IDEMPOTENCY_KEY\" \\\n  --body-file ./messages.json \\\n  --json\n\nsendmux mailbox:batch-update-messages \\\n  --body '{\n    \"ids\": [\"eml_abc\", \"eml_def\"],\n    \"seen\": true,\n    \"if_in_state\": \"state_from_prior_read\"\n  }' \\\n  --json"},{"language":"bash","snippet":"sendmux mailbox:get-changes \\\n  --query types=messages,folders,threads \\\n  --query messages_since_state=\"$MESSAGES_STATE\" \\\n  --query folders_since_state=\"$FOLDERS_STATE\" \\\n  --query threads_since_state=\"$THREADS_STATE\" \\\n  --query limit=100 \\\n  --json"},{"language":"bash","snippet":"sendmux mailbox:get-changes \\\n  --query types=messages \\\n  --query messages_since_state=\"$NEXT_MESSAGES_STATE\" \\\n  --query limit=100 \\\n  --json"},{"language":"bash","snippet":"sendmux mailbox:query-message-changes \\\n  --query since_query_state=\"$QUERY_STATE\" \\\n  --query q=invoice \\\n  --query is_unread=true \\\n  --query limit=100 \\\n  --json"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: \"sendmux-token-efficient-usage\"\ndescription: \"Choose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\"\nversion: \"1.7.1\"\nmetadata:\n  openclaw:\n    skillKey: \"sendmux-token-efficient-usage\"\n    homepage: \"https://github.com/Sendmux/skills\"\n    primaryEnv: \"SENDMUX_API_KEY\"\n    envVars:\n      - name: \"SENDMUX_API_KEY\"\n        required: false\n        description: \"Optional Sendmux API key or scoped agent token used by CLI, SDK, HTTP, or MCP examples.\"\n---\n\n# Sendmux token-efficient usage\n\n## ClawHub account note\n\nThis ClawHub skill connects OpenClaw agents to Sendmux. Some workflows require a Sendmux account and an appropriate Sendmux API key or agent token. Sendmux account usage is external to ClawHub; do not ask users to paste secrets into chat.\n\nUse this skill to choose the lowest-cost Sendmux route that still answers the task correctly.\n\n## Boundaries\n\n- Do not ask the user to paste an API key.\n- For API-key authentication, use `smx_mbx_*` keys for normal Mailbox calls.\n- For a self-registered agent, reuse one durable CLI profile. Mailbox reads become available after provisioning, before owner approval; Sending stays blocked until owner approval.\n- For API-key authentication, use `smx_root_*` for Management calls.\n- Do not default to MCP for every task. MCP is best when the required tool is curated; CLI and SDK cover broader surfaces.\n- Keep real attachment bytes outside model context and route their mechanics to `sendmux-attachments`; use the attachment route reference below.\n- Do not read full mailbox bodies, every message, or every log row unless the user asks for full content and narrower calls cannot answer.\n\nChoose the authentication connection, then its already-approved product surface. For an existing OAuth profile, use the already-known approved surface from its granted permissions or setup context. If that surface is unknown, show the surface-specific alternatives below and ask which one the profile grants; there is no universal Mailbox default.\n\n| Authentication connection | Validate with | Ownership boundary |\n| --- | --- | --- |\n| Existing CLI or REST OAuth profile | The selected CLI operation: `mailbox:get-connection`, `management:get-connection`, or `sending:get-connection` | Explain that the check stays within the profile's approved surface, scopes, and mailboxes. `sendmux-cli` owns login and refresh. |\n| SDK application credentials | The selected SDK operation: `mailboxGetConnection`, `managementGetConnection`, or `sendingGetConnection` | The application supplies SDK credentials; this is not a CLI profile check. |\n| Already-connected MCP session | The selected MCP operation: `mailbox_get_connection`, `management_get_connection`, or `sending_get_connection` | This validates only that MCP session. `sendmux-mcp-setup` owns hosted MCP OAuth setup; it is not an alternate view of a REST profile. |\n\nThese checks need no mailbox selector and sen"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn77z51yqhw8mt9vjfkpt8w74989rfb3\",\n  \"slug\": \"sendmux-token-efficient-usage\",\n  \"version\": \"1.0.11\",\n  \"publishedAt\": 1790915010076\n}"},{"path":"skill-card.md","content":"## Description:\n\nChoose low-token Sendmux calls across MCP, CLI, SDKs, and HTTP by using snippets, counts, batches, deltas, cursors, ETags, and idempotency.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[sendmux.ai](https://clawhub.ai/user/sendmux.ai)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agents use this guide to choose efficient Sendmux email, mailbox, and management operations while limiting unnecessary data retrieval and repeated requests.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Send, delete, or management actions can change account data or send email.\n\nMitigation: Review each requested action before execution and grant management access only when needed.\n\nRisk: Broad credentials or unnecessary mailbox reads can expose sensitive content.\n\nMitigation: Use scoped credentials where possible, keep secrets out of chat, and prefer snippets or targeted reads.\n\n## Reference(s):\n\n- [Sendmux skills homepage (listed in skill metadata)](https://github.com/Sendmux/skills)\n- [ClawHub skill release](https://clawhub.ai/sendmux.ai/skills/sendmux-token-efficient-usage)\n\n## Skill Output:\n\n**Output Type(s):** [Guidance, Shell commands, Code, Configuration instructions]\n\n**Output Format:** [Markdown guidance with command and API examples]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Recommends scoped credentials, narrow reads, batching, and safe retries.]\n\n## Skill Version(s):\n\n1.0.11 (source: ClawHub release metadata; artifact frontmatter says 1.7.1)\n\n## Ethical Considerations:\n\nUsers 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."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":1410,"uniquenessScore":44,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T06:28:10.081Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-10T06:28:10.081Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T10:42:50.425Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}