Core Endpoints
Chat API
Interactive AI-powered chat with literature search and hypothesis generation
POST
Chat API
Documentation Index
Fetch the complete documentation index at: https://mintlify.com/bio-xyz/BioAgents/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Chat API provides conversational AI capabilities with integrated literature search, hypothesis generation, and data analysis. It supports both synchronous and asynchronous execution modes.Authentication
All chat endpoints require authentication via JWT token or API key.Bearer token for JWT authentication
Alternative API key authentication
Execution Modes
The API operates in two modes based on theUSE_JOB_QUEUE environment variable:
- In-Process Mode (
USE_JOB_QUEUE=false): Executes synchronously and returns results directly - Queue Mode (
USE_JOB_QUEUE=true): Enqueues job to BullMQ and returns job ID for polling
POST /api/chat
Send a message to the AI agent for processing.Request Body
The user’s question or message to process
Optional conversation ID for multi-turn conversations. Auto-generated if not provided.
Optional array of files to upload and analyze (supports CSV, PDF, images)
Response (In-Process Mode)
Returns200 OK with the AI’s response.
The AI-generated response text
User ID for tracking (included for x402 payment users)
Response (Queue Mode)
Returns202 Accepted with job information.
BullMQ job ID for status polling
Database message ID for tracking
Conversation ID for multi-turn context
User ID for ownership verification
Job status:
queuedURL to check job status
Example: Basic Chat
Example Response (In-Process)
Example: Multi-Turn Conversation
Example: Chat with File Upload
GET /api/chat/status/:jobId
Check the status of a queued chat job (only available whenUSE_JOB_QUEUE=true).
Path Parameters
The job ID returned from POST /api/chat
Response Fields
Job status:
queued, active, completed, failed, or not_foundChat result (only present when status is
completed)Progress information (present during active execution)
Error message (only present when status is
failed)Number of retry attempts made
Example: Check Job Status
Example Response: Completed
Example Response: Processing
POST /api/chat/retry/:jobId
Manually retry a failed chat job.Authentication Required
Must be the owner of the job being retried.Path Parameters
The job ID to retry
Response Fields
Whether retry was successful
The job ID being retried
New status:
retryingHuman-readable status message
Number of previous retry attempts
Example: Retry Failed Job
Example Response
Error Codes
Missing required field (message) or invalid request format
Missing or invalid authentication credentials
Attempting to access another user’s job
Job not found or queue mode not enabled
Too many requests - rate limit exceeded
Server error during processing
Features
The Chat API automatically:- Literature Search: Queries OpenScholar, BioLit, and knowledge bases
- Hypothesis Generation: Creates testable hypotheses when appropriate
- File Processing: Extracts data from CSV, PDF, and image files
- Context Retention: Maintains conversation history across messages
- Token Usage Tracking: Monitors LLM token consumption per message
Rate Limits
Rate limits are configurable per authentication method:- JWT Users: Default 60 requests/minute
- API Key Users: Custom limits based on tier
- Anonymous Users: 10 requests/minute (if enabled)
Related Endpoints
- Deep Research API - Multi-iteration autonomous research
- Status API - Check deep research job progress
Chat API