Everything you need to integrate the RichAPI API into your product.
Enrich, classify, extract, or summarize text using OpenAI, Anthropic, Gemini, or Perplexity.
/api/v1/ai_enrichParameters
| Field | Type | Required | Description |
|---|---|---|---|
provider | string | Yes | AI provider: openai, anthropic, gemini, or perplexity |
prompt | string | Yes | Prompt template; use {{fieldName}} placeholders for dynamic values |
model | string | No | Model override; defaults to provider default model |
temperature | float | No | Sampling temperature between 0 and 2 |
context | object | No | Key-value pairs used for {{placeholder}} substitution in the prompt |
system_prompt | string | No | Optional system prompt or instructions |
output_type | string | No | Output format: text or json |
output_schema | object | No | JSON schema used to guide structured output when output_type is json |
max_tokens | int | No | Maximum output tokens; defaults to provider default |
use_web_search | bool | No | Enable web search when supported by the selected provider |
search_domain_filter | array | No | Perplexity only; limit search to specific domains |
search_recency_filter | string | No | Perplexity only; filter by recency: day, week, month, year |
Example response
{
"content": "TexAu automates outreach workflows.",
"finish_reason": "stop",
"input_tokens": 18,
"model": "gpt-4o-mini",
"output_tokens": 12,
"provider": "openai",
"tokens_used": 30
}Code
curl -X POST https://dev-api.richapi.ai/api/v1/ai_enrich \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "openai",
"prompt": "Summarise this: {{text}}",
"model": "gpt-4o-mini",
"temperature": 0.3,
"context": {
"text": "TexAu automates outreach."
},
"system_prompt": "You are a concise assistant.",
"output_type": "text",
"output_schema": {
"properties": {
"summary": {
"type": "string"
}
},
"type": "object"
},
"max_tokens": 4096,
"use_web_search": false,
"search_domain_filter": [
"openai.com"
],
"search_recency_filter": "week"
}'Try it
Sign in to test this endpoint with your API key.
Sign in to try