# SENTO For Agents

Launch tokens on Base with your agent and an authorized signer. No API key.

Contract reference: public integration guide, 2026-11-24. Query the live quote catalogue before launching.

[Agent guide](https://sento.fun/docs/agentic-api) · [Markdown](https://sento.fun/docs/agentic-api.md)

The user supplies `SENTO_PRIVATE_KEY` or `PRIVATE_KEY` in the agent's execution environment and describes the launch. The agent reads the key, derives the creator address, uses the default Base RPC, and runs the reference example itself. No separate wallet or signer setup is required from the user.

A focused launch guide for AI agents. Use the [API reference](https://sento.fun/docs/api-reference) for the full HTTP contract and [Quote assets](https://sento.fun/docs/api-quotes) for the complete current catalogue. The page, copied guide and Markdown share the same rules.

Discover a quote asset, build a launch transaction, then sign it with your own wallet. SENTO returns unsigned transaction data; it never holds your keys or broadcasts for you.

No API-key creation, login or key header is needed for this public channel. API access and wallet signing are separate: an API key would not grant permission to spend from a wallet.

**Production base URL**

```
https://sento.fun/sento-api/pub-api
```

## Launch from an environment key

1. **Prepare your runtime.** Retrieve the [complete runnable example](https://sento.fun/assets/agent-example/sento-launch-reference.zip) and its [Agent Skill](https://sento.fun/assets/agent-example/SKILL.md). In a terminal with Node 22.18+, extract it and run `npm install --ignore-scripts`. The agent performs setup; do not send the user to install a wallet or configure an RPC.
2. **Write the launch task.** Generate `launch.json` from the user's actual name, ticker, mechanism, quote, metadata and authorized opening-buy amount. The example derives `creator` from the environment key and supplies a default Base RPC. Preserve the user's settings and spending limits; do not copy example values as authorization.
3. **Execute and confirm.** Run the example for the authorized launch. It checks quotes, builds, confirms approvals, rebuilds, signs locally, broadcasts and verifies the creation receipt. Keep the checkpoint and hash; resume the same task after an interruption instead of creating another launch.

**The agent runs these commands in the extracted example**

```
npm install --ignore-scripts
# The agent writes launch.json from the user's request.
npm run agent:launch -- --config ./launch.json --check
npm run agent:launch -- --config ./launch.json --execute
```

The example supports Classic, Tax and Staking with one live quote and a fixed opening-buy amount. The only required runtime setting is the signing key; `SENTO_RPC_URL` is optional. It requires code execution, file access and networking. A chat-only environment cannot execute transactions by reading a document.

The runnable example has passed local and mocked workflow tests. A real funded Base launch has not been performed as part of its development. Respect the agent's tool execution policies, signing permissions and the user's approved spend.

## Check your tools first

Before building, confirm that your execution process can access the environment key, files and network. Create the signing account automatically from the key. Use the default Base RPC unless an override is already provided. The public API builds transactions; it does not require the agent to stop at a wallet handoff.

| Capability | What to check |
| --- | --- |
| Environment key | Read `SENTO_PRIVATE_KEY` or `PRIVATE_KEY` in the execution process and create the account with `privateKeyToAccount`. Derive `creator` automatically. Do not request another wallet or signer configuration. A key mentioned in chat alone does not establish process access. |
| RPC and funds | Verify `eth_chainId=0x2105` (8453). The signing wallet needs the selected quote for its opening buy and ETH for native value and gas. Keep signer credentials out of API requests, copied payloads and logs. |
| Image | Resolve the original attachment bytes or a usable public image URI. A visible chat preview is not proof of file access; a local file is not a public URI. |

## Launch in four steps

1. **Choose a quote.** GET `/chains/quotes?chain=base` without filters for the complete current catalogue, then GET `/quote/check?chain=base&quote=<address>`. Require `data.usable=true`; catalogue inclusion alone is not launch availability. For native ETH, omit `quote` in the check. For RWA quotes, use the exact catalogue address and decimals; no extra create fields are needed.
2. **Build.** For a supplied image, follow [Image input](https://sento.fun/docs/agentic-api#image-input) first. POST `/token/create` with the signing wallet as `creator`. Include an opening buy worth at least **$1**, fees included. Check both HTTP success and `code=0`; the transaction is in `data`.
3. **Execute.** Use the connected, authorized wallet or signer to complete approvals, sign and broadcast on `chain_id`. Follow [Agent execution](https://sento.fun/docs/agentic-api#agent-execution); returning calldata alone is not completion.
4. **Confirm.** Save the transaction hash, wait for a successful onchain receipt and verify the expected launch, then GET `/token/info?chain=base&token=<predicted_token>`. Indexing can lag behind a successful receipt. A predicted address or `code=0` alone does not mean a token was launched.

**Build a Classic launch · replace the creator address before calling**

```
curl -X POST 'https://sento.fun/sento-api/pub-api/token/create' \
  -H 'Content-Type: application/json' \
  --data '{
    "chain": "base",
    "creator": "<YOUR_SIGNING_WALLET_ADDRESS>",
    "name": "Orbit",
    "symbol": "ORBIT",
    "template_id": 1,
    "quotes": [
      { "quote": "", "weight_bps": 10000, "dev_buy": "0.01" }
    ]
  }'
```

Example opening buy: 0.01 ETH, fees included. The API enforces the current $1 minimum; keep additional ETH for gas.

## Create request

| Field | Rule |
| --- | --- |
| `chain` | Required. `base` (Base mainnet, chain ID `8453`). |
| `creator` | Required. The EVM wallet that signs the approvals and launch. |
| `name` / `symbol` | Required. Name ≤64 bytes. Symbol 2–10 Chinese characters, A–Z, a–z or digits; no spaces. |
| `template_id` | Pass explicitly: Classic `1`, Staking `5`, Tax `6`. `0` is invalid. |
| `quotes[].quote` | Required. Catalogue address; `""` or `0x0000000000000000000000000000000000000000` means native ETH. |
| `quotes[].weight_bps` | Required. Sum to `10000`; use `10000` for a single quote. Each quote must be usable; multi-quote shares must also meet contract minimums. |
| Opening buy | Required: `quotes[].dev_buy` in quote units, or `quotes[].dev_buy_percent` (`"5"` = 5% of supply, single quote only). Decimal strings; mutually exclusive. Value must be ≥$1. |
| `quotes[].min_token_out` | Optional opening-buy floor, in human-readable project tokens (18 decimals); requires an opening buy. |
| `deadline` | Optional future Unix timestamp in seconds; `0` means unset. |

Optional metadata: `image_uri` (`ipfs://`, `https://` or `ar://`, ≤512 bytes), `description` (≤1000 bytes), `website` (`https://`), `twitter` (`https://x.com/...` or `https://twitter.com/...`) and `telegram` (`https://t.me/...` or `https://telegram.me/...`). X/Twitter also accepts `www.` and `mobile.` subdomains. Empty website defaults to `https://sento.fun`; empty description uses the platform default.

> **Amounts stay as strings:** Input amounts are human-readable decimal strings, not wei. Read quote decimals from the catalogue and `data.quotes[].quote_decimals`; RWA precision varies. Extra fractional digits are truncated. Transaction `data.value` is different: it is an integer string in wei.

## Image input

- Already hosted: pass a stable, publicly retrievable HTTPS image directly as `image_uri`; a separate IPFS upload is not required. `ipfs://` and `ar://` are also accepted. Use the image resource, not a webpage or an expiring/private link.
- Attachment or generated image: obtain the original file through the attachment/generation tool. Use its actual local path if supplied. If the tool returns bytes, save those original bytes as an image file in the permitted workspace or temporary directory. Preserve the image and file format; do not substitute a screenshot, invent a path or re-encode it just to upload.
- Upload the original file with an available, authorized image-upload tool, then put its returned public URI in `image_uri`. Check that the URI can be fetched without a private session. Saving a file locally does not publish it. Do not ask the user to host it manually when your tools can complete this step.
- The current public contract accepts `image_uri` only; no file or Base64 upload endpoint is documented for this channel. The website uploader uses a separate login flow. Never put a local path, attachment ID, Base64 data or a placeholder CID in `image_uri`.
- Distinguish the blocker: no original-file access means the preview cannot be retrieved; file access without an uploader means the original exists locally but no public URI can be created here. Report that exact missing capability once. Keep the image and launch settings; do not silently omit it or claim it was uploaded. Reuse the confirmed URI when rebuilding expired calldata.

## Choose a mechanism

| Mechanism | template_id | Configuration |
| --- | --- | --- |
| Classic (API: Standard) | `1` | Omit `tax`. |
| Staking | `5` | Omit both `tax` and `creator_recipients`. |
| Tax | `6` | `tax.buy_bps` and `tax.sell_bps`: `100`, `200`, `300`, `400` or `500` (1–5%). `tax.dividend_bps`: `0`–`10000`; choose a payout mode below. |

Optional `creator_recipients`: `[{"address":"<EVM_ADDRESS>","bps":10000}]`, up to **5** recipients, shares totaling `10000`. Omit to send the creator share to `creator`; not allowed for Staking. For Tax, these shares split only the non-dividend remainder.

## Tax inputs

Set only the user's requested token tax in `tax.buy_bps` and `tax.sell_bps`. The API includes other trading charges automatically. Returned `buy_fee_bps` / `sell_fee_bps` are totals, not tax inputs; never copy them back into `tax`. The opening `dev_buy` already includes trading fees: send the exact returned wei `data.value` without adding fees again. Gas is additional.

## Tax payout modes

| Destination | tax.dividend_bps | creator_recipients |
| --- | --- | --- |
| Holder dividends | `10000` | Not needed. The entire creator share goes to holders. |
| Specified addresses | Omit or `0` | Optional. If omitted, the creator share goes to `creator`. |
| Split | `1`–`9999` | Optional. Address shares total `10000` and split only the non-dividend remainder. If omitted, that remainder goes to `creator`. |

`dividend_bps` is the holders' portion of the **creator share**, not the trade amount. `5000` means 50% to holders; recipient shares split the other 50%. Values outside `0`–`10000` are rejected.

The example sets 1% token tax on buys and sells. Use the user's requested tax rates; example values are not API defaults.

**Tax create body · 1% token tax, holder dividends**

```
{
  "chain": "base",
  "creator": "<YOUR_SIGNING_WALLET_ADDRESS>",
  "name": "Orbit",
  "symbol": "ORBIT",
  "template_id": 6,
  "tax": { "buy_bps": 100, "sell_bps": 100, "dividend_bps": 10000 },
  "quotes": [
    { "quote": "", "weight_bps": 10000, "dev_buy": "0.01" }
  ]
}
```

## Agent execution

- Once the user has authorized the launch, its settings and opening-buy spend, use the available authorized wallet tool or signer to build, approve if needed, submit and track the receipt. Preserve the requested settings and spend; example values are not spending authorization. Honor tool execution policies, wallet signing prompts, permissions and spending limits.
- Do not ask the user to configure API-managed charges or add a second conversational confirmation solely for expected charges or omitted optional image/social links. Use the supplied metadata and documented defaults, and review actual wallet spend against the user's authorization. A correctly built transaction is still unfinished until its onchain receipt succeeds.
- When the environment key and code execution are available, construct the signer yourself and finish through the reference example. Do not report a missing preconfigured signer or require a browser extension. Never print the key, send it to the API or embed it in task files.
- If the environment cannot execute code, access the injected key or reach the network, state that exact missing capability once. Do not misidentify it as a missing API key. Tool policies and signing permissions remain effective; a rejected tool action is not an API failure.

## How the signing account is created

The reference reads the environment key and creates its viem account and clients automatically. These are internal code objects, not accounts or services the user has to configure. The RPC receives the signed transaction, never the private key.

**Automatic setup inside the reference · no transaction sent by this snippet**

```
import { createPublicClient, createWalletClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { base } from "viem/chains";

const keyText = value => value?.trim().replace(/^0x/i, "");
const primary = keyText(process.env.SENTO_PRIVATE_KEY);
const alternate = keyText(process.env.PRIVATE_KEY);
if (primary && alternate && primary !== alternate) throw new Error("Conflicting keys.");
const secret = primary || alternate;
if (!secret || !/^[0-9a-f]{64}$/i.test(secret))
  throw new Error("The execution process needs a valid environment key.");
const account = privateKeyToAccount("0x" + secret);
const transport = http(process.env.SENTO_RPC_URL || "https://mainnet.base.org");
const wallet = createWalletClient({ account, chain: base, transport });
const rpc = createPublicClient({ chain: base, transport });
const creator = account.address;
```

Use the complete example for approval ordering, calldata checks, integer wei/gas conversion, expiry, signing, checkpointing, broadcast and receipt verification. The setup snippet alone does not launch a token.

## Sign and confirm

- For each `data.approvals[]` with `need_approve=true`, send that item's `data` to its `token` address with native value `0`; wait for success. Keep array order. Do not send an approval to `spender` or to the main transaction's `to`.
- If `gas_limit` is missing with `gas_unavailable_reason=pending_approval`, rebuild after approval. Rebuild when a returned `price_proof_expires_at` or your `deadline` is near expiry. The price-proof field may be absent; when present, execution must land onchain **before** it expires.
- Use the final response's `data` object: `chain_id`, `to`, calldata `data`, exact wei `value`, and `gas_limit` when available. Confirm the signing wallet matches `creator` and is on Base. Convert wei and gas to integer types required by your wallet SDK; never use floating point.
- Retain the transaction hash and `predicted_token`. Confirm the receipt succeeded before reporting a launch. If confirmation or indexing is delayed, check that hash first; do not submit a second launch to compensate for an uncertain result.

## When a launch stops

| Last completed stage | Report and next action |
| --- | --- |
| Image preview only | No original-file access, or no authorized uploader. Say which capability is missing; do not call this an API upload failure. |
| Build succeeded; no transaction hash | Prepared only. Check signer availability, matching creator, tool permissions, quote/ETH balance, approvals and expiry. Preserve the actual signing or RPC error. |
| Submission timed out | The RPC may already have received the transaction. Keep the known hash and nonce; inspect wallet submission state before sending again. |
| Hash exists; no receipt | Submitted, confirmation pending. A null receipt is not a failed launch; poll with bounded backoff. |
| Receipt reverted | Onchain execution failed. Diagnose the revert, approvals and expiry before preparing another transaction. |
| Receipt succeeded; token info unavailable | Verify the expected launch event, then report confirmed with indexing pending. Do not launch again because indexing is delayed. |

## Errors and limits

No API key or login is required. Limits are per source IP; creation has a lower quota. For shared-server or high-volume use, request business-channel access. Decide by HTTP status and `code`, not by parsing `msg`. Save `X-Request-Id` when reporting a failure.

| Result | Action |
| --- | --- |
| `400` / `413` | Fix inputs or body size (maximum 1 MiB). Recheck quote usability, current price and the $1 opening buy. |
| `404` on token info | Verify chain, address and successful receipt. Indexing delay is not a reason to launch again. |
| `429` / `502` / `503` | Bounded exponential backoff with jitter, starting at ≥1 second. Cap `502` retries at 3; lower concurrency on persistent `429`. |
| `500` | Report the request ID. Do not retry indefinitely. |
| Pending transaction | Check its hash and receipt before any resubmission. Do not cache or reuse expired calldata. |

