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 (e.g. gpt-4o); defaults to provider default |
temperature | number | No | Sampling temperature (0–1, default 0) |
context | object | No | Key-value pairs for template substitution in the prompt |
system_prompt | string | No | System prompt / instructions for the model |
output_type | string | No | Output format: text or json (json forces structured output) |
output_schema | object | No | JSON schema to guide structured output (when output_type is json) |
max_tokens | integer | No | Maximum output tokens (default 4096) |
use_web_search | boolean | No | Enable web search (supported by OpenAI, Anthropic, Gemini, Perplexity) |
search_recency_filter | string | No | Perplexity only — filter by recency (day, week, month, year) |
search_domain_filter | array | No | Perplexity only — limit search to specific domains |
Response fields
| Field | Type | Description |
|---|---|---|
result | string | AI-generated output text |
model | string | Model that was used |
provider | string | Provider that was used |
usage | object | Token usage (promptTokens, completionTokens, totalTokens) |
Code
curl -X POST https://api.richapi.ai/api/v1/ai_enrich \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Summarise this: {{text}}",
"context": {
"text": "TexAu automates outreach."
},
"provider": "openai",
"mmax_tokens": 4096,
"output_type": "text"
}'Try it
Sign in to test this endpoint with your API key.
Sign in to try