API Documentation

Everything you need to integrate the RichAPI API into your product.

AI

AI Enrich

Enrich, classify, extract, or summarize text using OpenAI, Anthropic, Gemini, or Perplexity.

POST
/api/v1/ai_enrich
2 credits per call

Parameters

FieldTypeRequiredDescription
providerstringYesAI provider: openai, anthropic, gemini, or perplexity
promptstringYesPrompt template; use {{fieldName}} placeholders for dynamic values
modelstringNoModel override (e.g. gpt-4o); defaults to provider default
temperaturenumberNoSampling temperature (0–1, default 0)
contextobjectNoKey-value pairs for template substitution in the prompt
system_promptstringNoSystem prompt / instructions for the model
output_typestringNoOutput format: text or json (json forces structured output)
output_schemaobjectNoJSON schema to guide structured output (when output_type is json)
max_tokensintegerNoMaximum output tokens (default 4096)
use_web_searchbooleanNoEnable web search (supported by OpenAI, Anthropic, Gemini, Perplexity)
search_recency_filterstringNoPerplexity only — filter by recency (day, week, month, year)
search_domain_filterarrayNoPerplexity only — limit search to specific domains

Response fields

FieldTypeDescription
resultstringAI-generated output text
modelstringModel that was used
providerstringProvider that was used
usageobjectToken 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