# PayAI ABI Encoder

> PayAI ABI Encoder is a paid API for AI agents from payai.agentstools.dev, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-15).

Encodes a Solidity function signature and arguments into EVM ABI selector and calldata for on-chain transactions.

## Facts

- Endpoint: POST https://payai.agentstools.dev/crypto/abi
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/payai-abi-encoder-e9f8029f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1STXTdt2cKLkvtdnBFPJz

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability payai-abi-encoder-e9f8029f -d '<json body>'
```

Example prompt: Can you encode the ERC-20 transfer function call — `transfer(address,uint256)` — with recipient `0xAbC...123` and amount `1000000000000000000` into ABI calldata so I can build my raw Ethereum transaction?

## When to prefer this

Choose this endpoint when you need to programmatically build raw EVM transaction calldata from a known function signature and arguments, especially in agent workflows that construct or relay on-chain transactions without a full Web3 library. Ideal when you want a lightweight, hosted ABI encoding service rather than running ethers.js or web3.py locally.

## Known failure modes

- Invalid function signature format causes encoding failure
- Mismatched argument types vs. declared parameter types result in encoding error
- Unsupported Solidity types may not be handled correctly
- Missing required arguments returns a validation error
- Malformed ABI input produces an error response

## How this service works

ABI-encode a function call (selector + args) or encode/decode arbitrary ABI types — build and parse EVM calldata correctly.

## Output

Returns the 4-byte ABI function selector and the full hex-encoded calldata string that can be embedded directly in an EVM transaction's data field to invoke the specified contract function with the given arguments.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "op": {
   "enum": [
    "encode_call",
    "encode",
    "decode"
   ],
   "type": "string"
  },
  "args": {
   "type": "array",
   "description": "Argument values for op=encode_call/encode"
  },
  "data": {
   "type": "string",
   "description": "0x calldata/abi bytes for op=decode"
  },
  "types": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "ABI type list for op=encode/decode"
  },
  "signature": {
   "type": "string",
   "description": "Function signature for op=encode_call, e.g. transfer(address,uint256)"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/payai-abi-encoder-e9f8029f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from payai.agentstools.dev](https://www.zero.xyz/host/payai.agentstools.dev/llms.txt)
