Expert Builder API
Create custom AI experts with domain-specific skills and knowledge. Build, chat, and export experts programmatically.
Overview
The Expert Builder API allows you to create AI experts tailored to specific domains. Experts are built with curated skills and can engage in domain-specific conversations.
Build Experts
Define a domain and GREP builds an expert with relevant skills.
Expert Chat
Engage in conversations with your experts using specialized knowledge.
Export
Export experts to Claude Code format for local use.
API Reference
/grep/expert/startStart an expert builder job. The expert will be built asynchronously.
Request Body
| Parameter | Type | Description |
|---|---|---|
| domain | string | Domain of expertise (3-500 chars) |
| depth | string | "standard" (~3 skills) or "deep" (~8 skills) |
| context | string? | Additional context (max 5000 chars) |
curl -X POST "https://api.grep.ai/v1/grep/expert/start" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"domain": "patent law and intellectual property",
"depth": "standard",
"context": "Focus on US patent prosecution"
}'Response
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "queued",
"message": "Expert builder job started"
}/grep/expert/jobGet the status and result of an expert builder job.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| job_id | string | The job ID from start response |
curl "https://api.grep.ai/v1/grep/expert/job?job_id=550e8400-e29b-41d4..." \
-H "Authorization: Bearer YOUR_API_KEY"Response (Complete)
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "complete",
"expert": {
"id": "expert-abc123",
"name": "Patent Law Expert",
"description": "Specialized in US patent prosecution...",
"skills": [
{
"name": "Patent Claim Analysis",
"description": "Analyze patent claims for validity..."
},
{
"name": "Prior Art Search",
"description": "Search for relevant prior art..."
}
]
}
}/grep/expertsList all experts accessible to the user, including their own and public experts.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| include_public | boolean | Include public experts (default: true) |
/grep/experts/registryGet the built-in expert registry with pre-configured experts.
Returns built-in experts that are code-defined, not user-created.
/grep/expert/{expert_id}Get detailed information about a specific expert including skills and configuration.
/grep/expert/{expert_id}/visibilitySet an expert's visibility to public or private.
Request Body
| Parameter | Type | Description |
|---|---|---|
| is_public | boolean | Whether the expert is publicly visible |
Expert Chat
/grep/expert/{expert_id}/chatSubmit a chat message to an expert. Returns a job ID for tracking the response.
Request Body
| Parameter | Type | Description |
|---|---|---|
| message | string | User's message to the expert |
| context | string? | Additional context for the message |
| status_webhook_url | string? | URL for real-time status updates |
| status_webhook_filter | string[]? | Filter: "Thinking", "text_block", "tool_use", "status" |
curl -X POST "https://api.grep.ai/v1/grep/expert/expert-abc123/chat" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "What is patentable subject matter under 35 USC 101?",
"context": "I am filing a software patent application"
}'Response
{
"job_id": "chat-job-xyz789",
"status": "queued",
"message": "Chat job started"
}/grep/expert/{expert_id}/chat/stream/{job_id}Stream expert chat response via Server-Sent Events (SSE).
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| replay | boolean | Replay historical messages (default: true) |
Connect with EventSource to receive real-time updates.
Webhook Integration
Use webhooks to receive real-time updates during expert chat. Filter which event types you want to receive.
Webhook Request with Filters
curl -X POST "https://api.grep.ai/v1/grep/expert/expert-abc123/chat" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "Analyze this patent claim...",
"status_webhook_url": "https://your-server.com/webhook",
"status_webhook_filter": ["Thinking", "text_block", "tool_use"]
}'Webhook Payload
{
"message_type": "text_block",
"message": "Based on my analysis of the patent claim...",
"job_id": "chat-job-xyz789",
"timestamp": "2024-01-15T10:30:00Z"
}Available Webhook Filters
Thinking- Extended thinking updatestext_block- Text response chunkstool_use- Tool invocation eventsstatus- General status messages
Export to Claude Code
/grep/expert/{expert_id}/export-claude-codeExport an expert to Claude Code format for local use.
curl -X POST "https://api.grep.ai/v1/grep/expert/expert-abc123/export-claude-code" \
-H "Authorization: Bearer YOUR_API_KEY"Response
{
"name": "patent-law-expert",
"description": "Patent Law Expert - Specialized in US patent prosecution",
"instructions": "You are a patent law expert specialized in...",
"prompt": "# Patent Law Expert\n\nYou are an expert in patent law..."
}Ready to Build Your Expert?
Get API access to start creating custom AI experts.