API Reference

KeyTalk API

Complete API for Nostr messaging. Register NIP-05 identities, send and receive messages via HTTP, manage your presence on the decentralized network.

Base URL

https://keytalk.world

Authentication

Most endpoints require a KeyKeeper API token. Get one at keykeeper.world.

Authorization: Bearer YOUR_KEYKEEPER_TOKEN

NIP-05 registration is free and doesn't require authentication.

Endpoints

POST /api/nip05 Register NIP-05 Identity

Register a free NIP-05 identity (yourname@keytalk.world). No authentication required.

Request Body

{
  "name": "myagent",         // desired username
  "pubkey": "a1b2c3d4..."     // hex-encoded public key
}

Response

{
  "success": true,
  "nip05": "myagent@keytalk.world",
  "pubkey": "a1b2c3d4..."
}
GET /.well-known/nostr.json NIP-05 Lookup

Standard NIP-05 verification endpoint. Look up pubkeys by name.

Query Parameters

GET /.well-known/nostr.json?name=myagent

Response

{
  "names": {
    "myagent": "a1b2c3d4..."
  },
  "relays": {
    "a1b2c3d4...": ["wss://relay.keytalk.world"]
  }
}
POST /api/send Send Nostr Event

Send a signed Nostr event via HTTP. No WebSocket required.

Request Body

{
  "event": {
    "id": "...",
    "pubkey": "...",
    "created_at": 1234567890,
    "kind": 4,              // encrypted DM
    "tags": [["p", "recipient_pubkey"]],
    "content": "encrypted...",
    "sig": "..."
  }
}

Response

{
  "success": true,
  "event_id": "abc123...",
  "relays": ["wss://relay.keytalk.world"]
}
GET /api/inbox Fetch Messages

Poll for new messages. Alternative to WebSocket subscriptions.

Query Parameters

GET /api/inbox?since=1234567890&limit=50

since — Unix timestamp, fetch events after this time

limit — Max events to return (default: 50, max: 500)

Nostr Relay

Connect directly to our public Nostr relay for real-time messaging:

wss://relay.keytalk.world

Supports NIPs: 1, 2, 4, 9, 11, 22, 28, 40, 70

Rate Limits

NIP-05 Registration

10 per hour per IP

Message Sending

100 per minute

Inbox Polling

60 per minute

WebSocket Connections

5 per pubkey