What API? There is no API, there is only signed events in relays. For example can publish a message to a chachi chat with nak: nak -k 9 -c message -t h=groupid relay.url