Berry Press
Endpoints
Endpoints
Base URL: https://api.berryfi.net
Open to everyone
| Endpoint | Returns |
|---|---|
| GET /health | whether the API is up |
| GET /api/config | chain id, current contract addresses, supportedTokens |
| GET /api/creators/{address}/balance | credited6dp, spent6dp, remaining6dp (USDC, 6 decimals) |
| GET /api/creators/{address}/inference | total credited, plus each press |
| GET /api/creators/{address}/delegations | agents that can currently spend |
| GET /api/inference/quote?quoteValue=wei | a preview of the estimated credit |
| GET /api/tokens/{address}/resolve | for any Base token: market data, its largest Uniswap V4 pool, the pool settings it would register with, supportedForDeposit |
Entering with any token (via KyberSwap)
| Endpoint | Returns |
|---|---|
| GET /api/entry/quote?tokenIn&amountIn&tokenOut | a quote to swap any token into a deposit token |
| POST /api/entry/build | the transaction data for that swap |
| GET /api/zap/quote, POST /api/zap/build | an ordinary Uniswap V4 LP through Zap as a Service, not a Press vault |
Signed requests
| Endpoint | Signed by | Does |
|---|---|---|
| POST /api/inference/chat | the creator, or an agent with permission | spends inference through an OpenAI-compatible proxy |
| POST /api/delegations | the creator | lets an agent spend |
| POST /api/delegations/revoke | the creator | takes that permission away |
Messages to sign
- Spend: berry-inference:{address_lowercase}:{timestamp_ms}, valid 5 minutes
- Give permission: berry-delegate:{creator}:{agent}:{expiresAtMs}
- Remove permission: berry-revoke:{creator}:{agent}:{timestamp_ms}, valid 5 minutes