--- name: pa1m-reddit description: Access Reddit data and actions via the Pa1m Reddit API. Use this skill when the user asks to fetch Reddit posts, search Reddit, read comments, get user profiles, or post/vote/DM on Reddit. Pays per request in USDC on Base via x402 — no Reddit account needed for reads. --- # Pa1m Reddit — Claude Code Skill Pa1m Reddit gives AI agents access to Reddit data and actions via a clean REST API. No Reddit account needed for read operations. Pay per call in USDC on Base via x402. Base URL: https://reddit.hypa1m.xyz ## Read Endpoints — $0.01 each (no Reddit account needed) ### GET /posts — $0.01 Fetch posts from any subreddit. ``` GET https://reddit.hypa1m.xyz/posts?subreddit=python&sort=hot&limit=25 → { "posts": [ { "id": "1abc123", "title": "Post title", "author": "username", "score": 1234, "url": "https://reddit.com/r/python/comments/1abc123/...", "selftext": "...", "num_comments": 42, "created_utc": 1784900000, "subreddit": "python", "is_self": true } ], "after": "t3_xyz", "before": null } ``` Params: subreddit (required) | sort: hot/new/top/rising/controversial/best | t: hour/day/week/month/year/all | limit: 1–100 | after: cursor for pagination ### GET /search — $0.01 Search Reddit posts globally or within a subreddit. ``` GET https://reddit.hypa1m.xyz/search?q=openai&sort=new&t=week&limit=25 → { "posts": [...], "after": "...", "before": null } ``` Params: q (required) | subreddit | sort: relevance/new/hot/top/comments | t | nsfw | limit | after ### GET /comments — $0.01 Full comment tree by permalink URL. ``` GET https://reddit.hypa1m.xyz/comments?permalink=/r/python/comments/1abc123/title/ → { "post": {...}, "comments": [...] } ``` ### GET /comments/{post_id} — $0.01 Full comment tree by short post ID. ``` GET https://reddit.hypa1m.xyz/comments/1abc123 → { "post": {...}, "comments": [...] } ``` ### GET /user/{username} — $0.01 Public profile: karma, account age, flags. ``` GET https://reddit.hypa1m.xyz/user/spez → { "username": "spez", "karma": 123456, "created_utc": ..., "is_mod": false } ``` ### GET /user/{username}/comments — $0.01 User's recent comments with pagination. ``` GET https://reddit.hypa1m.xyz/user/spez/comments?sort=top&limit=25 → { "comments": [...], "after": "..." } ``` ## Write Endpoints (require Reddit session from POST /login) ### POST /login — $0.05 Authenticate a Reddit account, get session cookies for write operations. ``` POST https://reddit.hypa1m.xyz/login {"username": "...", "password": "...", "totp_secret": "..." (optional)} → {"success": true, "cookies": {"reddit_session": "...", "loid": "..."}} ``` ### POST /vote — $0.02 Upvote or downvote a post (t3_xxx) or comment (t1_xxx). ``` POST https://reddit.hypa1m.xyz/vote {"thing_id": "t3_abc123", "direction": "up", "reddit_session": "...", "loid": "..."} ``` direction: up | down | none ### POST /comment — $0.05 Submit a comment on a Reddit post. ``` POST https://reddit.hypa1m.xyz/comment {"post_url": "https://reddit.com/r/...", "text": "...", "reddit_session": "...", "loid": "..."} ``` ### POST /dm — $0.10 Send a direct message to a Reddit user. ``` POST https://reddit.hypa1m.xyz/dm {"to_username": "spez", "message": "Hello!", "reddit_session": "...", "loid": "..."} ``` ## Rate Limits (per wallet address) - Read endpoints (GET): no hard per-wallet limit — fair use expected - Write endpoints (POST): no hard per-wallet limit — Reddit's own rate limits apply downstream - HTTP 429 from Reddit API is proxied back as 429 — back off and retry ## Reliability & Agentic Best Practices **Idempotency** — x402 payment IDs are stored server-side. Retrying the same payment returns the same response — no double charge. **Replay protection** — each transaction ID accepted once. Reused payment IDs rejected with HTTP 400. **Retry pattern** — on 5xx or timeout, retry with the same payment. On 402, generate a new payment. On 429 (rate limit from Reddit), wait 60s and retry. **Session cookies** — cookies from POST /login are valid until Reddit revokes them (typically days to weeks). Cache them in your agent state to avoid repeated /login calls. **Read without account** — all GET endpoints work without Reddit session cookies. Only write endpoints (comment, vote, dm) require session from POST /login. ## Payment x402 protocol — agent auto-pays each request in USDC on Base. Wallet needed: any wallet with USDC on Base (eip155:8453). payTo: 0xE43b08f2031e3332ce97C0E0EA6E8bB00bd04fB4 ## Discovery OpenAPI: https://reddit.hypa1m.xyz/openapi.json Agent info: https://reddit.hypa1m.xyz/.well-known/agent.json Skill install: curl -fsSL https://reddit.hypa1m.xyz/skill.md -o ~/.claude/skills/pa1m-reddit/SKILL.md