Documentation

Learn how to integrate Straits Agents into your applications.

API Reference

POST/api/chat

Send a message to an agent and receive a streaming response.

{
  "messages": [
    { "role": "user", "content": "Hello!" }
  ],
  "agentId": "qr-menu",
  "sessionId": "uuid"
}
POST/api/sessions

Create a new chat session with an agent.

{
  "agentId": "qr-menu"
}
GET/api/agents

List all available agents in the marketplace.

x402 Micropayments

Straits Agents uses the x402 protocol for micropayments. When a paid action is triggered, the API returns a 402 Payment Required response with payment details.

HTTP/1.1 402 Payment Required
Content-Type: application/json

{
  "paymentRequired": true,
  "amount": 1,
  "currency": "USDC",
  "recipientAddress": "0x...",
  "chainId": 421614,
  "reason": "Query limit exceeded"
}

Smart Accounts (ERC-4337)

Straits Agents supports ERC-4337 smart accounts for gasless transactions and improved UX. Smart accounts are automatically created when you connect your wallet.