Base URL
http://localhost:8080🔐 Authentication
Most endpoints require authentication. Include your JWT token in the header:
Authorization: Bearer YOUR_JWT_TOKENPOST
/auth/send-otpSend OTP to phone number. The OTP is stored in Redis for 5 minutes.
Request Body
{
"phone": "+6281234567890"
}Response
{
"message": "OTP sent",
"otp": "123456" // Only in dev mode!
}cURL Example
curl -X POST "http://localhost:8080/auth/send-otp" \
-H "Content-Type: application/json" \
-d '{ "phone": "+6281234567890"}'POST
/auth/verify-otpVerify OTP and receive JWT token. Use this token for all authenticated requests.
Request Body
{
"phone": "+6281234567890",
"otp": "123456"
}Response
{
"token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": "uuid-here",
"phone": "+6281234567890"
}
}cURL Example
curl -X POST "http://localhost:8080/auth/verify-otp" \
-H "Content-Type: application/json" \
-d '{ "phone": "+6281234567890", "otp": "123456"}'GET
/auth/me🔒 Auth RequiredGet current authenticated user info.
Response
{
"id": "uuid-here",
"phone": "+6281234567890"
}cURL Example
curl -X GET "http://localhost:8080/auth/me" \
-H "Authorization: Bearer YOUR_TOKEN"💡 Tips
- • Use
stream: truefor real-time responses - • The
/v1/chat/completionsendpoint is stateless (no history) - • Use conversations for chat with memory
- • Token expires in 7 days
- • Audio supports: WebM, MP3, WAV, OGG, M4A