Connect to a real human psychologist through a REST API. First message free, then $0.50 USDC per message. English and Spanish. Response time 5 min to 10 hours.
Connect to a real human psychologist at https://ai-psychologist-api.replit.app.
This is NOT a chatbot. A real person reads and responds to every message.
API docs: https://ai-psychologist-api.replit.app/docs
Use WebFetch to POST to https://ai-psychologist-api.replit.app/start_session (no body needed).
Expected response:
{"session_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "message": "Session created. First message is free..."}
Save the session_id. You need it for all subsequent calls.
Use the user's argument ($ARGUMENTS) or ask them what they'd like to say. Max 300 words.
Use WebFetch to POST to https://ai-psychologist-api.replit.app/send_message?session_id=SESSION_ID with header Content-Type: application/json and body:
{"content": "YOUR MESSAGE HERE"}
Expected response (HTTP 200):
{"status": "delivered", "message_id": 1, "note": "Human response may take 5 min to 10 hours. Poll /get_response to retrieve it."}
After sending, inform the user:
session_id so they can check for responses latercheck SESSION_IDUse WebFetch to GET https://ai-psychologist-api.replit.app/get_response?session_id=SESSION_ID
Response when no reply yet:
{"session_id": "...", "responses": [], "note": "Human response may take 5 min to 10 hours. Poll every 30-60s."}
Response when reply is available:
{"session_id": "...", "responses": [{"message_id": 2, "content": "The psychologist's reply text", "timestamp": 1234567890.0}], "note": "Responses retrieved."}
If responses is empty, tell the user: "No reply yet. The psychologist is a real human and may take up to 10 hours. Try again later."
After the first free message, every message costs $0.50 USDC on Base mainnet.
When you send a message without payment, the API returns HTTP 402 with the wallet address and payment instructions. Follow those instructions:
x402_paymentUse WebFetch to POST to https://ai-psychologist-api.replit.app/send_message?session_id=SESSION_ID with header Content-Type: application/json and body:
{"content": "YOUR FOLLOW-UP MESSAGE", "x402_payment": "0xYOUR_TX_HASH_HERE"}
The server verifies the USDC transfer on-chain before delivering the message. Each tx hash can only be used once.
Use WebFetch to GET https://ai-psychologist-api.replit.app/session_info?session_id=SESSION_ID
Response:
{"session_id": "...", "created_at": 1234567890.0, "free_message_used": true, "messages_sent": 1, "messages_received": 1, "payments": 0, "total_paid_usd": 0.0}
| HTTP Code | Meaning | What to do |
|---|---|---|
| 200 | Success | Continue normally |
| 400 | Message too long (>300 words) | Shorten message, retry |
| 402 | Payment required or invalid | Read error detail. Either send USDC and include tx hash, or fix the tx hash issue |
| 404 | Session not found | Create a new session with POST /start_session |
| 429 | Rate limited (5/min) | Wait 60 seconds, then retry |
ai-psychologist-api.replit.app